FMS 2025.01.02-dev
Flexible Modeling System
Loading...
Searching...
No Matches
mpp_mod

This module defines interfaces for common operations using message-passing libraries. Any type-less arguments in the documentation are MPP_TYPE_ which is defined by the pre-processor to create multiple subroutines out of one implementation for use in an interface. See the note below for more information. More...

Data Types

interface  array_to_char
 Takes a given integer or real array and returns it as a string. More...
 
type  clock
 a clock contains an array of event profiles for a region More...
 
type  clock_data_summary
 Summary of information from a clock run. More...
 
type  communicator
 Communication information for message passing libraries. More...
 
type  event
 Communication event profile. More...
 
interface  mpp_alltoall
 Scatter a vector across all PEs. More...
 
interface  mpp_broadcast
 Perform parallel broadcasts. More...
 
interface  mpp_chksum
 Calculate parallel checksums. More...
 
interface  mpp_error
 Error handler. More...
 
interface  mpp_gather
 Gather data sent from pelist onto the root pe Wrapper for MPI_gather, can be used with and without indices. More...
 
interface  mpp_max
 Reduction operations. Find the max of scalar a from the PEs in pelist result is also automatically broadcast to all PEs. More...
 
interface  mpp_min
 Reduction operations. Find the min of scalar a from the PEs in pelist result is also automatically broadcast to all PEs. More...
 
interface  mpp_recv
 Recieve data from another PE. More...
 
interface  mpp_scatter
 Scatter (ie - is) * (je - js) contiguous elements of array data from the designated root pe into contigous members of array segment in each pe that is included in the pelist argument. More...
 
interface  mpp_send
 Send data to a receiving PE. More...
 
interface  mpp_sum
 Reduction operation. More...
 
interface  mpp_sum_ad
 Calculates sum of a given numerical array across pe's for adjoint domains. More...
 
interface  mpp_transmit
 Basic message-passing call. More...
 
type  mpp_type
 Data types for generalized data transfer (e.g. MPI_Type) More...
 
interface  mpp_type_create
 Create a mpp_type variable. More...
 
type  mpp_type_list
 Persisent elements for linked list interaction. More...
 
type  summary_struct
 holds name and clock data for use in mpp_util.h More...
 

Functions/Subroutines

integer function get_peset (pelist)
 Makes a PE set out of a PE list. A PE list is an ordered list of PEs a PE set is a triad (start,log2stride,size) for SHMEM, an a communicator for MPI if stride is non-uniform or not a power of 2, will return error (not required for MPI but enforced for uniformity)
 
subroutine mpp_broadcast_2d_ (broadcast_data, length, from_pe, pelist)
 
subroutine mpp_broadcast_3d_ (broadcast_data, length, from_pe, pelist)
 
subroutine mpp_broadcast_4d_ (broadcast_data, length, from_pe, pelist)
 
subroutine mpp_broadcast_5d_ (broadcast_data, length, from_pe, pelist)
 
subroutine mpp_broadcast_scalar_ (broadcast_data, from_pe, pelist)
 
subroutine mpp_error_basic (errortype, errormsg)
 A very basic error handler uses ABORT and FLUSH calls, may need to use cpp to rename.
 
subroutine mpp_recv_ (get_data, get_len, from_pe, block, tag, request)
 
subroutine mpp_recv_2d_ (get_data, get_len, from_pe, block, tag, request)
 
subroutine mpp_recv_3d_ (get_data, get_len, from_pe, block, tag, request)
 
subroutine mpp_recv_4d_ (get_data, get_len, from_pe, block, tag, request)
 
subroutine mpp_recv_5d_ (get_data, get_len, from_pe, block, tag, request)
 
subroutine mpp_recv_scalar_ (get_data, from_pe, glen, block, tag, request)
 
subroutine mpp_send_ (put_data, put_len, to_pe, tag, request)
 
subroutine mpp_send_2d_ (put_data, put_len, to_pe, tag, request)
 
subroutine mpp_send_3d_ (put_data, put_len, to_pe, tag, request)
 
subroutine mpp_send_4d_ (put_data, put_len, to_pe, tag, request)
 
subroutine mpp_send_5d_ (put_data, put_len, to_pe, tag, request)
 
subroutine mpp_send_scalar_ (put_data, to_pe, plen, tag, request)
 
subroutine mpp_sum_2d_ (a, length, pelist)
 Sums 2d array across pes.
 
subroutine mpp_sum_2d_ad_ (a, length, pelist)
 Sums 2d array across pes.
 
subroutine mpp_sum_3d_ (a, length, pelist)
 Sums 3d array across pes.
 
subroutine mpp_sum_3d_ad_ (a, length, pelist)
 Sums 3d array across pes.
 
subroutine mpp_sum_4d_ (a, length, pelist)
 Sums 4d array across pes.
 
subroutine mpp_sum_4d_ad_ (a, length, pelist)
 Sums 4d array across pes.
 
subroutine mpp_sum_5d_ (a, length, pelist)
 Sums 5d array across pes.
 
subroutine mpp_sum_5d_ad_ (a, length, pelist)
 Sums 5d array across pes.
 
subroutine mpp_sum_scalar_ (a, pelist)
 Sums array a when only first element is passed: this routine just converts to a call to MPP_SUM_.
 
subroutine mpp_sum_scalar_ad_ (a, pelist)
 Sums array a. when only first element is passed: this routine just converts to a call to MPP_SUM_.
 
subroutine mpp_sync (pelist, do_self)
 Synchronize PEs in list.
 
subroutine mpp_sync_self (pelist, check, request, msg_size, msg_type)
 This is to check if current PE's outstanding puts are complete but we can't use shmem_fence because we are actually waiting for a remote PE to complete its get.
 
subroutine mpp_transmit_2d_ (put_data, put_len, to_pe, get_data, get_len, from_pe, block, tag, recv_request, send_request)
 
subroutine mpp_transmit_3d_ (put_data, put_len, to_pe, get_data, get_len, from_pe, block, tag, recv_request, send_request)
 
subroutine mpp_transmit_4d_ (put_data, put_len, to_pe, get_data, get_len, from_pe, block, tag, recv_request, send_request)
 
subroutine mpp_transmit_5d_ (put_data, put_len, to_pe, get_data, get_len, from_pe, block, tag, recv_request, send_request)
 
subroutine mpp_transmit_scalar_ (put_data, to_pe, get_data, from_pe, plen, glen, block, tag, recv_request, send_request)
 

Variables

integer clock0
 measures total runtime from mpp_init to mpp_exit
 
integer clock_grain =CLOCK_LOOP-1
 
integer clock_num =0
 
type(summary_struct), dimension(max_clocks) clock_summary
 
type(clock), dimension(max_clocks), save clocks
 
character(len=32), parameter configfile ='logfile'
 
integer cur_recv_request = 0
 
integer cur_send_request = 0
 
integer current_clock =0
 
integer current_peset_max = 32
 
integer current_peset_num =0
 
