CO_MIN — Minimal value on the current set of images#
-
CO_MIN(A, RESULT_IMAGE, STAT, ERRMSG)#
CO_MINdetermines element-wise the minimal value ofAon all images of the current team. IfRESULT_IMAGEis present, the minimal values are returned inAon the specified image only and the value ofAon the other images become undefined. IfRESULT_IMAGEis not present, the value is returned on all images. If the execution was successful andSTATis present, it is assigned the value zero. If the execution failed,STATgets assigned a nonzero value and, if present,ERRMSGgets assigned a value describing the occurred error.- Parameters:
A – shall be an integer, real or character variable, which has the same type and type parameters on all images of the team.
RESULT_IMAGE – (optional) a scalar integer expression; if present, it shall have 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
- Standard:
Technical Specification (TS) 18508 or later
- Class:
Collective subroutine
- Syntax:
CALL CO_MIN(A [, RESULT_IMAGE, STAT, ERRMSG])
- Example:
program test integer :: val val = this_image () call co_min (val, result_image=1) if (this_image() == 1) then write(*,*) "Minimal value", val ! prints 1 end if end program test
- See also:
CO_MAX — Maximal value on the current set of images, CO_SUM — Sum of values on the current set of images, CO_REDUCE — Reduction of values on the current set of images, CO_BROADCAST — Copy a value to all images the current set of images