next up previous contents
Next: Calls to the NAG Up: Extrinsic Procedures Previous: Uses of Extrinsics

 

Extrinsic instead of INDEPENDENT

One of the problems with current HPF compilers is the lack of support for INDEPENDENT DO loops. In general, the INDEPENDENT prefix is parsed and then ignored which means that INDEPENDENT loops are executed sequentially. It must be stressed that this situation is only temporary and will be resolved in the near future as tools mature.

As long as the INDEPENDENT DO loop does not involve any communication it is possible to simulate independent execution via the use of a cunningly written extrinsic procedure. The basic idea is to replace an INDEPENDENT DO loop with a call to a local extrinsic into which a modified version of the loop is placed. There is a small overhead as the extrinsic function will have to work out what the loop bounds should be but the net effect is that every extrinsic is able to execute its DO loop at the same time, that is, in parallel. One should also bear in mind that a compiler will generate a barrier synchronisation at entry to and exit from an EXTRINSIC.

Clearly, the extrinsic must be supplied with enough information to work out which array elements it owns. This is trivial for a F90_LOCAL but a bit more tricky for a F77_LOCAL extrinsic:

 !HPF$ DISTRIBUTE A(*,CYCLIC)
....
 !HPF$ INDEPENDENT, NEW(i)
 DO j = 1, n
  DO i = 1, m
   ! ... stuff missing
   A(i,j) = ...
  END DO
 END DO
....

the loop can be replaced by a call to the EXTRINSIC Ext_Loop:

....
 CALL Ext_Loop(A,...)
....

The EXTRINSIC contains the loop with n and m modified.

Now try this question gif

Return to corresponding overview page gif




next up previous contents
Next: Calls to the NAG Up: Extrinsic Procedures Previous: Uses of Extrinsics

©University of Liverpool, 1997
Wed May 28 20:20:27 BST 1997
Not for commercial use.