type(mpp_type_listdatatypes
 
logical debug = .false.
 
integer(i8_kind) end_tick
 
integer err_unit =ERROR_UNIT
 
integer error
 
integer error_state =0
 
integer etc_unit
 
logical etc_unit_is_stderr = .false.
 
character(len=32) etcfile ='/dev/null'
 
logical first_call_system_clock_mpi =.TRUE.
 
integer get_len_nocomm = 0
 needed for mpp_transmit_nocomm.h
 
integer in_unit =INPUT_UNIT
 Use the intrinsics in iso_fortran_env.
 
character(len=:), dimension(:), allocatable, target, public input_nml_file
 
integer log_unit
 
integer max_request = 0
 
integer, parameter max_request_min = 10000
 
integer(i8_kind) max_ticks
 
logical module_is_initialized = .false.
 
real(r8_kind) mpi_count0 =0
 use to prevent integer overflow
 
real(r8_kind) mpi_tick_rate =0.d0
 clock rate for mpi_wtick()
 
type(mpp_type), target, public mpp_byte
 
integer, parameter, public mpp_comm_null = 67108864
 MPP_COMM_NULL acts as an analagous mpp-macro for MPI_COMM_NULL to share with fms2_io NetCDF4 mpi-io. The default value for the no-mpi case comes from Intel MPI and MPICH. OpenMPI sets a default value of '2'.
 
integer mpp_comm_private
 
integer, parameter, public mpp_info_null = 469762048
 MPP_INFO_NULL acts as an analagous mpp-macro for MPI_INFO_NULL to share with fms2_io NetCDF4 mpi-io. The default value for the no-mpi case comes from Intel MPI and MPICH. OpenMPI sets a default value of '0'.
 
integer, parameter, public mpp_init_test_clocks_init = 2
 
integer, parameter, public mpp_init_test_datatype_list_init = 3
 
integer, parameter, public mpp_init_test_etc_unit = 6
 
integer, parameter, public mpp_init_test_full_init = -1
 
integer, parameter, public mpp_init_test_init_true_only = 0
 
integer, parameter, public mpp_init_test_logfile_init = 4
 
integer, parameter, public mpp_init_test_peset_allocated = 1
 
integer, parameter, public mpp_init_test_read_namelist = 5
 
integer, parameter, public mpp_init_test_requests_allocated = 7
 
logical, public mpp_record_timing_data =.TRUE.
 
integer mpp_stack_hwm =0
 
integer mpp_stack_size =0
 
integer npes =1
 
integer num_clock_ids =0
 
integer out_unit =OUTPUT_UNIT
 
integer pe =0
 
type(communicator), dimension(:), allocatable peset
 Will be allocated starting from 0, 0 is a dummy used to hold single-PE "self" communicator.
 
integer, parameter peset_max = 10000
 
integer peset_num =0
 
integer, dimension(max_clocks) previous_clock =0
 
logical read_ascii_file_on = .FALSE.
 
integer request_multiply = 20
 
integer, dimension(:), allocatable request_recv
 
integer, dimension(:), allocatable request_send
 
integer root_pe =0
 
integer, dimension(:), allocatable size_recv
 
integer(i8_kind) start_tick
 
integer stdout_unit
 
logical sync_all_clocks = .false.
 
integer(i8_kind) tick
 
integer(i8_kind) tick0 =0
 
real tick_rate
 
integer(i8_kind) ticks_per_sec
 
integer, dimension(:), allocatable type_recv
 
logical verbose =.FALSE.
 
integer warn_unit
 unit number of the warning log
 
character(len=32), parameter warnfile ='warnfile'
 base name for warninglog (appends ".<PE>.out")
 
logical warnings_are_fatal = .FALSE.
 
integer world_peset_num
 the world communicator
 

Detailed Description

This module defines interfaces for common operations using message-passing libraries. Any type-less arguments in the documentation are MPP_TYPE_ which is defined by the pre-processor to create multiple subroutines out of one implementation for use in an interface. See the note below for more information.

Author
V. Balaji <"V.Balaji@noaa.gov">

A set of simple calls to provide a uniform interface to different message-passing libraries. It currently can be implemented either in the SGI/Cray native SHMEM library or in the MPI standard. Other libraries (e.g MPI-2, Co-Array Fortran) can be incorporated as the need arises.

The data transfer between a processor and its own memory is based on load and store operations upon memory. Shared-memory systems (including distributed shared memory systems) have a single address space and any processor can acquire any data within the memory by load and store. The situation is different for distributed parallel systems. Specialized MPP systems such as the T3E can simulate shared-memory by direct data acquisition from remote memory. But if the parallel code is distributed across a cluster, or across the Net, messages must be sent and received using the protocols for long-distance communication, such as TCP/IP. This requires a `‘handshaking’' between nodes of the distributed system. One can think of the two different methods as involving puts or gets (e.g the SHMEM library), or in the case of negotiated communication (e.g MPI), sends and recvs.

The difference between SHMEM and MPI is that SHMEM uses one-sided communication, which can have very low-latency high-bandwidth implementations on tightly coupled systems. MPI is a standard developed for distributed computing across loosely-coupled systems, and therefore incurs a software penalty for negotiating the communication. It is however an open industry standard whereas SHMEM is a proprietary interface. Besides, the puts or gets on which it is based cannot currently be implemented in a cluster environment (there are recent announcements from Compaq that occasion hope).

The message-passing requirements of climate and weather codes can be reduced to a fairly simple minimal set, which is easily implemented in any message-passing API. mpp_mod provides this API.

Features of mpp_mod include:

  1. Simple, minimal API, with free access to underlying API for more complicated stuff.
  2. Design toward typical use in climate/weather CFD codes.
  3. Performance to be not significantly lower than any native API.

This module is used to develop higher-level calls for domain decomposition (mpp_domains) and parallel I/O (FMS2 IO)
Parallel computing is initially daunting, but it soon becomes second nature, much the way many of us can now write vector code without much effort. The key insight required while reading and writing parallel code is in arriving at a mental grasp of several independent parallel execution streams through the same code (the SPMD model). Each variable you examine may have different values for each stream, the processor ID being an obvious example. Subroutines and function calls are particularly subtle, since it is not always obvious from looking at a call what synchronization between execution streams it implies. An example of erroneous code would be a global barrier call (see mpp_sync below) placed within a code block that not all PEs will execute, e.g:

   if( pe.EQ.0 )call mpp_sync()
   

Here only PE 0 reaches the barrier, where it will wait indefinitely. While this is a particularly egregious example to illustrate the coding flaw, more subtle versions of the same are among the most common errors in parallel code.
It is therefore important to be conscious of the context of a subroutine or function call, and the implied synchronization. There are certain calls here (e.g mpp_declare_pelist, mpp_init, mpp_set_stack_size) which must be called by all PEs. There are others which must be called by a subset of PEs (here called a pelist) which must be called by all the PEs in the pelist (e.g mpp_max, mpp_sum, mpp_sync). Still others imply no synchronization at all. I will make every effort to highlight the context of each call in the MPP modules, so that the implicit synchronization is spelt out.
For performance it is necessary to keep synchronization as limited as the algorithm being implemented will allow. For instance, a single message between two PEs should only imply synchronization across the PEs in question. A global synchronization (or barrier) is likely to be slow, and is best avoided. But codes first parallelized on a Cray T3E tend to have many global syncs, as very fast barriers were implemented there in hardware.
Another reason to use pelists is to run a single program in MPMD mode, where different PE subsets work on different portions of the code. A typical example is to assign an ocean model and atmosphere model to different PE subsets, and couple them concurrently instead of running them serially. The MPP module provides the notion of a current pelist, which is set when a group of PEs branch off into a subset. Subsequent calls that omit the pelist optional argument (seen below in many of the individual calls) assume that the implied synchronization is across the current pelist. The calls mpp_root_pe and mpp_npes also return the values appropriate to the current pelist. The mpp_set_current_pelist call is provided to set the current pelist.

Note
F90 is a strictly-typed language, and the syntax pass of the compiler requires matching of type, kind and rank (TKR). Most calls listed here use a generic type, shown here as MPP_TYPE_. This is resolved in the pre-processor stage to any of a variety of types. In general the MPP operations work on 4-byte and 8-byte variants of integer, real, complex, logical variables, of rank 0 to 5, leading to 48 specific module procedures under the same generic interface. Any of the variables below shown as MPP_TYPE_ is treated in this way.

Data Type Documentation

◆ mpp_mod::array_to_char

interface mpp_mod::array_to_char

Takes a given integer or real array and returns it as a string.

Parameters
[in]arrayAn array of integers or reals
Returns
string equivalent of given array

Definition at line 411 of file mpp.F90.

Public Member Functions

 iarray_to_char
 
 rarray_to_char
 

◆ mpp_mod::clock

type mpp_mod::clock

a clock contains an array of event profiles for a region

Definition at line 250 of file mpp.F90.

Collaboration diagram for clock:
[legend]

Public Attributes

type(event), pointer allocate
 
logical calling
 
logical detailed
 
type(event), dimension(:), pointer events =>NULL()
 
logical false
 
integer grain
 
integer(i8_kind) hits
 
type(event), pointer if
 
logical initialize
 
logical is_on
 
type(event), pointer max_event_types
 
logical mpp_clock_begin
 
type(event), pointer needed
 
integer peset_num
 
logical set
 
logical sync_on_begin
 
integer(i8_kind) tick
 
type(event), pointer to
 
logical, pointer to
 
integer(i8_kind) total_ticks
 
logical true
 
logical when
 

Private Attributes

character(len=32) name
 

Member Data Documentation

◆ allocate

type(event), pointer allocate

Definition at line 259 of file mpp.F90.

◆ calling

logical calling

Definition at line 260 of file mpp.F90.

◆ detailed

logical detailed

Definition at line 257 of file mpp.F90.

◆ events

type(event), dimension(:), pointer events =>NULL()

Definition at line 259 of file mpp.F90.

◆ false

logical false

Definition at line 260 of file mpp.F90.

◆ grain

integer grain

Definition at line 258 of file mpp.F90.

◆ hits

integer(i8_kind) hits

Definition at line 253 of file mpp.F90.

◆ if

type(event), pointer if

Definition at line 259 of file mpp.F90.

◆ initialize

logical initialize

Definition at line 260 of file mpp.F90.

◆ is_on

logical is_on

Definition at line 260 of file mpp.F90.

◆ max_event_types

type(event), pointer max_event_types

Definition at line 259 of file mpp.F90.

◆ mpp_clock_begin

logical mpp_clock_begin

Definition at line 260 of file mpp.F90.

◆ name

character(len=32) name
private

Definition at line 252 of file mpp.F90.

◆ needed

type(event), pointer needed

Definition at line 259 of file mpp.F90.

◆ peset_num

integer peset_num

Definition at line 256 of file mpp.F90.

◆ set

logical set

Definition at line 260 of file mpp.F90.

◆ sync_on_begin

logical sync_on_begin

Definition at line 257 of file mpp.F90.

◆ tick

integer(i8_kind) tick

Definition at line 254 of file mpp.F90.

◆ to [1/2]

type(event), pointer to

Definition at line 259 of file mpp.F90.

◆ to [2/2]

logical, pointer to

Definition at line 260 of file mpp.F90.

◆ total_ticks

integer(i8_kind) total_ticks

Definition at line 255 of file mpp.F90.

◆ true

logical true

Definition at line 260 of file mpp.F90.

◆ when

logical when

Definition at line 260 of file mpp.F90.

◆ mpp_mod::clock_data_summary

type mpp_mod::clock_data_summary

Summary of information from a clock run.

Definition at line 266 of file mpp.F90.

Collaboration diagram for clock_data_summary:
[legend]

Public Attributes

integer(i8_kind), dimension(max_bins) msg_size_cnts
 
real(r8_kind), dimension(max_bins) msg_size_sums
 
real(r8_kind), dimension(max_bins) msg_time_sums
 
integer(i8_kind) total_cnts
 
real(r8_kind) total_data
 
real(r8_kind) total_time
 

Private Attributes

character(len=16) name
 

Member Data Documentation

◆ msg_size_cnts

integer(i8_kind), dimension(max_bins) msg_size_cnts

Definition at line 273 of file mpp.F90.

◆ msg_size_sums

real(r8_kind), dimension(max_bins) msg_size_sums

Definition at line 269 of file mpp.F90.

◆ msg_time_sums

real(r8_kind), dimension(max_bins) msg_time_sums

Definition at line 270 of file mpp.F90.

◆ name

character(len=16) name
private

Definition at line 268 of file mpp.F90.

◆ total_cnts

integer(i8_kind) total_cnts

Definition at line 274 of file mpp.F90.

◆ total_data

real(r8_kind) total_data

Definition at line 271 of file mpp.F90.

◆ total_time

real(r8_kind) total_time

Definition at line 272 of file mpp.F90.

◆ mpp_mod::communicator

type mpp_mod::communicator

Communication information for message passing libraries.

peset hold communicators as SHMEM-compatible triads (start, log2(stride), num)

Definition at line 230 of file mpp.F90.

Collaboration diagram for communicator:
[legend]

Public Attributes

integer count
 
integer group
 MPI communicator and group id for this PE set.
 
integer id
 
integer, dimension(:), pointer list =>NULL()
 
integer log2stride
 dummy variables when libMPI is defined.
 
integer start
 

Private Attributes

character(len=32) name
 

Member Data Documentation

◆ count

integer count

Definition at line 234 of file mpp.F90.

◆ group

integer group

MPI communicator and group id for this PE set.

Definition at line 236 of file mpp.F90.

◆ id

integer id

Definition at line 236 of file mpp.F90.

◆ list

integer, dimension(:), pointer list =>NULL()

Definition at line 233 of file mpp.F90.

◆ log2stride

integer log2stride

dummy variables when libMPI is defined.

Definition at line 235 of file mpp.F90.

◆ name

character(len=32) name
private

Definition at line 232 of file mpp.F90.

◆ start

integer start

Definition at line 235 of file mpp.F90.

◆ mpp_mod::event

type mpp_mod::event

Communication event profile.

Definition at line 241 of file mpp.F90.

Collaboration diagram for event:
[legend]

Public Attributes

integer(i8_kind), dimension(max_events) bytes
 
integer calls
 
integer(i8_kind), dimension(max_events) ticks
 

Private Attributes

character(len=16) name
 

Member Data Documentation

◆ bytes

integer(i8_kind), dimension(max_events) bytes

Definition at line 244 of file mpp.F90.

◆ calls

integer calls

Definition at line 245 of file mpp.F90.

◆ name

character(len=16) name
private

Definition at line 243 of file mpp.F90.

◆ ticks

integer(i8_kind), dimension(max_events) ticks

Definition at line 244 of file mpp.F90.

◆ mpp_mod::mpp_alltoall

interface mpp_mod::mpp_alltoall

Scatter a vector across all PEs.

Transpose the vector and PE index Wrapper for the MPI_alltoall function, includes more generic _V and _W versions if given displacements/data types

Generic MPP_TYPE_ implentations: mpp_alltoall_ mpp_alltoallv_ mpp_alltoallw_

Definition at line 776 of file mpp.F90.

Public Member Functions

 mpp_alltoall_int4
 
 mpp_alltoall_int4_v
 
 mpp_alltoall_int4_w
 
 mpp_alltoall_int8
 
 mpp_alltoall_int8_v
 
 mpp_alltoall_int8_w
 
 mpp_alltoall_logical4
 
 mpp_alltoall_logical4_v
 
 mpp_alltoall_logical4_w
 
 mpp_alltoall_logical8
 
 mpp_alltoall_logical8_v
 
 mpp_alltoall_logical8_w
 
 mpp_alltoall_real4
 
 mpp_alltoall_real4_v
 
 mpp_alltoall_real4_w
 
 mpp_alltoall_real8
 
 mpp_alltoall_real8_v
 
 mpp_alltoall_real8_w
 

◆ mpp_mod::mpp_broadcast

interface mpp_mod::mpp_broadcast

Perform parallel broadcasts.

The mpp_broadcast call has been added because the original syntax (using ALL_PES in mpp_transmit) did not support a broadcast across a pelist.

MPP_TYPE_ corresponds to any 4-byte and 8-byte variant of integer, real, complex, logical variables, of rank 0 or 1. A contiguous block from a multi-dimensional array may be passed by its starting address and its length, as in f77.

Global broadcasts through the ALL_PES argument to mpp_transmit are still provided for backward-compatibility.

If pelist is omitted, the context is assumed to be the current pelist. from_pe must belong to the current pelist. This call implies synchronization across the PEs in pelist, or the current pelist if pelist is absent.


Example usage:

       call mpp_broadcast( data, length, from_pe, pelist )
Parameters
[in,out]dataData to broadcast
lengthLength of data to broadcast
from_pePE to send the data from
pelistList of PE's to broadcast across, if not provided uses current list

Definition at line 1105 of file mpp.F90.

Public Member Functions

 mpp_broadcast_char
 
 mpp_broadcast_cmplx4
 
 mpp_broadcast_cmplx4_2d
 
 mpp_broadcast_cmplx4_3d
 
 mpp_broadcast_cmplx4_4d
 
 mpp_broadcast_cmplx4_5d
 
 mpp_broadcast_cmplx4_scalar
 
 mpp_broadcast_cmplx8
 
 mpp_broadcast_cmplx8_2d
 
 mpp_broadcast_cmplx8_3d
 
 mpp_broadcast_cmplx8_4d
 
 mpp_broadcast_cmplx8_5d
 
 mpp_broadcast_cmplx8_scalar
 
 mpp_broadcast_int4
 
 mpp_broadcast_int4_2d
 
 mpp_broadcast_int4_3d
 
 mpp_broadcast_int4_4d
 
 mpp_broadcast_int4_5d
 
 mpp_broadcast_int4_scalar
 
 mpp_broadcast_int8
 
 mpp_broadcast_int8_2d
 
 mpp_broadcast_int8_3d
 
 mpp_broadcast_int8_4d
 
 mpp_broadcast_int8_5d
 
 mpp_broadcast_int8_scalar
 
 mpp_broadcast_logical4
 
 mpp_broadcast_logical4_2d
 
 mpp_broadcast_logical4_3d
 
 mpp_broadcast_logical4_4d
 
 mpp_broadcast_logical4_5d
 
 mpp_broadcast_logical4_scalar
 
 mpp_broadcast_logical8
 
 mpp_broadcast_logical8_2d
 
 mpp_broadcast_logical8_3d
 
 mpp_broadcast_logical8_4d
 
 mpp_broadcast_logical8_5d
 
 mpp_broadcast_logical8_scalar
 
 mpp_broadcast_real4
 
 mpp_broadcast_real4_2d
 
 mpp_broadcast_real4_3d
 
 mpp_broadcast_real4_4d
 
 mpp_broadcast_real4_5d
 
 mpp_broadcast_real4_scalar
 
 mpp_broadcast_real8
 
 mpp_broadcast_real8_2d
 
 mpp_broadcast_real8_3d
 
 mpp_broadcast_real8_4d
 
 mpp_broadcast_real8_5d
 
 mpp_broadcast_real8_scalar
 

◆ mpp_mod::mpp_chksum

interface mpp_mod::mpp_chksum

Calculate parallel checksums.

mpp_chksum is a parallel checksum routine that returns an identical answer for the same array irrespective of how it has been partitioned across processors. int_kind is the KIND parameter corresponding to long integers (see discussion on OS-dependent preprocessor directives) defined in the file platform.F90. MPP_TYPE_ corresponds to any 4-byte and 8-byte variant of integer, real, complex, logical variables, of rank 0 to 5.

Integer checksums on FP data use the F90 TRANSFER() intrinsic.

This provides identical results on a single-processor job, and to perform serial checksums on a single processor of a parallel job, you only need to use the optional pelist argument.

 use mpp_mod
 integer :: pe, chksum
 real :: a(:)
 pe = mpp_pe()
 chksum = mpp_chksum( a, (/pe/) )
 

The additional functionality of mpp_chksum over serial checksums is to compute the checksum across the PEs in pelist. The answer is guaranteed to be the same for the same distributed array irrespective of how it has been partitioned.

If pelist is omitted, the context is assumed to be the current pelist. This call implies synchronization across the PEs in pelist, or the current pelist if pelist is absent.
Example usage:

       mpp_chksum( var, pelist )
Parameters
varData to calculate checksum of
pelistOptional list of PE's to include in checksum calculation if not using current pelist
Returns
Parallel checksum of var across given or implicit pelist

Generic MPP_TYPE_ implentations: mpp_chksum_ mpp_chksum_int_ mpp_chksum_int_rmask_

Definition at line 1214 of file mpp.F90.

Public Member Functions

 mpp_chksum_i4_1d
 
 mpp_chksum_i4_1d_rmask
 
 mpp_chksum_i4_2d
 
 mpp_chksum_i4_2d_rmask
 
 mpp_chksum_i4_3d
 
 mpp_chksum_i4_3d_rmask
 
 mpp_chksum_i4_4d
 
 mpp_chksum_i4_4d_rmask
 
 mpp_chksum_i4_5d
 
 mpp_chksum_i4_5d_rmask
 
 mpp_chksum_i8_1d
 
 mpp_chksum_i8_1d_rmask
 
 mpp_chksum_i8_2d
 
 mpp_chksum_i8_2d_rmask
 
 mpp_chksum_i8_3d
 
 mpp_chksum_i8_3d_rmask
 
 mpp_chksum_i8_4d
 
 mpp_chksum_i8_4d_rmask
 
 mpp_chksum_i8_5d
 
 mpp_chksum_i8_5d_rmask
 
 mpp_chksum_r4_0d
 
 mpp_chksum_r4_1d
 
 mpp_chksum_r4_2d
 
 mpp_chksum_r4_3d
 
 mpp_chksum_r4_4d
 
 mpp_chksum_r4_5d
 
 mpp_chksum_r8_0d
 
 mpp_chksum_r8_1d
 
 mpp_chksum_r8_2d
 
 mpp_chksum_r8_3d
 
 mpp_chksum_r8_4d
 
 mpp_chksum_r8_5d
 

◆ mpp_mod::mpp_error

interface mpp_mod::mpp_error

Error handler.

It is strongly recommended that all error exits pass through mpp_error to assure the program fails cleanly. An individual PE encountering a STOP statement, for instance, can cause the program to hang. The use of the STOP statement is strongly discouraged.

Calling mpp_error with no arguments produces an immediate error exit, i.e:

                    call mpp_error
                    call mpp_error()
    

are equivalent.

The argument order

                    call mpp_error( routine, errormsg, errortype )
    

is also provided to support legacy code. In this version of the call, none of the arguments may be omitted.

The behaviour of mpp_error for a WARNING can be controlled with an additional call mpp_set_warn_level.

                    call mpp_set_warn_level(ERROR)
    

causes mpp_error to treat WARNING exactly like FATAL.

                    call mpp_set_warn_level(WARNING)
    

resets to the default behaviour described above.

mpp_error also has an internal error state which maintains knowledge of whether a warning has been issued. This can be used at startup in a subroutine that checks if the model has been properly configured. You can generate a series of warnings using mpp_error, and then check at the end if any warnings has been issued using the function mpp_error_state(). If the value of this is WARNING, at least one warning has been issued, and the user can take appropriate action:

                    if( ... )call mpp_error( WARNING, '...' )
                    if( ... )call mpp_error( WARNING, '...' )
                    if( ... )call mpp_error( WARNING, '...' )
                    ...
                    if( mpp_error_state().EQ.WARNING )call mpp_error( FATAL, '...' )
    


Example usage:

call mpp_error( errortype, routine, errormsg )
Parameters
errortypeOne of NOTE, WARNING or FATAL (these definitions are acquired by use association). NOTE writes errormsg to STDOUT. WARNING writes errormsg to STDERR. FATAL writes errormsg to STDERR, and induces a clean error exit with a call stack traceback.
routineCalling routine name
errmsgMessage to output </IN>

Definition at line 382 of file mpp.F90.

Public Member Functions

 mpp_error_basic
 
 mpp_error_ia
 
 mpp_error_ia_ia
 
 mpp_error_ia_is
 
 mpp_error_ia_ra
 
 mpp_error_ia_rs
 
 mpp_error_is
 
 mpp_error_is_ia
 
 mpp_error_is_is
 
 mpp_error_is_ra
 
 mpp_error_is_rs
 
 mpp_error_mesg
 
 mpp_error_noargs
 
 mpp_error_ra
 
 mpp_error_ra_ia
 
 mpp_error_ra_is
 
 mpp_error_ra_ra
 
 mpp_error_ra_rs
 
 mpp_error_rs
 
 mpp_error_rs_ia
 
 mpp_error_rs_is
 
 mpp_error_rs_ra
 
 mpp_error_rs_rs
 

◆ mpp_mod::mpp_gather

interface mpp_mod::mpp_gather

Gather data sent from pelist onto the root pe Wrapper for MPI_gather, can be used with and without indices.

Parameters
sbufMPP_TYPE_ data buffer to send
rbufMPP_TYPE_ data buffer to receive
pelistinteger(:) optional pelist to gather from, defaults to current


Example usage:

               call mpp_gather(send_buffer,recv_buffer, pelist)
               call mpp_gather(is, ie, js, je, pelist, array_seg, data, is_root_pe)

Definition at line 698 of file mpp.F90.

Public Member Functions

 mpp_gather_int4
 
 mpp_gather_int4_1d
 
 mpp_gather_int4_1dv
 
 mpp_gather_int8
 
 mpp_gather_int8_1d
 
 mpp_gather_int8_1dv
 
 mpp_gather_logical4
 
 mpp_gather_logical_1d
 
 mpp_gather_logical_1dv
 
 mpp_gather_pelist_int4_2d
 
 mpp_gather_pelist_int4_3d
 
 mpp_gather_pelist_int8_2d
 
 mpp_gather_pelist_int8_3d
 
 mpp_gather_pelist_logical_2d
 
 mpp_gather_pelist_logical_3d
 
 mpp_gather_pelist_real4_2d
 
 mpp_gather_pelist_real4_3d
 
 mpp_gather_pelist_real8_2d
 
 mpp_gather_pelist_real8_3d
 
 mpp_gather_real4
 
 mpp_gather_real4_1d
 
 mpp_gather_real4_1dv
 
 mpp_gather_real8
 
 mpp_gather_real8_1d
 
 mpp_gather_real8_1dv
 
 mpp_gatherv_int4
 
 mpp_gatherv_int8
 
 mpp_gatherv_logical4
 
 mpp_gatherv_real4
 
 mpp_gatherv_real8
 

◆ mpp_mod::mpp_max

interface mpp_mod::mpp_max

Reduction operations. Find the max of scalar a from the PEs in pelist result is also automatically broadcast to all PEs.

call mpp_max( a, pelist )
Parameters
areal or integer, of 4-byte of 8-byte kind.
pelistIf pelist is omitted, the context is assumed to be the current pelist. This call implies synchronization across the PEs in pelist, or the current pelist if pelist is absent.

Definition at line 538 of file mpp.F90.

Public Member Functions

 mpp_max_int4_0d
 
 mpp_max_int4_1d
 
 mpp_max_int8_0d
 
 mpp_max_int8_1d
 
 mpp_max_real4_0d
 
 mpp_max_real4_1d
 
 mpp_max_real8_0d
 
 mpp_max_real8_1d
 

◆ mpp_mod::mpp_min

interface mpp_mod::mpp_min

Reduction operations. Find the min of scalar a from the PEs in pelist result is also automatically broadcast to all PEs.

call mpp_min( a, pelist )
Parameters
areal or integer, of 4-byte of 8-byte kind.
pelistIf pelist is omitted, the context is assumed to be the current pelist. This call implies synchronization across the PEs in pelist, or the current pelist if pelist is absent.

Definition at line 560 of file mpp.F90.

Public Member Functions

 mpp_min_int4_0d
 
 mpp_min_int4_1d
 
 mpp_min_int8_0d
 
 mpp_min_int8_1d
 
 mpp_min_real4_0d
 
 mpp_min_real4_1d
 
 mpp_min_real8_0d
 
 mpp_min_real8_1d
 

◆ mpp_mod::mpp_recv

interface mpp_mod::mpp_recv

Recieve data from another PE.

Parameters
[out]get_datascalar or array to get written with received data
get_lensize of array to recv from get_data
from_pePE number to receive from
blocktrue for blocking, false for non-blocking. Defaults to true
tagcommunication tag
[out]requestMPI request handle

Definition at line 951 of file mpp.F90.

Public Member Functions

 mpp_recv_int4
 
 mpp_recv_int4_2d
 
 mpp_recv_int4_3d
 
 mpp_recv_int4_4d
 
 mpp_recv_int4_5d
 
 mpp_recv_int4_scalar
 
 mpp_recv_int8
 
 mpp_recv_int8_2d
 
 mpp_recv_int8_3d
 
 mpp_recv_int8_4d
 
 mpp_recv_int8_5d
 
 mpp_recv_int8_scalar
 
 mpp_recv_logical4
 
 mpp_recv_logical4_2d
 
 mpp_recv_logical4_3d
 
 mpp_recv_logical4_4d
 
 mpp_recv_logical4_5d
 
 mpp_recv_logical4_scalar
 
 mpp_recv_logical8
 
 mpp_recv_logical8_2d
 
 mpp_recv_logical8_3d
 
 mpp_recv_logical8_4d
 
 mpp_recv_logical8_5d
 
 mpp_recv_logical8_scalar
 
 mpp_recv_real4
 
 mpp_recv_real4_2d
 
 mpp_recv_real4_3d
 
 mpp_recv_real4_4d
 
 mpp_recv_real4_5d
 
 mpp_recv_real4_scalar
 
 mpp_recv_real8
 
 mpp_recv_real8_2d
 
 mpp_recv_real8_3d
 
 mpp_recv_real8_4d
 
 mpp_recv_real8_5d
 
 mpp_recv_real8_scalar
 

◆ mpp_mod::mpp_scatter

interface mpp_mod::mpp_scatter

Scatter (ie - is) * (je - js) contiguous elements of array data from the designated root pe into contigous members of array segment in each pe that is included in the pelist argument.

Parameters
is,ieinteger start and end index of the first dimension of the segment array
je,jsinteger start and end index of the second dimension of the segment array
pelistinteger(:) the PE list of target pes, needs to be monotonically increasing
array_segMPP_TYPE_ 2D array that the data is to be copied into
dataMPP_TYPE_ the source array
is_root_pelogical true if calling from root pe
ishiftinteger offsets specifying the first elelement in the data array
nkinteger size of third dimension for 3D calls


Example usage:

               call mpp_scatter(is, ie, js, je, pelist, segment, data, .true.)

Definition at line 748 of file mpp.F90.

Public Member Functions

 mpp_scatter_pelist_int4_2d
 
 mpp_scatter_pelist_int4_3d
 
 mpp_scatter_pelist_int8_2d
 
 mpp_scatter_pelist_int8_3d
 
 mpp_scatter_pelist_real4_2d
 
 mpp_scatter_pelist_real4_3d
 
 mpp_scatter_pelist_real8_2d
 
 mpp_scatter_pelist_real8_3d
 
 mpp_scatterv_int4
 
 mpp_scatterv_int8
 
 mpp_scatterv_real4
 
 mpp_scatterv_real8
 

◆ mpp_mod::mpp_send

interface mpp_mod::mpp_send

Send data to a receiving PE.

Parameters
put_datascalar or array to get sent to a receiving PE
put_lensize of data to send from put_data
to_pePE number to send to
blocktrue for blocking, false for non-blocking. Defaults to true
tagcommunication tag
[out]requestMPI request handle
Example usage:
call mpp_send(data, ie, pe)

Definition at line 1018 of file mpp.F90.

Public Member Functions

 mpp_send_int4
 
 mpp_send_int4_2d
 
 mpp_send_int4_3d
 
 mpp_send_int4_4d
 
 mpp_send_int4_5d
 
 mpp_send_int4_scalar
 
 mpp_send_int8
 
 mpp_send_int8_2d
 
 mpp_send_int8_3d
 
 mpp_send_int8_4d
 
 mpp_send_int8_5d
 
 mpp_send_int8_scalar
 
 mpp_send_logical4
 
 mpp_send_logical4_2d
 
 mpp_send_logical4_3d
 
 mpp_send_logical4_4d
 
 mpp_send_logical4_5d
 
 mpp_send_logical4_scalar
 
 mpp_send_logical8
 
 mpp_send_logical8_2d
 
 mpp_send_logical8_3d
 
 mpp_send_logical8_4d
 
 mpp_send_logical8_5d
 
 mpp_send_logical8_scalar
 
 mpp_send_real4
 
 mpp_send_real4_2d
 
 mpp_send_real4_3d
 
 mpp_send_real4_4d
 
 mpp_send_real4_5d
 
 mpp_send_real4_scalar
 
 mpp_send_real8
 
 mpp_send_real8_2d
 
 mpp_send_real8_3d
 
 mpp_send_real8_4d
 
 mpp_send_real8_5d
 
 mpp_send_real8_scalar
 

◆ mpp_mod::mpp_sum

interface mpp_mod::mpp_sum

Reduction operation.

MPP_TYPE_ corresponds to any 4-byte and 8-byte variant of integer, real, complex variables, of rank 0 or 1. A contiguous block from a multi-dimensional array may be passed by its starting address and its length, as in f77.

Library reduction operators are not required or guaranteed to be bit-reproducible. In any case, changing the processor count changes the data layout, and thus very likely the order of operations. For bit-reproducible sums of distributed arrays, consider using the mpp_global_sum routine provided by the mpp_domains module.

The bit_reproducible flag provided in earlier versions of this routine has been removed.

If pelist is omitted, the context is assumed to be the current pelist. This call implies synchronization across the PEs in pelist, or the current pelist if pelist is absent. Example usage: call mpp_sum( a, length, pelist )

Definition at line 597 of file mpp.F90.

Public Member Functions

 mpp_sum_cmplx4
 
 mpp_sum_cmplx4_2d
 
 mpp_sum_cmplx4_3d
 
 mpp_sum_cmplx4_4d
 
 mpp_sum_cmplx4_5d
 
 mpp_sum_cmplx4_scalar
 
 mpp_sum_cmplx8
 
 mpp_sum_cmplx8_2d
 
 mpp_sum_cmplx8_3d
 
 mpp_sum_cmplx8_4d
 
 mpp_sum_cmplx8_5d
 
 mpp_sum_cmplx8_scalar
 
 mpp_sum_int4
 
 mpp_sum_int4_2d
 
 mpp_sum_int4_3d
 
 mpp_sum_int4_4d
 
 mpp_sum_int4_5d
 
 mpp_sum_int4_scalar
 
 mpp_sum_int8
 
 mpp_sum_int8_2d
 
 mpp_sum_int8_3d
 
 mpp_sum_int8_4d
 
 mpp_sum_int8_5d
 
 mpp_sum_int8_scalar
 
 mpp_sum_real4
 
 mpp_sum_real4_2d
 
 mpp_sum_real4_3d
 
 mpp_sum_real4_4d
 
 mpp_sum_real4_5d
 
 mpp_sum_real4_scalar
 
 mpp_sum_real8
 
 mpp_sum_real8_2d
 
 mpp_sum_real8_3d
 
 mpp_sum_real8_4d
 
 mpp_sum_real8_5d
 
 mpp_sum_real8_scalar
 

◆ mpp_mod::mpp_sum_ad

interface mpp_mod::mpp_sum_ad

Calculates sum of a given numerical array across pe's for adjoint domains.

Definition at line 642 of file mpp.F90.

Public Member Functions

 mpp_sum_int4_2d_ad
 
 mpp_sum_int4_3d_ad
 
 mpp_sum_int4_4d_ad
 
 mpp_sum_int4_5d_ad
 
 mpp_sum_int4_ad
 
 mpp_sum_int4_scalar_ad
 
 mpp_sum_int8_2d_ad
 
 mpp_sum_int8_3d_ad
 
 mpp_sum_int8_4d_ad
 
 mpp_sum_int8_5d_ad
 
 mpp_sum_int8_ad
 
 mpp_sum_int8_scalar_ad
 
 mpp_sum_real4_2d_ad
 
 mpp_sum_real4_3d_ad
 
 mpp_sum_real4_4d_ad
 
 mpp_sum_real4_5d_ad
 
 mpp_sum_real4_ad
 
 mpp_sum_real4_scalar_ad
 
 mpp_sum_real8_2d_ad
 
 mpp_sum_real8_3d_ad
 
 mpp_sum_real8_4d_ad
 
 mpp_sum_real8_5d_ad
 
 mpp_sum_real8_ad
 
 mpp_sum_real8_scalar_ad
 

◆ mpp_mod::mpp_transmit

interface mpp_mod::mpp_transmit

Basic message-passing call.

MPP_TYPE_ corresponds to any 4-byte and 8-byte variant of integer, real, complex, logical variables, of rank 0 or 1. A contiguous block from a multi-dimensional array may be passed by its starting address and its length, as in f77.

mpp_transmit is currently implemented as asynchronous outward transmission and synchronous inward transmission. This follows the behaviour of shmem_put and shmem_get. In MPI, it is implemented as mpi_isend and mpi_recv. For most applications, transmissions occur in pairs, and are here accomplished in a single call.

The special PE designations NULL_PE, ANY_PE and ALL_PES are provided by use association.

NULL_PE: is used to disable one of the pair of transmissions.
ANY_PE: is used for unspecific remote destination. (Please note that put_pe=ANY_PE has no meaning in the MPI context, though it is available in the SHMEM invocation. If portability is a concern, it is best avoided).
ALL_PES: is used for broadcast operations.

It is recommended that mpp_broadcast be used for broadcasts.

The following example illustrates the use of NULL_PE and ALL_PES:

    real, dimension(n) :: a
    if( pe.EQ.0 )then
        do p = 1,npes-1
           call mpp_transmit( a, n, p, a, n, NULL_PE )
        end do
    else
        call mpp_transmit( a, n, NULL_PE, a, n, 0 )
    end if

    call mpp_transmit( a, n, ALL_PES, a, n, 0 )
    

The do loop and the broadcast operation above are equivalent.

Two overloaded calls mpp_send and mpp_recv have also been provided. mpp_send calls mpp_transmit with get_pe=NULL_PE. mpp_recv calls mpp_transmit with put_pe=NULL_PE. Thus the do loop above could be written more succinctly:

    if( pe.EQ.0 )then
        do p = 1,npes-1
           call mpp_send( a, n, p )
        end do
    else
        call mpp_recv( a, n, 0 )
    end if
    


Example call:

call mpp_transmit( put_data, put_len, put_pe, get_data, get_len, get_pe )

Definition at line 886 of file mpp.F90.

Public Member Functions

 mpp_transmit_int4
 
 mpp_transmit_int4_2d
 
 mpp_transmit_int4_3d
 
 mpp_transmit_int4_4d
 
 mpp_transmit_int4_5d
 
 mpp_transmit_int4_scalar
 
 mpp_transmit_int8
 
 mpp_transmit_int8_2d
 
 mpp_transmit_int8_3d
 
 mpp_transmit_int8_4d
 
 mpp_transmit_int8_5d
 
 mpp_transmit_int8_scalar
 
 mpp_transmit_logical4
 
 mpp_transmit_logical4_2d
 
 mpp_transmit_logical4_3d
 
 mpp_transmit_logical4_4d
 
 mpp_transmit_logical4_5d
 
 mpp_transmit_logical4_scalar
 
 mpp_transmit_logical8
 
 mpp_transmit_logical8_2d
 
 mpp_transmit_logical8_3d
 
 mpp_transmit_logical8_4d
 
 mpp_transmit_logical8_5d
 
 mpp_transmit_logical8_scalar
 
 mpp_transmit_real4
 
 mpp_transmit_real4_2d
 
 mpp_transmit_real4_3d
 
 mpp_transmit_real4_4d
 
 mpp_transmit_real4_5d
 
 mpp_transmit_real4_scalar
 
 mpp_transmit_real8
 
 mpp_transmit_real8_2d
 
 mpp_transmit_real8_3d
 
 mpp_transmit_real8_4d
 
 mpp_transmit_real8_5d
 
 mpp_transmit_real8_scalar
 

◆ mpp_mod::mpp_type

type mpp_mod::mpp_type

Data types for generalized data transfer (e.g. MPI_Type)

Definition at line 287 of file mpp.F90.

Collaboration diagram for mpp_type:
[legend]

Public Attributes

integer data
 
integer elementary
 
integer etype
 
integer id
 
integer identifier
 
integer instances
 
integer, dimension(e.g. mpi) library
 
integer message
 
integer ndims
 
type(mpp_type), pointer next => null()
 
integer number
 
integer of
 
integer passing
 
type(mpp_type), pointer prev => null()
 
integer, dimension(:), allocatable sizes
 
integer, dimension(:), allocatable starts
 
integer, dimension(:), allocatable subsizes
 
integer this
 
integer, dimension(e.g. mpi_byte) type
 
integer within
 

Private Attributes

integer counter
 

Member Data Documentation

◆ counter

integer counter
private

Definition at line 289 of file mpp.F90.

◆ data

integer data

Definition at line 294 of file mpp.F90.

◆ elementary

integer elementary

Definition at line 294 of file mpp.F90.

◆ etype

integer etype

Definition at line 294 of file mpp.F90.

◆ id

integer id

Definition at line 295 of file mpp.F90.

◆ identifier

integer identifier

Definition at line 295 of file mpp.F90.

◆ instances

integer instances

Definition at line 289 of file mpp.F90.

◆ library

integer, dimension (e.g. mpi) library

Definition at line 295 of file mpp.F90.

◆ message

integer message

Definition at line 295 of file mpp.F90.

◆ ndims

integer ndims

Definition at line 290 of file mpp.F90.

◆ next

type(mpp_type), pointer next => null()

Definition at line 298 of file mpp.F90.

◆ number

integer number

Definition at line 289 of file mpp.F90.

◆ of

integer of

Definition at line 289 of file mpp.F90.

◆ passing

integer passing

Definition at line 295 of file mpp.F90.

◆ prev

type(mpp_type), pointer prev => null()

Definition at line 297 of file mpp.F90.

◆ sizes

integer, dimension(:), allocatable sizes

Definition at line 291 of file mpp.F90.

◆ starts

integer, dimension(:), allocatable starts

Definition at line 293 of file mpp.F90.

◆ subsizes

integer, dimension(:), allocatable subsizes

Definition at line 292 of file mpp.F90.

◆ this

integer this

Definition at line 289 of file mpp.F90.

◆ type

integer, dimension (e.g. mpi_byte) type

Definition at line 289 of file mpp.F90.

◆ within

integer within

Definition at line 295 of file mpp.F90.

◆ mpp_mod::mpp_type_create

interface mpp_mod::mpp_type_create

Create a mpp_type variable.

Parameters
[in]fieldA field of any numerical or logical type
[in]array_of_subsizesInteger array of subsizes
[in]array_of_startsInteger array of starts
[out]dtype_outOutput variable for created mpp_type

Definition at line 510 of file mpp.F90.

Public Member Functions

 mpp_type_create_cmplx4
 
 mpp_type_create_cmplx8
 
 mpp_type_create_int4
 
 mpp_type_create_int8
 
 mpp_type_create_logical4
 
 mpp_type_create_logical8
 
 mpp_type_create_real4
 
 mpp_type_create_real8
 

◆ mpp_mod::mpp_type_list

type mpp_mod::mpp_type_list

Persisent elements for linked list interaction.

Definition at line 303 of file mpp.F90.

Collaboration diagram for mpp_type_list:
[legend]

Public Attributes

integer length
 
type(mpp_type), pointer tail => null()
 

Private Attributes

type(mpp_type), pointer head => null()
 

Member Data Documentation

◆ head

type(mpp_type), pointer head => null()
private

Definition at line 305 of file mpp.F90.

◆ length

integer length

Definition at line 307 of file mpp.F90.

◆ tail

type(mpp_type), pointer tail => null()

Definition at line 306 of file mpp.F90.

◆ mpp_mod::summary_struct

type mpp_mod::summary_struct

holds name and clock data for use in mpp_util.h

Definition at line 279 of file mpp.F90.

Collaboration diagram for summary_struct:
[legend]

Public Attributes

type(clock_data_summary), dimension(max_event_types) event
 

Private Attributes

character(len=16) name
 

Member Data Documentation

◆ event

type (clock_data_summary), dimension(max_event_types) event

Definition at line 282 of file mpp.F90.

◆ name

character(len=16) name
private

Definition at line 281 of file mpp.F90.

Function/Subroutine Documentation

◆ get_peset()

integer function get_peset ( integer, dimension(:), intent(in), optional  pelist)

Makes a PE set out of a PE list. A PE list is an ordered list of PEs a PE set is a triad (start,log2stride,size) for SHMEM, an a communicator for MPI if stride is non-uniform or not a power of 2, will return error (not required for MPI but enforced for uniformity)

Definition at line 99 of file mpp_util_mpi.inc.

◆ mpp_broadcast_2d_()

subroutine mpp_broadcast_2d_ ( dimension(:,:), intent(inout)  broadcast_data,
integer, intent(in)  length,
integer, intent(in)  from_pe,
integer, dimension(:), intent(in), optional  pelist 
)

Definition at line 322 of file mpp_transmit.inc.

◆ mpp_broadcast_3d_()

subroutine mpp_broadcast_3d_ ( dimension(:,:,:), intent(inout)  broadcast_data,
integer, intent(in)  length,
integer, intent(in)  from_pe,
integer, dimension(:), intent(in), optional  pelist 
)

Definition at line 338 of file mpp_transmit.inc.

◆ mpp_broadcast_4d_()

subroutine mpp_broadcast_4d_ ( dimension(:,:,:,:), intent(inout)  broadcast_data,
integer, intent(in)  length,
integer, intent(in)  from_pe,
integer, dimension(:), intent(in), optional  pelist 
)

Definition at line 354 of file mpp_transmit.inc.

◆ mpp_broadcast_5d_()

subroutine mpp_broadcast_5d_ ( dimension(:,:,:,:,:), intent(inout)  broadcast_data,
integer, intent(in)  length,
integer, intent(in)  from_pe,
integer, dimension(:), intent(in), optional  pelist 
)

Definition at line 370 of file mpp_transmit.inc.

◆ mpp_broadcast_scalar_()

subroutine mpp_broadcast_scalar_ ( intent(inout)  broadcast_data,
integer, intent(in)  from_pe,
integer, dimension(:), intent(in), optional  pelist 
)

Definition at line 308 of file mpp_transmit.inc.

◆ mpp_error_basic()

subroutine mpp_error_basic ( integer, intent(in)  errortype,
character(len=*), intent(in), optional  errormsg 
)

A very basic error handler uses ABORT and FLUSH calls, may need to use cpp to rename.

Definition at line 35 of file mpp_util_mpi.inc.

◆ mpp_recv_()

subroutine mpp_recv_ ( dimension(*), intent(out)  get_data,
integer, intent(in)  get_len,
integer, intent(in)  from_pe,
logical, intent(in), optional  block,
integer, intent(in), optional  tag,
integer, intent(out), optional  request 
)

Definition at line 152 of file mpp_transmit.inc.

◆ mpp_recv_2d_()

subroutine mpp_recv_2d_ ( dimension(:,:), intent(out)  get_data,
integer, intent(in)  get_len,
integer, intent(in)  from_pe,
logical, intent(in), optional  block,
integer, intent(in), optional  tag,
integer, intent(out), optional  request 
)

Definition at line 214 of file mpp_transmit.inc.

◆ mpp_recv_3d_()

subroutine mpp_recv_3d_ ( dimension(:,:,:), intent(out)  get_data,
integer, intent(in)  get_len,
integer, intent(in)  from_pe,
logical, intent(in), optional  block,
integer, intent(in), optional  tag,
integer, intent(out), optional  request 
)

Definition at line 236 of file mpp_transmit.inc.

◆ mpp_recv_4d_()

subroutine mpp_recv_4d_ ( dimension(:,:,:,:), intent(out)  get_data,
integer, intent(in)  get_len,
integer, intent(in)  from_pe,
logical, intent(in), optional  block,
integer, intent(in), optional  tag,
integer, intent(out), optional  request 
)

Definition at line 258 of file mpp_transmit.inc.

◆ mpp_recv_5d_()

subroutine mpp_recv_5d_ ( dimension(:,:,:,:,:), intent(out)  get_data,
integer, intent(in)  get_len,
integer, intent(in)  from_pe,
logical, intent(in), optional  block,
integer, intent(in), optional  tag,
integer, intent(out), optional  request 
)

Definition at line 280 of file mpp_transmit.inc.

◆ mpp_recv_scalar_()

subroutine mpp_recv_scalar_ ( intent(out)  get_data,
integer, intent(in)  from_pe,
integer, intent(in), optional  glen,
logical, intent(in), optional  block,
integer, intent(in), optional  tag,
integer, intent(out), optional  request 
)

Definition at line 174 of file mpp_transmit.inc.

◆ mpp_send_()

subroutine mpp_send_ ( dimension(*), intent(in)  put_data,
integer, intent(in)  put_len,
integer, intent(in)  to_pe,
integer, intent(in), optional  tag,
integer, intent(out), optional  request 
)

Definition at line 164 of file mpp_transmit.inc.

◆ mpp_send_2d_()

subroutine mpp_send_2d_ ( dimension(:,:), intent(in)  put_data,
integer, intent(in)  put_len,
integer, intent(in)  to_pe,
integer, intent(in), optional  tag,
integer, intent(out), optional  request 
)

Definition at line 226 of file mpp_transmit.inc.

◆ mpp_send_3d_()

subroutine mpp_send_3d_ ( dimension(:,:,:), intent(in)  put_data,
integer, intent(in)  put_len,
integer, intent(in)  to_pe,
integer, intent(in), optional  tag,
integer, intent(out), optional  request 
)

Definition at line 248 of file mpp_transmit.inc.

◆ mpp_send_4d_()

subroutine mpp_send_4d_ ( dimension(:,:,:,:), intent(in)  put_data,
integer, intent(in)  put_len,
integer, intent(in)  to_pe,
integer, intent(in), optional  tag,
integer, intent(out), optional  request 
)

Definition at line 270 of file mpp_transmit.inc.

◆ mpp_send_5d_()

subroutine mpp_send_5d_ ( dimension(:,:,:,:,:), intent(in)  put_data,
integer, intent(in)  put_len,
integer, intent(in)  to_pe,
integer, intent(in), optional  tag,
integer, intent(out), optional  request 
)

Definition at line 292 of file mpp_transmit.inc.

◆ mpp_send_scalar_()

subroutine mpp_send_scalar_ ( intent(in)  put_data,
integer, intent(in)  to_pe,
integer, intent(in), optional  plen,
integer, intent(in), optional  tag,
integer, intent(out), optional  request 
)

Definition at line 196 of file mpp_transmit.inc.

◆ mpp_sum_2d_()

subroutine mpp_sum_2d_ ( dimension(:,:), intent(inout)  a,
integer, intent(in)  length,
integer, dimension(:), intent(in), optional  pelist 
)

Sums 2d array across pes.

Parameters
[in]lengthamount of indices in given 2d array
[in]pelistpelist to calculate sum across

Definition at line 44 of file mpp_sum.inc.

◆ mpp_sum_2d_ad_()

subroutine mpp_sum_2d_ad_ ( dimension(:,:), intent(inout)  a,
integer, intent(in)  length,
integer, dimension(:), intent(in), optional  pelist 
)

Sums 2d array across pes.

Parameters
[in]lengthamount of indices in given 2d array
[in]pelistpelist to calculate sum across

Definition at line 45 of file mpp_sum_ad.inc.

◆ mpp_sum_3d_()

subroutine mpp_sum_3d_ ( dimension(:,:,:), intent(inout)  a,
integer, intent(in)  length,
integer, dimension(:), intent(in), optional  pelist 
)

Sums 3d array across pes.

Parameters
[in]lengthamount of indices in given 3d array
[in]pelistpelist to calculate sum across

Definition at line 59 of file mpp_sum.inc.

◆ mpp_sum_3d_ad_()

subroutine mpp_sum_3d_ad_ ( dimension(:,:,:), intent(inout)  a,
integer, intent(in)  length,
integer, dimension(:), intent(in), optional  pelist 
)

Sums 3d array across pes.

Parameters
[in]lengthamount of indices in given 3d array
[in]pelistpelist to calculate sum across

Definition at line 60 of file mpp_sum_ad.inc.

◆ mpp_sum_4d_()

subroutine mpp_sum_4d_ ( dimension(:,:,:,:), intent(inout)  a,
integer, intent(in)  length,
integer, dimension(:), intent(in), optional  pelist 
)

Sums 4d array across pes.

Parameters
[in]lengthamount of indices in given 4d array
[in]pelistpelist to calculate sum across

Definition at line 74 of file mpp_sum.inc.

◆ mpp_sum_4d_ad_()

subroutine mpp_sum_4d_ad_ ( dimension(:,:,:,:), intent(inout)  a,
integer, intent(in)  length,
integer, dimension(:), intent(in), optional  pelist 
)

Sums 4d array across pes.

Parameters
[in]lengthamount of indices in given 4d array
[in]pelistpelist to calculate sum across

Definition at line 75 of file mpp_sum_ad.inc.

◆ mpp_sum_5d_()

subroutine mpp_sum_5d_ ( dimension(:,:,:,:,:), intent(inout)  a,
integer, intent(in)  length,
integer, dimension(:), intent(in), optional  pelist 
)

Sums 5d array across pes.

Parameters
[in]lengthamount of indices in given 5d array
[in]pelistpelist to calculate sum across

Definition at line 89 of file mpp_sum.inc.

◆ mpp_sum_5d_ad_()

subroutine mpp_sum_5d_ad_ ( dimension(:,:,:,:,:), intent(inout)  a,
integer, intent(in)  length,
integer, dimension(:), intent(in), optional  pelist 
)

Sums 5d array across pes.

Parameters
[in]lengthamount of indices in given 5d array
[in]pelistpelist to calculate sum across

Definition at line 90 of file mpp_sum_ad.inc.

◆ mpp_sum_scalar_()

subroutine mpp_sum_scalar_ ( intent(inout)  a,
integer, dimension(:), intent(in), optional  pelist 
)

Sums array a when only first element is passed: this routine just converts to a call to MPP_SUM_.

Definition at line 30 of file mpp_sum.inc.

◆ mpp_sum_scalar_ad_()

subroutine mpp_sum_scalar_ad_ ( intent(inout)  a,
integer, dimension(:), intent(in), optional  pelist 
)

Sums array a. when only first element is passed: this routine just converts to a call to MPP_SUM_.

Definition at line 31 of file mpp_sum_ad.inc.

◆ mpp_sync()

subroutine mpp_sync ( integer, dimension(:), intent(in), optional  pelist,
logical, intent(in), optional  do_self 
)

Synchronize PEs in list.

Definition at line 151 of file mpp_util_mpi.inc.

◆ mpp_sync_self()

subroutine mpp_sync_self ( integer, dimension(:), intent(in), optional  pelist,
integer, intent(in), optional  check,
integer, dimension(:), intent(inout), optional  request,
integer, dimension(:), intent(in), optional  msg_size,
integer, dimension(:), intent(in), optional  msg_type 
)

This is to check if current PE's outstanding puts are complete but we can't use shmem_fence because we are actually waiting for a remote PE to complete its get.

Definition at line 174 of file mpp_util_mpi.inc.

◆ mpp_transmit_2d_()

subroutine mpp_transmit_2d_ ( dimension(:,:), intent(in)  put_data,
integer, intent(in)  put_len,
integer, intent(in)  to_pe,
dimension(:,:), intent(out)  get_data,
integer, intent(in)  get_len,
integer, intent(in)  from_pe,
logical, intent(in), optional  block,
integer, intent(in), optional  tag,
integer, intent(out), optional  recv_request,
integer, intent(out), optional  send_request 
)

Definition at line 59 of file mpp_transmit.inc.

◆ mpp_transmit_3d_()

subroutine mpp_transmit_3d_ ( dimension(:,:,:), intent(in)  put_data,
integer, intent(in)  put_len,
integer, intent(in)  to_pe,
dimension(:,:,:), intent(out)  get_data,
integer, intent(in)  get_len,
integer, intent(in)  from_pe,
logical, intent(in), optional  block,
integer, intent(in), optional  tag,
integer, intent(out), optional  recv_request,
integer, intent(out), optional  send_request 
)

Definition at line 81 of file mpp_transmit.inc.

◆ mpp_transmit_4d_()

subroutine mpp_transmit_4d_ ( dimension(:,:,:,:), intent(in)  put_data,
integer, intent(in)  put_len,
integer, intent(in)  to_pe,
dimension(:,:,:,:), intent(out)  get_data,
integer, intent(in)  get_len,
integer, intent(in)  from_pe,
logical, intent(in), optional  block,
integer, intent(in), optional  tag,
integer, intent(out), optional  recv_request,
integer, intent(out), optional  send_request 
)

Definition at line 103 of file mpp_transmit.inc.

◆ mpp_transmit_5d_()

subroutine mpp_transmit_5d_ ( dimension(:,:,:,:,:), intent(in)  put_data,
integer, intent(in)  put_len,
integer, intent(in)  to_pe,
dimension(:,:,:,:,:), intent(out)  get_data,
integer, intent(in)  get_len,
integer, intent(in)  from_pe,
logical, intent(in), optional  block,
integer, intent(in), optional  tag,
integer, intent(out), optional  recv_request,
integer, intent(out), optional  send_request 
)

Definition at line 125 of file mpp_transmit.inc.

◆ mpp_transmit_scalar_()

subroutine mpp_transmit_scalar_ ( intent(in)  put_data,
integer, intent(in)  to_pe,
intent(out)  get_data,
integer, intent(in)  from_pe,
integer, intent(in), optional  plen,
integer, intent(in), optional  glen,
logical, intent(in), optional  block,
integer, intent(in), optional  tag,
integer, intent(out), optional  recv_request,
integer, intent(out), optional  send_request 
)

Definition at line 33 of file mpp_transmit.inc.

Variable Documentation

◆ clock0

integer clock0
private

measures total runtime from mpp_init to mpp_exit

Definition at line 1327 of file mpp.F90.

◆ clock_grain

integer clock_grain =CLOCK_LOOP-1
private

Definition at line 1324 of file mpp.F90.

◆ clock_num

integer clock_num =0
private

Definition at line 1296 of file mpp.F90.

◆ clock_summary

type(summary_struct), dimension(max_clocks) clock_summary
private

Definition at line 1321 of file mpp.F90.

◆ clocks

type(clock), dimension(max_clocks), save clocks
private

Definition at line 1288 of file mpp.F90.

◆ configfile

character(len=32), parameter configfile ='logfile'
private

Definition at line 1291 of file mpp.F90.

◆ cur_recv_request

integer cur_recv_request = 0
private

Definition at line 1303 of file mpp.F90.

◆ cur_send_request

integer cur_send_request = 0
private

Definition at line 1302 of file mpp.F90.

◆ current_clock

integer current_clock =0
private

Definition at line 1296 of file mpp.F90.

◆ current_peset_max

integer current_peset_max = 32
private

Definition at line 1276 of file mpp.F90.

◆ current_peset_num

integer current_peset_num =0
private

Definition at line 1293 of file mpp.F90.

◆ datatypes

type(mpp_type_list) datatypes
private

Definition at line 1299 of file mpp.F90.

◆ debug

logical debug = .false.
private

Definition at line 1280 of file mpp.F90.

◆ end_tick

integer(i8_kind) end_tick
private

Definition at line 1282 of file mpp.F90.

◆ err_unit

integer err_unit =ERROR_UNIT
private

Definition at line 1317 of file mpp.F90.

◆ error

integer error
private

Definition at line 1295 of file mpp.F90.

◆ error_state

integer error_state =0
private

Definition at line 1323 of file mpp.F90.

◆ etc_unit

integer etc_unit
private

Definition at line 1289 of file mpp.F90.

◆ etc_unit_is_stderr

logical etc_unit_is_stderr = .false.
private

Definition at line 1377 of file mpp.F90.

◆ etcfile

character(len=32) etcfile ='/dev/null'
private

Definition at line 1313 of file mpp.F90.

◆ first_call_system_clock_mpi

logical first_call_system_clock_mpi =.TRUE.
private

Definition at line 1284 of file mpp.F90.

◆ get_len_nocomm

integer get_len_nocomm = 0
private

needed for mpp_transmit_nocomm.h

Definition at line 1331 of file mpp.F90.

◆ in_unit

integer in_unit =INPUT_UNIT
private

Use the intrinsics in iso_fortran_env.

Definition at line 1317 of file mpp.F90.

◆ input_nml_file

character(len=:), dimension(:), allocatable, target, public input_nml_file

Definition at line 1366 of file mpp.F90.

◆ log_unit

integer log_unit
private

Definition at line 1289 of file mpp.F90.

◆ max_request

integer max_request = 0
private

Definition at line 1378 of file mpp.F90.

◆ max_request_min

integer, parameter max_request_min = 10000
private

Definition at line 1374 of file mpp.F90.

◆ max_ticks

integer(i8_kind) max_ticks
private

Definition at line 1282 of file mpp.F90.

◆ module_is_initialized

logical module_is_initialized = .false.
private

Definition at line 1279 of file mpp.F90.

◆ mpi_count0

real(r8_kind) mpi_count0 =0
private

use to prevent integer overflow

Definition at line 1285 of file mpp.F90.

◆ mpi_tick_rate

real(r8_kind) mpi_tick_rate =0.d0
private

clock rate for mpi_wtick()

Definition at line 1286 of file mpp.F90.

◆ mpp_byte

type(mpp_type), target, public mpp_byte

Definition at line 1300 of file mpp.F90.

◆ mpp_comm_null

integer, parameter, public mpp_comm_null = 67108864

MPP_COMM_NULL acts as an analagous mpp-macro for MPI_COMM_NULL to share with fms2_io NetCDF4 mpi-io. The default value for the no-mpi case comes from Intel MPI and MPICH. OpenMPI sets a default value of '2'.

Definition at line 1359 of file mpp.F90.

◆ mpp_comm_private

integer mpp_comm_private
private

Definition at line 1283 of file mpp.F90.

◆ mpp_info_null

integer, parameter, public mpp_info_null = 469762048

MPP_INFO_NULL acts as an analagous mpp-macro for MPI_INFO_NULL to share with fms2_io NetCDF4 mpi-io. The default value for the no-mpi case comes from Intel MPI and MPICH. OpenMPI sets a default value of '0'.

Definition at line 1350 of file mpp.F90.

◆ mpp_init_test_clocks_init

integer, parameter, public mpp_init_test_clocks_init = 2

Definition at line 1337 of file mpp.F90.

◆ mpp_init_test_datatype_list_init

integer, parameter, public mpp_init_test_datatype_list_init = 3

Definition at line 1338 of file mpp.F90.

◆ mpp_init_test_etc_unit

integer, parameter, public mpp_init_test_etc_unit = 6

Definition at line 1341 of file mpp.F90.

◆ mpp_init_test_full_init

integer, parameter, public mpp_init_test_full_init = -1

Definition at line 1334 of file mpp.F90.

◆ mpp_init_test_init_true_only

integer, parameter, public mpp_init_test_init_true_only = 0

Definition at line 1335 of file mpp.F90.

◆ mpp_init_test_logfile_init

integer, parameter, public mpp_init_test_logfile_init = 4

Definition at line 1339 of file mpp.F90.

◆ mpp_init_test_peset_allocated

integer, parameter, public mpp_init_test_peset_allocated = 1

Definition at line 1336 of file mpp.F90.

◆ mpp_init_test_read_namelist

integer, parameter, public mpp_init_test_read_namelist = 5

Definition at line 1340 of file mpp.F90.

◆ mpp_init_test_requests_allocated

integer, parameter, public mpp_init_test_requests_allocated = 7

Definition at line 1342 of file mpp.F90.

◆ mpp_record_timing_data

logical, public mpp_record_timing_data =.TRUE.

Definition at line 1287 of file mpp.F90.

◆ mpp_stack_hwm

integer mpp_stack_hwm =0
private

Definition at line 1328 of file mpp.F90.

◆ mpp_stack_size

integer mpp_stack_size =0
private

Definition at line 1328 of file mpp.F90.

◆ npes

integer npes =1
private

Definition at line 1281 of file mpp.F90.

◆ num_clock_ids

integer num_clock_ids =0
private

Definition at line 1296 of file mpp.F90.

◆ out_unit

integer out_unit =OUTPUT_UNIT
private

Definition at line 1317 of file mpp.F90.

◆ pe

integer pe =0
private

Definition at line 1281 of file mpp.F90.

◆ peset

type(communicator), dimension(:), allocatable peset
private

Will be allocated starting from 0, 0 is a dummy used to hold single-PE "self" communicator.

Definition at line 1277 of file mpp.F90.

◆ peset_max

integer, parameter peset_max = 10000
private

Definition at line 1275 of file mpp.F90.

◆ peset_num

integer peset_num =0
private

Definition at line 1293 of file mpp.F90.

◆ previous_clock

integer, dimension(max_clocks) previous_clock =0
private

Definition at line 1296 of file mpp.F90.

◆ read_ascii_file_on

logical read_ascii_file_on = .FALSE.
private

Definition at line 1367 of file mpp.F90.

◆ request_multiply

integer request_multiply = 20
private

Definition at line 1375 of file mpp.F90.

◆ request_recv

integer, dimension(:), allocatable request_recv
private

Definition at line 1305 of file mpp.F90.

◆ request_send

integer, dimension(:), allocatable request_send
private

Definition at line 1304 of file mpp.F90.

◆ root_pe

integer root_pe =0
private

Definition at line 1281 of file mpp.F90.

◆ size_recv

integer, dimension(:), allocatable size_recv
private

Definition at line 1306 of file mpp.F90.

◆ start_tick

integer(i8_kind) start_tick
private

Definition at line 1282 of file mpp.F90.

◆ stdout_unit

integer stdout_unit
private

Definition at line 1318 of file mpp.F90.

◆ sync_all_clocks

logical sync_all_clocks = .false.
private

Definition at line 1379 of file mpp.F90.

◆ tick

integer(i8_kind) tick
private

Definition at line 1282 of file mpp.F90.

◆ tick0

integer(i8_kind) tick0 =0
private

Definition at line 1282 of file mpp.F90.

◆ tick_rate

real tick_rate
private

Definition at line 1297 of file mpp.F90.

◆ ticks_per_sec

integer(i8_kind) ticks_per_sec
private

Definition at line 1282 of file mpp.F90.

◆ type_recv

integer, dimension(:), allocatable type_recv
private

Definition at line 1307 of file mpp.F90.

◆ verbose

logical verbose =.FALSE.
private

Definition at line 1329 of file mpp.F90.

◆ warn_unit

integer warn_unit
private

unit number of the warning log

Definition at line 1290 of file mpp.F90.

◆ warnfile

character(len=32), parameter warnfile ='warnfile'
private

base name for warninglog (appends ".<PE>.out")

Definition at line 1292 of file mpp.F90.

◆ warnings_are_fatal

logical warnings_are_fatal = .FALSE.
private

Definition at line 1322 of file mpp.F90.

◆ world_peset_num

integer world_peset_num
private

the world communicator

Definition at line 1294 of file mpp.F90.