This example demonstrates what happens if a single array item is used as an actual argument. Consider,
REAL, DIMENSION(100,100) :: A, B REAL :: z !HPF$ DISTRIBUTE (BLOCK,BLOCK) :: A, B INTERFACE SUBROUTINE Schmubbie(r,t,X) REAL, INTENT(OUT) :: r REAL, INTENT(IN) :: t REAL, INTENT(IN) :: X(:,:) !HPF$ DISTRIBUTE *(BLOCK,BLOCK) :: X END SUBROUTINE Schmubbie END INTERFACE ... CALL Schmubbie(A(1,1),z,B)
The subroutine Schmubbie is expecting three dummy arguments, two scalars followed by an array. Taking the actual arguments in order, A(1,1) is one element of a distributed object, in this case it will be mapped onto processor P(1,1), the procedure specifies no mapping for the corresponding scalar dummy argument, this generally means that the argument should be replicated. This means that the value of A(1,1) must be broadcast to every processor.
The second actual argument is a scalar so will already be replicated, the corresponding dummy is also scalar so will also be replicated. This will clearly involve no remapping.
The third argument is a distributed array which will remain distributed and again will cause no remapping.
Return to corresponding overview page