Class CBC_AsynchronousCommunicator

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

Class Documentation

class CBC_AsynchronousCommunicator : public opensn::AsynchronousCommunicator

Host CBC asynchronous communicator.

Public Functions

explicit CBC_AsynchronousCommunicator(std::size_t groupset_id, std::size_t angle_set_id, FLUDS &fluds, const SweepCommunicator &sweep_communicator)
void QueueDownwindMessage(std::size_t peer_index, std::size_t incoming_face_slot, std::span<const double> outgoing_face_psi)

Queue downwind nonlocal face psi for asynchronous send.

Parameters:
  • peer_index – SPDS-successor peer index.

  • incoming_face_slot – Receiver-side incoming face slot.

  • outgoing_face_psi – Face psi values to append to the destination send buffer.

bool SendData()

Start or progress pending nonblocking sends.

void ReceiveData(std::vector<std::uint32_t> &cells_who_received_data)

Receive all currently available nonlocal face psi.

The output vector is cleared, then populated with local task IDs whose received face data was stored in the CBC FLUDS.

inline bool HasPendingCommunication() const noexcept

Return whether sends remain in flight.

void Reset()

Clear pending send and receive state.

Protected Functions

BufferItem &GetOpenSendBuffer(std::size_t peer_index)

Return the open send buffer for a destination peer.

Protected Attributes

const int message_tag_

Validated angle-set MPI message tag.

const mpi::Communicator &receive_comm_

Communicator used for incoming face psi.

CBC_FLUDS &cbc_fluds_

CBC FLUDS receiving nonlocal face psi.

std::size_t num_receive_sources_ = 0

Number of upstream locations that may send face psi.

std::vector<BufferItem> send_buffer_

Active nonblocking send buffers.

std::vector<mpi::Request> send_requests_

MPI requests matching send_buffer_.

std::vector<BufferItem> reusable_send_buffers_

Cleared send buffers available for reuse.

std::vector<char> receive_buffer_

Receive buffer for one packed MPI message.

std::vector<int> send_peer_ranks_

Global ranks of SPDS successors.

std::vector<std::size_t> open_send_buffer_indices_

Open send-buffer index by successor peer.

Protected Static Attributes

static std::size_t INVALID_BUFFER_INDEX = std::numeric_limits<std::size_t>::max()

Sentinel for no open send buffer.

struct BufferItem

Destination-batched send buffer.

Public Members

int rank = 0

Global destination rank.

bool send_initiated = false

Nonblocking-send state.

std::vector<char> data

Serialized face-psi data.