Template:ElementTypeCommunication

When a variable is assigned to another, depending on where each variable is allocated to, there may be communication required to achieve this assignment. Table \ref{tab:eltypecomm} details the communication rules in the assignment \emph{assignmed variable := assigning variable}. If the communication is issued from MPMD programming style then this will be one sided. The default communication listed here is guaranteed to be safe, which may result in a small performance hit.

Communication Example
var a:Int; var b:Int :: allocated[single[on[2]]]; var p; par p from 0 to 3 { if (p==2) b:=p; a:=b; sync; };

This code will result in each process reading the value of b from process 2 and then writing this into a. As already noted, in absence of allocation information the default of allocating to all processes is used. In this example the variable a can be assumed to additionally have the type allocated[multiple]. Note that communication groups are the same as multiple in this context and share the same semantics. All variables marked multiple are private to their containing process.