42 call this%cached_ids%init()
49 function mmc_get(this, unit, rank, stage, msg_id)
result(mpi_type)
54 integer(I4B) :: msg_id
57 integer(I4B) :: unit_idx
58 class(*),
pointer :: obj_ptr
62 unit_idx = this%cached_ids%get_index(unit)
63 if (unit_idx == -1)
return
65 obj_ptr => this%unit_caches%GetItem(unit_idx)
68 mpi_type = obj_ptr%get_cached(rank, stage, msg_id)
76 subroutine mmc_put(this, unit, rank, stage, msg_id, mpi_type)
81 integer(I4B) :: msg_id
84 integer(I4B) :: unit_idx
86 class(*),
pointer :: obj_ptr
88 unit_idx = this%cached_ids%get_index(unit)
89 if (unit_idx == -1)
then
91 call this%cached_ids%push_back(unit)
96 call this%unit_caches%Add(obj_ptr)
97 unit_idx = this%cached_ids%size
101 obj_ptr => this%unit_caches%GetItem(unit_idx)
102 select type (obj_ptr)
104 call obj_ptr%cache(rank, stage, msg_id, mpi_type)
115 class(*),
pointer :: obj_ptr
118 do i = 1, this%cached_ids%size
119 obj_ptr => this%unit_caches%GetItem(i)
120 select type (obj_ptr)
134 class(*),
pointer :: obj_ptr
137 do i = 1, this%cached_ids%size
138 obj_ptr => this%unit_caches%GetItem(i)
139 select type (obj_ptr)
141 call obj_ptr%destroy()
144 call this%unit_caches%Clear(
destroy=.true.)
146 call this%cached_ids%destroy()
This module defines variable data types.
subroutine clear(this, destroy)
Deallocate all items in list.
subroutine mmc_clear(this)
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...