With the introduction of task parallelism, every subprogram in HPF must be compiled in such a way that it can be executed on any processor subset. The compiler cannot make any assumptions on which processors the code is executed at runtime. It might also be possible that the code will be executed several times on completely different processor subsets.
subroutine TASK (A, B, N) real, dimension (N) :: A, B !hpf$ distribute (block) :: A, B real, dimension (N) :: C !hpf$ distribute (block) :: C ... end subroutine TASK
This implies the following strategies for the HPF compiler:
module DATA integer, parameter :: N = 10000 real, dimension (N,N) :: A !hpf$ distribute A(block,block) end module DATA subroutine SUB (..) use DATA real, dimension (N,N) :: B !hpf$ distribute B(block,block) B = A end subroutine SUB
In the current version of ADAPTOR, the compiler assumes that all global data will be resident on the active processors.
module DATA !hpf$ processors P(3,3) ! universal processor arrangement end module DATA subroutine SUB (..) use DATA real, dimension (N,N) :: B !hpf$ distribute B(block,block) onto P ! be careful ... end subroutine SUB
The HPF standard provides the subset directive to define processor arrangements that are not universal. This feature is not supported within ADAPTOR yet.
The access to global arrays causes serious problems for HPF compilers generating SPMD code based on message passing. Data can be on processors that are not in the active processor subset and these processors cannot send or receive the accessed data. The correct implementation would require one-sided communication.
ADAPTOR always assumes that access to global data is resident. Unfortunately, this implies a certain responsibility for the user.