41 call this%cached_ids%init()
48 function mmc_get(this, unit, rank, stage, msg_id)
result(mpi_type)
53 integer(I4B) :: msg_id
56 integer(I4B) :: unit_idx
57 class(*),
pointer :: obj_ptr
61 unit_idx = this%cached_ids%get_index(unit)
62 if (unit_idx == -1)
return
64 obj_ptr => this%unit_caches%GetItem(unit_idx)
67 mpi_type = obj_ptr%get_cached(rank, stage, msg_id)
75 subroutine mmc_put(this, unit, rank, stage, msg_id, mpi_type)
80 integer(I4B) :: msg_id
83 integer(I4B) :: unit_idx
85 class(*),
pointer :: obj_ptr
87 unit_idx = this%cached_ids%get_index(unit)
88 if (unit_idx == -1)
then
90 call this%cached_ids%push_back(unit)
95 call this%unit_caches%Add(obj_ptr)
96 unit_idx = this%cached_ids%size
100 obj_ptr => this%unit_caches%GetItem(unit_idx)
101 select type (obj_ptr)
103 call obj_ptr%cache(rank, stage, msg_id, mpi_type)
114 class(*),
pointer :: obj_ptr
117 do i = 1, this%cached_ids%size
118 obj_ptr => this%unit_caches%GetItem(i)
119 select type (obj_ptr)
121 call obj_ptr%destroy()
124 call this%unit_caches%Clear(
destroy=.true.)
126 call this%cached_ids%destroy()
This module defines variable data types.
integer(i4b), parameter, public nr_msg_types
the total number of message types to be cached
integer function mmc_get(this, unit, rank, stage, msg_id)
integer(i4b), parameter, public mpi_bdy_snd
sending data (body) to ranks
subroutine mmc_destroy(this)
subroutine mmc_init(this)
subroutine mmc_put(this, unit, rank, stage, msg_id, mpi_type)
Put the mpi datatype for this particular unit, rank, and stage in cache. The datatype should be.
integer(i4b), parameter, public mpi_bdy_rcv
receiving data (body) from ranks
integer(i4b), parameter, public no_cached_value
integer(i4b), parameter, public nr_sim_stages
before exchange formulate (per solution)
A generic heterogeneous doubly-linked list.
Facility to cache the constructed MPI datatypes. This will avoid having to construct them over and ov...