Manual Reference Pages  - num_images (3fortran)

NAME

NUM_IMAGES(3) - [COLLECTIVE] Number of images

SYNOPSIS

result = num_images([team|team_number])

         integer function num_images (team)

type(TEAM_TYPE),intent(in),optional :: team integer(kind=KIND),intent(in),optional :: team_number

CHARACTERISTICS

o use of TEAM and TEAM_NUMBER is mutually exclusive
o TEAM is a scalar of type TEAM_TYPE from the intrinsic module ISO_FORTRAN_ENV.
o TEAM_NUMBER is an integer scalar.
o the result is a default integer scalar.

DESCRIPTION

NUM_IMAGES(3) Returns the number of images.

OPTIONS

o TEAM : shall be a scalar of type TEAM_TYPE from the intrinsic module ISO_FORTRAN_ENV, with a value that identifies the current or an ancestor team.
o TEAM_NUMBER : identifies the initial team or a team whose parent is the same as that of the current team.

RESULT

The number of images in the specified team, or in the current team if no team is specified.

EXAMPLES

Sample program:

    program demo_num_images
    implicit none
    integer :: value[*]
    real    :: p[*]
    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

! The following code uses image 1 to read data and ! broadcast it to other images. if (this_image()==1) then p=1234.5678 do i = 2, num_images() p[i] = p end do end if sync all

end program demo_num_images

STANDARD

Fortran 2008 . With DISTANCE or FAILED argument, TS 18508

SEE ALSO

THIS_IMAGE(3), IMAGE_INDEX(3)

Fortran intrinsic descriptions (license: MIT) @urbanjost


Nemo Release 3.1 num_images (3fortran) November 02, 2024
Generated by manServer 1.08 from a91fbe29-792a-4b85-b662-75f3927e66a4 using man macros.