Class CBCD_AsynchronousCommunicator

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

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.

Public Members

int destination = 0

Destination location.

mpi::Request mpi_request

Active nonblocking send request.

bool send_initiated = false

Nonblocking-send state.

bool completed = false

Send completion state.

ByteArray data_array

Serialized face-psi data.

struct MessageKey

Key for one outgoing nonlocal face message.

Public Functions

bool operator==(const MessageKey&) const = default

Public Members

int location_id = 0

Destination location.

std::uint64_t cell_global_id = 0

Downstream cell global ID.

unsigned int face_id = 0

Downstream face ID.

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.