next up previous contents
Next: Aligning Allocatable Arrays Up: Alignment and Distribution Previous: Reverse Strided Alignment Example

 

Practical Example of Alignment

The following Fortran 90 program:

    PROGRAM Warty
     IMPLICIT NONE
     REAL, DIMENSION(4) :: C
     REAL, DIMENSION(8) :: D   
     REAL, DIMENSION(2) :: E   
      C = 1; D = 2
      E = D(::4) + C(::2)
    END PROGRAM Warty

should be given these HPF directives to ensure minimal (zero) communications:

!HPF$ ALIGN C(:) WITH D(::2)
!HPF$ ALIGN E(:) WITH D(::4)
!HPF$ DISTRIBUTE (BLOCK) :: D

Note, cannot distribute C or E. Only distribute align targets.

For more information, click here gif


next up previous contents
Next: Aligning Allocatable Arrays Up: Alignment and Distribution Previous: Reverse Strided Alignment Example

©University of Liverpool, 1997
Wed May 28 23:37:18 BST 1997
Not for commercial use.