|
core 1.8.1
Shared MPI block decomposition, asynchronous ghost-layer exchange, SDF geometry, load balancing (header-only C++20)
|
GPU ghost-layer exchange for a contiguous device field peclet::core::View<T> (one element per extended-block cell). More...
#include <grid_halo.hpp>
Public Member Functions | |
| GridHalo ()=default | |
| GridHalo (const GridHalo &)=delete | |
| GridHalo & | operator= (const GridHalo &)=delete |
| ~GridHalo () | |
| template<int Dim> | |
| void | init (const GridHaloTopology< Dim > &halo, int stack=1, Index stride=0) |
| Build the exchange from a host topology. | |
| void | setLabel (std::string label) |
| Name printed by the PECLET_CORE_HALO_TIMEOUT diagnostic (e.g. | |
| int | numShmPartners () const |
| Number of this rank's partners (send + receive) served by the on-node shared-memory transport; 0 on a device memory space, at one rank, or with PECLET_CORE_HALO_SHM=0 (PECLET_CORE_HALO_SHM_GROUP=k: only the partners in this rank's group of k node ranks). | |
| void | exchange (const View< T > &field, int tag=0) |
| Exchange ghost layers of the device field field. Blocking (== exchangeBegin+exchangeEnd). | |
| void | exchangeBegin (const View< T > &field, int tag=0) |
| Start an exchange: periodic self-copy and pack (ONE gather), start the receives and sends, return with the messages in flight. | |
| void | exchangeEnd (const View< T > &field) |
| Complete the exchange started by exchangeBegin: wait, then scatter the received halo cells into field's ghost region (must be the same field). | |
GPU ghost-layer exchange for a contiguous device field peclet::core::View<T> (one element per extended-block cell).
Build once from a host GridHaloTopology via init(); exchange() runs every step.
Definition at line 201 of file grid_halo.hpp.
|
default |
Referenced by GridHalo(), and operator=().
|
delete |
References GridHalo().
|
inline |
Definition at line 206 of file grid_halo.hpp.
|
delete |
References GridHalo().
|
inline |
Build the exchange from a host topology.
COLLECTIVE over the topology's communicator when the on-node transport is possible (host memory space, more than one rank): every rank of it calls init for this instance, as for GridHaloTopology::buildTopology, and destroys or re-inits the instance at the same point of the program (the shared window is freed collectively).
stack = k > 1 exchanges k fields at once (one gather launch, one message per partner): the fields lie at offsets 0, stride, ..., (k-1) * stride of the ONE view passed to exchange(), each laid out like the topology's block (stride >= its cells incl. ghosts). The ghost values are those of k single-field exchanges, bitwise (FlatTopology::stacked).
Definition at line 222 of file grid_halo.hpp.
References peclet::core::halo::detail::gpuAwareMpi(), and peclet::core::toDevice().
|
inline |
Name printed by the PECLET_CORE_HALO_TIMEOUT diagnostic (e.g.
"mg L4 g1"), so a stuck exchange can be told apart from the others that share a communicator.
Definition at line 262 of file grid_halo.hpp.
|
inline |
Number of this rank's partners (send + receive) served by the on-node shared-memory transport; 0 on a device memory space, at one rank, or with PECLET_CORE_HALO_SHM=0 (PECLET_CORE_HALO_SHM_GROUP=k: only the partners in this rank's group of k node ranks).
Definition at line 267 of file grid_halo.hpp.
|
inline |
Exchange ghost layers of the device field field. Blocking (== exchangeBegin+exchangeEnd).
Definition at line 270 of file grid_halo.hpp.
References exchangeBegin(), and exchangeEnd().
|
inline |
Start an exchange: periodic self-copy and pack (ONE gather), start the receives and sends, return with the messages in flight.
The caller may run kernels that touch only INNER (non-ghost, non-send) cells before exchangeEnd — that overlap is the point of the split. One exchange may be in flight per GridHalo instance. tag == 0 (every caller today) starts the persistent requests built at init and, on a host memory space, the on-node shared-memory transport; any other tag posts Isend/Irecv on that tag to every partner.
Definition at line 281 of file grid_halo.hpp.
References peclet::core::halo::detail::gpuAwareMpi(), and peclet::core::halo::kHaloSerialCopy.
Referenced by exchange().
|
inline |
Complete the exchange started by exchangeBegin: wait, then scatter the received halo cells into field's ghost region (must be the same field).
Definition at line 372 of file grid_halo.hpp.
References peclet::core::halo::detail::haloTimeout(), peclet::core::halo::kHaloSerialCopy, MPI_STATUSES_IGNORE, and MPI_Waitall().
Referenced by exchange().