Suppose we still have b defined in previous section,
on (q) { Location i=x|1; at(i) b[i]=3; //correct b[i]=3; //error }
In general, at construct has the form,
at(Location i= ...) { array[i]=... }
This is similar to a traditional SPMD program like,
if( own(array[global_local(i)]) ) { array[global_local(i)]=... }
In HPJava, a more powerful construct over can be used to combine the switching of the active process group with a loop,
on(q) over(Location i= x|0:3) b[i]=3;
on(q) for(int n=0;n<4;n++) at(Location i=x|n) b[i]=3;
In general, over construct has the form,