Manual Reference Pages  - co_max (3fortran)

NAME

CO_MAX(3) - [COLLECTIVE] Maximal value on the current set of images

SYNOPSIS

call co_max(a, result_image [,stat] [,errmsg] )

CHARACTERISTICS

DESCRIPTION

CO_MAX(3) determines element-wise the maximal value of A on all images of the current team. If result_image is present, the maximum values are returned in A on the specified image only and the value of A on the other images become undefined. If result_image is not present, the value is returned on all images. 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.

OPTIONS

o A : shall be an integer, real or character variable, which has the same type and type parameters on all images of the team.
o RESULT_IMAGE : (optional) a scalar integer expression; if present, it shall have the same the same value on all images and refer to an image of the current team.
o STAT : (optional) a scalar integer variable
o ERRMSG : (optional) a scalar character variable

EXAMPLES

Sample program:

    program demo_co_max
    implicit none
    integer :: val
       val = this_image()
       call co_max(val, result_image=1)
       if (this_image() == 1) then
         write(*,*) "Maximal value", val  ! prints num_images()
       endif
    end program demo_co_max

Results:

        Maximal value           2

STANDARD

TS 18508

SEE ALSO

CO_MIN(3), CO_SUM(3), CO_REDUCE(3), CO_BROADCAST(3)

fortran-lang intrinsic descriptions


Nemo Release 3.1 co_max (3fortran) April 28, 2024
Generated by manServer 1.08 from 8fc31721-a6a1-4b03-b9b9-a7cd1141cb47 using man macros.