|
MADNESS 0.10.1
|
The (count, datatype) pair that describes a buffer of bytes to MPI. More...
#include <safempi.h>
Public Member Functions | |
| ByteCount (const ByteCount &)=delete | |
| ByteCount (std::size_t nbyte, std::size_t chunk=ByteCount::max_plain_count()) | |
| ~ByteCount () | |
| int | count () const |
| MPI_Datatype | datatype () const |
| bool | derived () const |
| ByteCount & | operator= (const ByteCount &)=delete |
Static Public Member Functions | |
| static constexpr bool | have_large_count () |
| static std::size_t | max_plain_count () |
| static void | set_max_plain_count (std::size_t n) |
| Sets max_plain_count(). | |
| static void | set_use_large_count (bool flag) |
| Sets use_large_count(). | |
| static bool | use_large_count () |
Static Private Member Functions | |
| static std::atomic< std::size_t > & | max_plain_count_accessor () |
| static std::atomic< bool > & | use_large_count_accessor () |
Private Attributes | |
| int | count_ |
| MPI_Datatype | datatype_ |
| bool | derived_ |
The (count, datatype) pair that describes a buffer of bytes to MPI.
This is how a buffer of more than INT_MAX bytes is sent and received where MPI has no large-count functions (before MPI 4), see Intracomm::Isend_bytes() . MPI counts are int , so a buffer of more than INT_MAX bytes cannot be described as a count of MPI_BYTE . Such a buffer is described here as one element of a derived datatype: whole chunks of bytes, then the bytes left over. The type signature is that of the same number of MPI_BYTE , so the two ends of a message need not agree on how they describe it. A derived datatype is freed by the destructor; MPI lets a datatype be freed while a nonblocking operation that uses it is pending, so the object need not outlive the request.
|
inlineexplicit |
| nbyte | the size of the buffer |
| chunk | a buffer of up to this many bytes is described as a count of MPI_BYTE , and a larger one as chunks of this many bytes plus the rest (default: max_plain_count() ; 0, or a value above INT_MAX , means INT_MAX ) |
References count_, datatype_, derived_, MADNESS_MPI_TEST, max_plain_count(), MPI_BYTE, MPI_ERR_COUNT, MPI_SUCCESS, MPI_Type_commit(), MPI_Type_contiguous(), MPI_Type_create_struct(), MPI_Type_free(), SAFE_MPI_GLOBAL_MUTEX, and status.
Referenced by ByteCount(), and operator=().
|
delete |
References ByteCount().
|
inline |
References datatype_, derived_, MPI_Type_free(), and SAFE_MPI_GLOBAL_MUTEX.
|
inline |
References count_.
Referenced by SafeMPI::Intracomm::Irecv_bytes(), and SafeMPI::Intracomm::Isend_bytes().
|
inline |
References datatype_.
Referenced by SafeMPI::Intracomm::Irecv_bytes(), and SafeMPI::Intracomm::Isend_bytes().
|
inline |
MPI_BYTE References derived_.
|
inlinestaticconstexpr |
MPI_Isend_c and the like), which take a count of type MPI_Count Referenced by main(), and use_large_count().
|
inlinestatic |
MPI_BYTE References max_plain_count_accessor().
Referenced by ByteCount(), SafeMPI::Intracomm::Irecv_bytes(), and SafeMPI::Intracomm::Isend_bytes().
|
inlinestaticprivate |
Referenced by max_plain_count(), and set_max_plain_count().
References ByteCount().
|
inlinestatic |
Sets max_plain_count().
This exists for tests, which lower it to take the derived-datatype path with small buffers; nothing else has a reason to call it. The two ends of a message may use different values, and a change while messages are in flight is safe: each ByteCount reads the value once.
| n | the new value; 0, or a value above INT_MAX , restores the default |
References max_plain_count_accessor().
Referenced by main().
|
inlinestatic |
Sets use_large_count().
Like set_max_plain_count() this exists for tests, which turn it off to take the derived-datatype path with an MPI that has large counts. The two ends of a message need not agree.
References use_large_count_accessor().
Referenced by main().
|
inlinestatic |
References have_large_count(), and use_large_count_accessor().
Referenced by SafeMPI::Intracomm::Irecv_bytes(), SafeMPI::Intracomm::Isend_bytes(), and main().
|
inlinestaticprivate |
Referenced by set_use_large_count(), and use_large_count().
|
private |
Referenced by ByteCount(), and count().
|
private |
Referenced by ByteCount(), ~ByteCount(), and datatype().
|
private |
Referenced by ByteCount(), ~ByteCount(), and derived().