NUM_IMAGES(3) - [COLLECTIVE] Number of images
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
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.
NUM_IMAGES(3) Returns the number of images.
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.
The number of images in the specified team, or in the current team if no team is specified.
Sample program:
program demo_num_images implicit none integer :: value[*] real :: p[*] integer :: ivalue = 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
Fortran 2008 . With DISTANCE or FAILED argument, TS 18508
THIS_IMAGE(3), IMAGE_INDEX(3)
Fortran intrinsic descriptions (license: MIT) @urbanjost
Nemo Release 3.1 | num_images (3fortran) | November 02, 2024 |