next up previous contents
Next: Template Syntax Up: Data Distribution Previous: Example: 2D Gaussian Elimination

 

New HPF System Intrinsics

There are two new system enquiry intrinsics: NUMBER_OF_PROCESSORS and PROCESSORS_SHAPE. They provide information about the physical processors, ie, the hardware inside the box and not the configuration as specified in a PROCESSORS directive.

Can use NUMBER_OF_PROCESSORS intrinsic in initialisation expressions for portability,

!HPF$ PROCESSORS P1(NUMBER_OF_PROCESSORS())
!HPF$ PROCESSORS P2(4,4,NUMBER_OF_PROCESSORS()/16)
!HPF$ PROCESSORS P3(0:NUMBER_OF_PROCESSORS(1)-1, &
!HPF$                0:NUMBER_OF_PROCESSORS(2)-1)

NUMBER_OF_PROCESSORS returns information about physical processors. This intrinsic has one optional argument, DIM. If this is specified then the number of processors in that particular dimension is returned. For example, on a 2048 processor hypercube machine

 PRINT*, NUMBER_OF_PROCESSORS(2)

will display 2 whereas

 PRINT*, NUMBER_OF_PROCESSORS()

would give 2048

Can obtain physical shape using PROCESSORS_SHAPE intrinsic, for example,

    PRINT*, PROCESSORS_SHAPE()

on a 2048 processor hypercube gives

 2 2 2 2 2 2 2 2 2 2 2

These two intrinsics can be used in specification-expressions, they can be thought of as constants for one run of the program only. Their value cannot be assigned to a PARAMETER or even to a variable. The following will be flagged as an error:

   INTEGER, PARAMETER :: NoOfPs = NUMBER_OF_PROCESSORS()
   INTEGER            :: NumProcs = NUMBER_OF_PROCESSORS()

both functions may only be used in the context shown on the slide.

For a single processor workstation PROCESSORS_SHAPE returns zero-sized array of rank one.

Return to corresponding overview page gif


next up previous contents
Next: Template Syntax Up: Data Distribution Previous: Example: 2D Gaussian Elimination

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