Class CBCD_AsynchronousCommunicator
Defined in File cbcd_async_comm.h
Nested Relationships
Nested Types
Inheritance Relationships
Base Type
public opensn::AsynchronousCommunicator(Class AsynchronousCommunicator)
Class Documentation
-
class CBCD_AsynchronousCommunicator : public opensn::AsynchronousCommunicator
Device CBC asynchronous communicator.
Public Functions
-
explicit CBCD_AsynchronousCommunicator(std::size_t angle_set_id, FLUDS &fluds, const MPICommunicatorSet &comm_set)
-
std::vector<double> &InitGetDownwindMessageData(int location_id, std::uint64_t cell_global_id, unsigned int face_id, std::size_t data_size)
Return writable outgoing face-psi storage for a downwind face.
The storage is zero-initialized only when a destination-face entry is first created.
- Parameters:
location_id – Destination location ID.
cell_global_id – Downstream cell global ID.
face_id – Downstream face ID.
data_size – Number of psi values for the destination face.
- Returns:
Outgoing face-psi storage for the specified destination face.
-
bool SendData()
Start or progress pending nonblocking sends.
-
std::vector<std::uint64_t> ReceiveData()
Receive available nonlocal face psi and return cells with newly received face data.
-
inline void Reset()
Clear queued outgoing messages and send buffers.
Protected Attributes
-
const std::size_t angle_set_id_
Angle-set MPI message tag.
-
CBCD_FLUDS &cbcd_fluds_
CBCD FLUDS receiving nonlocal face psi.
-
std::unordered_map<MessageKey, std::vector<double>, MessageKeyHash> outgoing_message_queue_
Queued outgoing face psi by destination face.
-
std::vector<BufferItem> send_buffer_
Active nonblocking send buffers.
-
struct BufferItem
Destination-batched nonblocking send buffer.
-
struct MessageKey
Key for one outgoing nonlocal face message.
Public Functions
-
bool operator==(const MessageKey&) const = default
-
bool operator==(const MessageKey&) const = default
-
struct MessageKeyHash
Hash functor for
MessageKey.Adapted from Wolfgang Brehm’s answer to mitigate systematic hash collisions in unordered maps keyed by aggregate types (https://stackoverflow.com/a/50978188).
Public Functions
-
inline std::size_t operator()(const MessageKey &key) const noexcept
Return a mixed hash for a message key.
-
inline std::size_t operator()(const MessageKey &key) const noexcept
-
explicit CBCD_AsynchronousCommunicator(std::size_t angle_set_id, FLUDS &fluds, const MPICommunicatorSet &comm_set)