Other Standard Facilities
Contents
Other Standard Facilities
The following classes are all defined within namespace HIPP::MPI.
Class Message: Probing and Matching
-
class Message
Memory management methods:
Method
Detail
default constructor
Available;
noexcept; constructs a null value
as returned bynullval().copy constructor
andoperator=(&&)Not Available.
move constructor
andoperator=(const &)Available;
noexcept.-
typedef MPI_Message mpi_t;
-
explicit Message(mpi_t message) noexcept
Explicit construct a message object from MPI raw message object.
-
static Message nullval() noexcept
-
static Message no_proc_val() noexcept
-
bool is_null() const noexcept
-
bool is_no_proc() const noexcept
nullval()returns a null value (internallyMPI_MESSAGE_NULL).no_proc_val()returns a value of no-process (internallyMPI_MESSAGE_NO_PROC).is_null()tests whether this instance is a null value.is_no_proc()tests whether this instance is a no-process value.
-
typedef MPI_Message mpi_t;
Class Info: the Hints to MPI Implementation
-
class Info
-
typedef std::pair<string, string> item_t
The type of info item, i.e., a key-value string pair.
Method
Detail
default constructor
Available; constructs an empty info object
copy constructor
andoperator=(&&)Available;
noexcept; shallow copy.move constructor
andoperator=(const &)Available;
noexcept.-
ostream &info(ostream &os = cout, int fmt_cntl = 1) const
-
friend ostream &operator<<(ostream &os, const Info &info)
Display some basic information of the info instance to
os.- Parameters
fmt_cntl – Control the display format. 0 for inline information and 1 for a verbose, multiple-line information including all key-value pairs.
- Returns
The
osobject is returned.
The overloaded
<<operator is equivalent toinfo()with the defaultfmt_cntl.
-
void free() noexcept
Free the current info object and set it to null value as returned by
nullval().free()can be called at any time, even for a pre-defined info object.
-
bool is_null() const
Inquiry whether the info object is a null value.
-
bool get(const string &key, string &val) const
-
string get(const string &key) const
-
item_t get(int n) const
-
vector<item_t> get() const
-
string operator[](const string &key) const
-
item_t operator[](int n) const
-
bool get_valuelen(const string &key, int &len) const
-
int get_nkeys() const
-
string get_nthkey(int n) const
Inquiry key-value pair, or pairs, or information of the pair.
get(key, val)returns the value intovalcorresponding to key. If the key is not set, returnfalse, andvalis not modified. Otherwise returntrue.get(key)returns the value corresponding tokey. If not set, throw anErrLogic.get(n)returns the n-th key-value pair.item_tis astd::pair<>instance with thefirstandsecondmember corresponding to key and value, respectively.get()returns a vector containing all key-value pairs.operator[](key)andoprator[](n)are aliased toget(key)andget(n).get_valuelen()returns the lengths of the value intolen(not including the space of null-terminator) and returntrueif the key is set. Otherwise returnfalseandlenis not modified.get_nkeys()gets number of keys.get_nthkey()returns the n-th key.
-
typedef std::pair<string, string> item_t
Memory Management
-
void *alloc_mem(aint_t size, const Info &info = Info::nullval())
-
void free_mem(void *base)
alloc_mem(size, info)allocatessizebytes contiguous memory with hintsinfo. The pointer to its starting address is returned.The allocated memory must be free by
free_mem()after using, otherwise causing memory leak.Exception: both of the two functions throw an
ErrMPIinstance on failure. The error code is determined by MPI implementation.
-
void buffer_attach(void *buffer, int size)
-
std::pair<void*, int> buffer_detach()
Buffer management for buffered send operation.
buffer_attach(buffer, size)attaches abufferwithsizebytes to be used for buffered mode send. User may useBSEND_OVERHEADto properly determine the overhead associated with each message.buffer_detach()detaches the buffer and returns its base address and size in bytes. This call will blocked until all messages currently in the buffer have been transmitted.