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_MIN --- Minimal value on the current set of images
9 *****************************************************
11 .. index:: CO_MIN, Collectives, minimal value
13 .. function:: CO_MIN(A, RESULT_IMAGE, STAT, ERRMSG)
15 ``CO_MIN`` determines element-wise the minimal value of :samp:`{A}` on all
16 images of the current team. If :samp:`{RESULT_IMAGE}` is present, the minimal
17 values are returned in :samp:`{A}` on the specified image only and the value
18 of :samp:`{A}` on the other images become undefined. If :samp:`{RESULT_IMAGE}` is
19 not present, the value is returned on all images. If the execution was
20 successful and :samp:`{STAT}` is present, it is assigned the value zero. If the
21 execution failed, :samp:`{STAT}` gets assigned a nonzero value and, if present,
22 :samp:`{ERRMSG}` gets assigned a value describing the occurred error.
25 shall be an integer, real or character variable,
26 which has the same type and type parameters on all images of the team.
29 (optional) a scalar integer expression; if
30 present, it shall have the same value on all images and refer to an
31 image of the current team.
34 (optional) a scalar integer variable
37 (optional) a scalar character variable
40 Technical Specification (TS) 18508 or later
46 .. code-block:: fortran
48 CALL CO_MIN(A [, RESULT_IMAGE, STAT, ERRMSG])
51 .. code-block:: fortran
56 call co_min (val, result_image=1)
57 if (this_image() == 1) then
58 write(*,*) "Minimal value", val ! prints 1