Intel® Fortran Compiler 18.0 Developer Guide and Reference

NUM_IMAGES

Transformational Intrinsic Function (Generic): Returns the number of images.

result = NUM_IMAGES()

Results

The result type is default integer. The result is the number of images.

You can specify a compiler option or environment variable to modify the number of images. If both are specified, the environment variable setting overrides the compiler option setting.

A compiler option must be specified to enable coarrays. If it is not specified and you use this intrinsic function, an error occurs.

Example

In the following example, image 1 is used to read data. The other images then copy the data:

REAL :: R[*]

IF (THIS_IMAGE()==1) THEN
   READ (7,*) R
   DO I = 2, NUM_IMAGES()
      R[I] = R
   END DO
END IF
SYNC ALL