[UP]


Manual Reference Pages  - num_images (3)

NAME

num_images(3f) - [FORTRAN:INTRINSIC:COLLECTIVE] Number of images

SYNTAX

result = num_images(distance, failed)

DESCRIPTION

Returns the number of images.

ARGUMENTS

DISTANCE
  (optional, intent(in)) Nonnegative scalar integer
FAILED (optional, intent(in)) Scalar logical expression

RETURN VALUE

Scalar default-kind integer. If DISTANCE is not present or has value 0, the number of images in the current team is returned. For values smaller or equal distance to the initial team, it returns the number of images index on the ancestor team which has a distance of DISTANCE from the invoking team. If DISTANCE is larger than the distance to the initial team, the number of images of the initial team is returned. If FAILED is not present the total number of images is returned; if it has the value .true., the number of failed images is returned, otherwise, the number of images which do have not the failed status.

EXAMPLE

Sample program:

   program demo_num_images
   implicit none
   integer :: value[*]
   integer :: i
   value = this_image()
      sync all
      if (this_image() == 1) then
        do i = 1, num_images()
          write(*,’(2(a,i0))’) ’value[’, i, ’] is ’, value[i]
        end do
      endif
   end program demo_num_images

STANDARD

[[Fortran 2008]] and later. With DISTANCE or FAILED argument, [[TS 18508]] or later

CLASS

Transformational function

SEE ALSO

this_image(3), image_index(3)


num_images (3) March 11, 2021
Generated by manServer 1.08 from 964654ee-a4ac-4964-896b-d8d3e0f93f0b using man macros.