In order to simplify the discussion of the behavior of ZEE , we will provide some simple definitions.
In sections of shattered execution, as well as promoted scalar functions, the flow of control may depend on the local values of the array elements. In other sections, each thread may perform the same computation, but in parallel. In sections that contain only scalar computations (including array reductions), there is (conceptually) only one thread of control.
We will define these three situations as follows:
[R] if (A) then B:=B+1; end;(By convention, parallel arrays are named with capital letters, while scalar variable are given lower-case names.) Because these sections can occur only in promoted functions or shattered control flow, there will be no inter-thread communication during these sections.
[R] if (x) then B:=B+1; end;There is a logical barrier synchronization after each statement in an SP section, although most of these are typically optimized away.
[R] if (x) then x:=x+1; end;
Note that a single parallel section (either a promoted function or shattered control flow) can contain both AP and SP sections. For example:
[R] for A := 1 to 10 do B := B-A; if (B < A) then B := B*2; end; end;