next up previous

4.4.1 Mapping Directives

Mapping directivesgif can be used in MasPar Fortran to give the user control over array mapping. For example, for a 3-dimensional array A(10,100,100), the following directive produces the default cut-and-stack mapping:

CMPF MAP A(XBITS, YBITS, MEMORY)

To map A to the PE grid such that the first dimension is allocated in PE memory, the second in the X direction, and the third in the Y direction, use the directive

CMPF MAP A(MEMORY, XBITS, YBITS)

Note that this mapping gives a more even distribution of array elements over the PE grid than does the default.
Now consider a 16x4 array B on a 4x4 grid. The directive

CMPF MAP B(ALLBITS, MEMORY)

maps the first dimension across all the processors and the second dimension into PE memory. This mapping is better than the default when performing operations similar to a vector-matrix multiply (when the shape of the data so closely fits the PE grid).