The programmer often wishes to explicitly distribute program
variables over the memory areas with respect to a set of
processors. Then, it is desirable for a program to have some
representations of the set of processors. This is done by the
PROCESSORS directive.
The syntax of a PROCESSOR definition looks like the syntax of
an array definition of Fortran:
!HPF$ PROCESSORS P (10) |
P. Sets of abstract processors, or processor
arrangements, can be multi-dimensional. For instance,
!HPF$ PROCESSORS Q (4, 4) |
!HPF$ TEMPLATE T (50, 50, 50) |
DISTRIBUTE, does this task. Suppose that we have
!HPF$ PROCESSORS P1 (4) !HPF$ TEMPLATE T (17) |
T may be distributed over
P1.
A distribution directive specifies how template elements are mapped to
processors.
Block distributions are represented by
!HPF$ DISTRIBUTE T1 (BLOCK) ONTO P1 !HPF$ DISTRIBUTE T1 (BLOCK (6)) ONTO P1 |
!HPF$ DISTRIBUTE T1 (CYCLIC) ONTO P1 !HPF$ DISTRIBUTE T1 (CYCLIC (6)) ONTO P1 |
!HPF$ PROCESSOR P2 (4, 3) !HPF$ TEMPLATE T2 (17, 20) !HPF$ DISTRIBUTE T2 (CYCLIC, BLOCK) ONTO P2 |
T2 is cyclically distributed over the
first dimension of P2, and the second dimension of of T2
is distributed blockwise over the second dimension of P2.
Another important feature is that some dimensions of a template
might have collapsed mapping, allowing a template to be
distributed onto a processor arrangement with fewer dimensions than
template:
!HPF$ DISTRIBUTE T2 (BLOCK, *) ONTO P1 |
T2 will be
block-distributed over P1. But, for a fixed value of the index
T2, all values of the second subscript are mapped to the same
processor.