[UP]


Manual Reference Pages  - this_image (3)

NAME

this_image(3f) - [FORTRAN:INTRINSIC] Cosubscript index of this image

CONTENTS

Syntax
Description
Arguments
Return Value
Example
Standard
Class
See Also

SYNTAX

result = this_image() result = this_image(distance) result = this_image(coarray [, dim])

DESCRIPTION

Returns the cosubscript for this image.

ARGUMENTS

DISTANCE
  - (optional, intent(in)) Nonnegative scalar integer (not permitted together with COARRAY).
COARRAY
  - Coarray of any type (optional; if DIM present, required).
DIM - default integer scalar (optional). If present, DIM shall be between one and the corank of COARRAY.

RETURN VALUE

Default integer. If COARRAY is not present, it is scalar; if DISTANCE is not present or has value 0, its value is the image index on the invoking image for the current team, for values smaller or equal distance to the initial team, it returns the image 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 image index of the initial team is returned. Otherwise when the COARRAY is present, if DIM is not present, a rank-1 array with corank elements is returned, containing the cosubscripts for COARRAY specifying the invoking image. If DIM is present, a scalar is returned, with the value of the DIM element of this_image(coarray).

EXAMPLE

Sample program:

   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
   end if

! Check whether the current image is the initial image if (this_image(huge(1)) /= this_image()) error stop "something is rotten here"

STANDARD

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

CLASS

Transformational function

SEE ALSO

[[num_images]], [[image_index]]


this_image (3) March 19, 2019
Generated by manServer 1.08 from f7bce1b9-aaa7-4ad8-bba7-100798f6db98 using man macros.