W3cubDocs

/GNU Fortran 7

9.63 CO_BROADCAST — Copy a value to all images the current set of images

Description:

CO_BROADCAST copies the value of argument A on the image with image index SOURCE_IMAGE to all images in the current team. A becomes defined as if by intrinsic assignment. If the execution was successful and STAT is present, it is assigned the value zero. If the execution failed, STAT gets assigned a nonzero value and, if present, ERRMSG gets assigned a value describing the occurred error.

Standard:

Technical Specification (TS) 18508 or later

Class:

Collective subroutine

Syntax:

CALL CO_BROADCAST(A, SOURCE_IMAGE [, STAT, ERRMSG])

Arguments:
A INTENT(INOUT) argument; shall have the same dynamic type and type paramters on all images of the current team. If it is an array, it shall have the same shape on all images.
SOURCE_IMAGE a scalar integer expression. It shall have the same the same value on all images and refer to an image of the current team.
STAT (optional) a scalar integer variable
ERRMSG (optional) a scalar character variable
Example:
program test
  integer :: val(3)
  if (this_image() == 1) then
    val = [1, 5, 3]
  end if
  call co_broadcast (val, source_image=1)
  print *, this_image, ":", val
end program test
See also:

CO_MAX, CO_MIN, CO_SUM, CO_REDUCE

© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gfortran/CO_005fBROADCAST.html