1.8. Exchange between Scalar and Vector Data

Communication between the control processor and the parallel PEs also requires additional language constructs or in some cases an adapted semantics. Transferring a scalar field into a parallel vector is invoked with procedure LOAD, while transferring data back into a scalar field from a vector is accomplished with STORE (see Figure 10). Only active PEs participate in this sequential data exchange. STORE with inactive PEs does not result in gaps in the scalar array, but data elements are stored subsequently. LOAD with inactive PEs assigns the next array value to the next active PE, no scalar array elements will be skipped. Surplus elements will not be used, too few elements leave the corresponding array elements (or vector components, respectively) unchanged. The execution of this operation usually requires n time steps for a data array with n elements. A scalar integer variable may be specified as an optional third parameter for LOAD and STORE, in which the number of data items actually transferred will be returned.
CONFIGURATION list[1..n]; 
VAR  s: ARRAY[1..n] OF INTEGER; 
	t: INTEGER;
	v: list OF INTEGER;
... 
LOAD (v, s);  (* from scalar to vector *) 
STORE(v, s);  (* from vector to scalar *)
STORE(v, s, t);  (* here, t becomes 5  *)
 (* require n steps each *)

v := t; (* requires 1 step *)

Figure 10 Data exchanges between PEs and control processor

Figure 10 (on the right-hand side) also shows an assignment in which a (constant or variable) scalar data value is copied into all or a group of PEs. Every component of the vector contains the same value as the scalar. This operation is implemented by an implicit broadcast and therefore requires only a single time step.


[ Previous Page | Table of Contents | Next Page ]