next up previous contents
Next: Solution Up: Procedures Previous: Solution

 

Procedures

What is bad about the procedure in the following code and what will happen as control enters and leaves the procedure:

   PROGRAM Bug_Day
    REAL, DIMENSION(100,100) :: A
    !HPF$ PROCESSORS, DIMENSION(4,4) :: P
    !HPF$ DISTRIBUTE (BLOCK,BLOCK) ONTO P :: A

    INTERFACE
     SUBROUTINE Feck(X)
      REAL, DIMENSION(100,50) :: X
      !HPF$ PROCESSORS, DIMENSION(4,4) :: P
      !HPF$ DISTRIBUTE *(BLOCK,BLOCK) ONTO *P :: X
     END SUBROUTINE Feck
    END INTERFACE

    ! ...

    CALL Feck(A(1:100,51:100))

    ! ...

    CALL Feck(A(1:100,1:50))

    ! ...

   END PROGRAM Bug_Day

Give two suggestions as to how the problem may be averted.




next up previous contents
Next: Solution Up: Procedures Previous: Solution

Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 14:10:26 GMT 1996