2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
8 CO_BROADCAST --- Copy a value to all images the current set of images
9 *********************************************************************
11 .. index:: CO_BROADCAST, Collectives, value broadcasting
13 .. function:: CO_BROADCAST(A, SOURCE_IMAGE, STAT, ERRMSG)
15 ``CO_BROADCAST`` copies the value of argument :samp:`{A}` on the image with
16 image index ``SOURCE_IMAGE`` to all images in the current team. :samp:`{A}`
17 becomes defined as if by intrinsic assignment. If the execution was
18 successful and :samp:`{STAT}` is present, it is assigned the value zero. If the
19 execution failed, :samp:`{STAT}` gets assigned a nonzero value and, if present,
20 :samp:`{ERRMSG}` gets assigned a value describing the occurred error.
23 INTENT(INOUT) argument; shall have the same
24 dynamic type and type parameters on all images of the current team. If it
25 is an array, it shall have the same shape on all images.
28 a scalar integer expression.
29 It shall have the same value on all images and refer to an
30 image of the current team.
33 (optional) a scalar integer variable
36 (optional) a scalar character variable
39 Technical Specification (TS) 18508 or later
45 .. code-block:: fortran
47 CALL CO_BROADCAST(A, SOURCE_IMAGE [, STAT, ERRMSG])
50 .. code-block:: fortran
54 if (this_image() == 1) then
57 call co_broadcast (val, source_image=1)
58 print *, this_image, ":", val