public subroutine halo_allreduce_max(local_val, global_val)
MPI_Allreduce with MPI_MAX — max-type reductions are exact in FP,
so a global max stays layout-reproducible (ocean-MPI plan D5).
Used for auto_n_inner’s global gravity-wave CFL (shared n_inner).
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Variables
Type
Visibility
Attributes
Name
Initial
type(comm_t),
private
::
comm
Source Code
subroutine halo_allreduce_max(local_val,global_val)!! MPI_Allreduce with MPI_MAX — max-type reductions are exact in FP,!! so a global max stays layout-reproducible (ocean-MPI plan D5).!! Used for auto_n_inner's global gravity-wave CFL (shared n_inner).real(wp),intent(in)::local_valreal(wp),intent(out)::global_valtype(comm_t)::commcomm=comm_env_compute_comm()! Single rank: the reduction is the identity, so return this rank's! own contribution without entering a collective. Not just an! optimisation -- pic-mpi's serial backend (PIC_ENABLE_MPI=OFF)! deliberately `error stop`s in `allreduce`, pushing the size()==1! case onto the caller. This IS that case.if(comm%size()==1)thenglobal_val=local_valreturn end if call allreduce(comm,local_val,global_val,op=MPI_MAX)end subroutine halo_allreduce_max