DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
DNDS::MPIBufferHandler Class Reference

Process-singleton managing the buffer attached to MPI for MPI_Bsend (buffered sends). More...

#include <MPI.hpp>

Public Types

using size_type = decltype(buf)::size_type
 

Public Member Functions

MPI_int size ()
 Current buffer size in bytes (fits in MPI_int; asserted).
 
void claim (MPI_Aint cs, int reportRank=0)
 Reserve cs additional bytes, growing and re-attaching the MPI buffer if needed. reportRank is only used for diagnostic logs.
 
void unclaim (MPI_int cs)
 Release cs previously-claim ed bytes (only updates accounting; does not shrink the buffer).
 
void * getBuf ()
 Direct pointer to the attached buffer (for diagnostics).
 

Static Public Member Functions

static MPIBufferHandlerInstance ()
 Access the process-wide singleton.
 

Detailed Description

Process-singleton managing the buffer attached to MPI for MPI_Bsend (buffered sends).

Some algorithms (e.g., serialised writes) use buffered sends to decouple sender from receiver. MPI requires the application to provide the buffer via MPI_Buffer_attach. This singleton owns that buffer, grows it on demand via claim, and exposes a thin accounting layer (claim / unclaim) so multiple components can share the buffer without stepping on each other.

Thread-safe construction on C++11; not MT-safe for concurrent claims.

Definition at line 560 of file MPI.hpp.

Member Typedef Documentation

◆ size_type

using DNDS::MPIBufferHandler::size_type = decltype(buf)::size_type

Definition at line 566 of file MPI.hpp.

Member Function Documentation

◆ claim()

void DNDS::MPIBufferHandler::claim ( MPI_Aint  cs,
int  reportRank = 0 
)
inline

Reserve cs additional bytes, growing and re-attaching the MPI buffer if needed. reportRank is only used for diagnostic logs.

Definition at line 595 of file MPI.hpp.

Here is the caller graph for this function:

◆ getBuf()

void * DNDS::MPIBufferHandler::getBuf ( )
inline

Direct pointer to the attached buffer (for diagnostics).

Definition at line 624 of file MPI.hpp.

◆ Instance()

MPIBufferHandler & DNDS::MPIBufferHandler::Instance ( )
static

Access the process-wide singleton.

Definition at line 107 of file MPI.cpp.

Here is the caller graph for this function:

◆ size()

MPI_int DNDS::MPIBufferHandler::size ( )
inline

Current buffer size in bytes (fits in MPI_int; asserted).

Definition at line 588 of file MPI.hpp.

◆ unclaim()

void DNDS::MPIBufferHandler::unclaim ( MPI_int  cs)
inline

Release cs previously-claim ed bytes (only updates accounting; does not shrink the buffer).

Definition at line 618 of file MPI.hpp.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: