### 15.3.3 DISTRIBUTE Directive (TU*X only)

The DISTRIBUTE directive specifies a simple mapping pattern of data objects across processors. There are two major types of mapping patterns that can be specified using this directive, block and cyclic.

The DISTRIBUTE directive takes one of the following forms:

  !HPF$ DISTRIBUTE d-object (format-list) [ONTO d-target]
  !HPF$ DISTRIBUTE (format-list) [ONTO d-target] :: d-object [, d-object]...
  !HPF$ DISTRIBUTE ONTO d-target :: d-object [, d-object]...
  d-object
  Is the name of the object to be distributed; it must be a simple name and not a subobject designator. This object cannot also appear as an a-object in an ALIGN directive.
  format-list
  Is a list of one or more of the following:
  - BLOCK [(expr)]

    Elements of a given dimension of an array are distributed in approximately equal-sized blocks, one block to a processor.

    The expr must be a specification expression whose value is a positive integer n such that, for every d-object, n x p >= d (equivalently, n >= |d/p|). The d is the extent of the corresponding dimension of the d-object and p is the corresponding dimension of the processors arrangement onto which the d-object is to be distributed.

  - CYCLIC [(expr)]

    Elements of a given dimension of an array are distributed to processors in round-robin fashion.

    The expr must be a specification expression whose value is a positive integer.

  - An asterisk (*)

    Specifies serial (non-distributed) mapping for a dimension of an array.

  The length of the list must equal the rank of d-object.

  d-target
  Is one of the following:
  - An asterisk (*)
  - [*] processor-name

Rules and Behavior

Each dimension of an array is distributed independently. This means that BLOCK and CYCLIC mapping patterns can be combined. (For more information, see the Compaq Fortran User Manual for Tru64 UNIX and Linux Alpha Systems.)

The DISTRIBUTE directive can appear only in the specification part of a scoping unit.

If an ONTO clause is present, d-target must name a processor arrangement declared in a PROCESSORS directive.

If both a format-list and d-target appear, the number of elements of the format-list that are not an asterisk (*) must equal the rank of the named processor arrangement.

If d-target appears without a format-list, the rank of each d-object must equal the rank of the named processor arrangement.

An asterisk (*) appearing before a left parenthesis "(" or following ONTO, specifies a descriptive mapping. This constitutes an assertion about the current mapping of a dummy argument on entry to a subprogram, rather than a request for a desired mapping of that dummy argument.

Examples

Consider the following example:

     !HPF$ DISTRIBUTE   GO_BOARD(CYCLIC,*)

The * specifies that GO_BOARD is not to be distributed along its second axis; an entire row is to be distributed as one object.

For More Information:

- On syntax rules for all HPF directives, see Section 15.3.1.
- On the PROCESSORS directive, see Section 15.3.6 and the Compaq Fortran User Manual for Tru64 UNIX and Linux Alpha Systems.
- On using DISTRIBUTE, see the Compaq Fortran User Manual for Tru64 UNIX and Linux Alpha Systems.

Previous Page Next Page Table of Contents