Auxiliary functions and classes¶
Integer types¶
-
using mpl::size_t = std::size_t¶
Unsigned integer type used for array indexing and address arithmetic.
-
using mpl::ssize_t = std::ptrdiff_t¶
Signed integer type used for array indexing and address arithmetic.
Ranks¶
-
class ranks : private std::vector<int>¶
Represents a collection of ranks.
See also
class
groupPublic Functions
-
inline explicit ranks(size_type n = 0)¶
Constructs collection of ranks with all ranks having value zero.
- Parameters:
n – initial size of the collection
-
inline ranks(std::initializer_list<int> init)¶
Constructs collection of ranks from a braces expression of integers.
- Parameters:
init – list of initial values
-
ranks(const ranks &other) = default¶
Constructs collection of ranks from another collection.
- Parameters:
other – the other collection to copy from
-
inline ranks(ranks &&other) noexcept¶
Move-constructs collection of ranks from another collection.
- Parameters:
other – the other collection to move from
-
inline const int *operator()() const¶
Gives access to internal data.
- Returns:
pointer to constant array
-
inline int *operator()()¶
Gives access to internal data.
- Returns:
pointer to array
-
inline explicit ranks(size_type n = 0)¶
Types for probing messages¶
The following types are used in the context of probing messages. See section Probing messages for an example.
Warning
doxygenclass: Cannot find class “mpl::message_t” in doxygen xml output for project “MPL” from directory: /home/bauke/Programmieren/Parallel/mpi/mpl/cmake-build-documentation/doc/doxygen/xml
-
class status_t : private MPI_Status¶
Class that represents the status of a received message.
Public Functions
-
inline int source() const¶
- Returns:
source of the message
-
inline int error() const¶
- Returns:
error code associated with the message
-
inline bool is_cancelled() const¶
- Returns:
true if associated request has been canceled
-
inline bool is_canceled() const¶
- Returns:
true if associated request has been canceled
-
template<typename T>
inline ssize_t get_count() const¶ - Template Parameters:
T – received data type
- Returns:
number of top level elements of type
Treceived in associated message
-
template<typename T>
inline ssize_t get_count(const layout<T> &l) const¶ - Template Parameters:
T – received data type
- Parameters:
l – layout used in associated message
- Returns:
number of top level elements of type
Treceived in associated message
-
inline status_t()¶
default constructor initializes source and tag with wildcards given by
any_sourceandtag_t::anyand no error
Friends
- friend class impl::base_communicator
- friend class impl::base_request
- friend class impl::request_pool
- friend class file
-
inline int source() const¶
-
struct mprobe_status¶
Return value of matching probe operations.
Memory displacements¶
The mpl::displacements class is used in the context of various collective communication operations that send and/or receive an amount of data that varies over the set of participating processes.
-
class displacements : private std::vector<ssize_t>¶
Set of displacements indicates the beginning of data buffers in various collective communication operations.
Note
Individual displacements are always given in bytes.
Public Functions
-
inline explicit displacements(size_type n = 0)¶
Constructs a set of displacements with displacement zero.
- Parameters:
n – number of displacements
-
inline explicit displacements(std::initializer_list<ssize_t> init)¶
Constructs a set of displacements with given displacements.
- Parameters:
init – initial displacements
-
displacements(const displacements &other) = default¶
Copy constructor.
- Parameters:
other – the other set of displacements to copy from
-
displacements(displacements &&other) = default¶
Move constructor.
- Parameters:
other – the other set of displacements to move from
-
inline explicit displacements(size_type n = 0)¶
Requests¶
Test status enum¶
Non-blocking communication requests¶
-
class irequest : public base_request<impl::base_irequest>¶
Represents a non-blocking communication request.
Public Functions
-
inline irequest(irequest &&other) noexcept¶
Move constructor.
- Parameters:
other – the request to move from
-
inline irequest &operator=(irequest &&other) noexcept¶
Move operator.
- Parameters:
other – the request to move from
- Returns:
reference to the moved-to request
-
inline void cancel()¶
Cancels the request if it is pending.
-
inline std::optional<status_t> test()¶
Tests for the completion.
- Returns:
the operation’s status if completed successfully
Friends
- friend class impl::request_pool< irequest >
-
inline irequest(irequest &&other) noexcept¶
-
class irequest_pool : public request_pool<irequest>¶
Container for managing a list of non-blocking communication requests.
Public Types
-
using size_type = std::vector<MPI_Request>::size_type¶
Type used in all index-based operations.
Public Functions
-
irequest_pool() = default¶
Constructs an empty pool of communication requests.
-
irequest_pool(const irequest_pool&) = delete¶
Deleted copy constructor.
-
inline irequest_pool(irequest_pool &&other) noexcept¶
Move constructor.
- Parameters:
other – the request pool to move from
-
void operator=(const irequest_pool&) = delete¶
Deleted copy operator.
-
inline irequest_pool &operator=(irequest_pool &&other) noexcept¶
Move operator.
- Parameters:
other – the request pool to move from
- Returns:
reference to the moved-to request pool
-
inline size_type size() const¶
Determine the size of request pool.
- Returns:
number of requests currently in request pool
-
inline bool empty() const¶
Determine if request pool is empty.
- Returns:
true if number of requests currently in request pool is non-zero
-
inline const status_t &get_status(size_type i) const¶
Get status of a request.
Status validity depends on the most recent completion call. In particular, a testall that returns false does not provide usable completion statuses, and the MPI error field is defined only for an MPI_ERR_IN_STATUS result.
- Parameters:
i – index of the request for which the status will be returned
- Returns:
status of request
-
inline void cancel(size_type i)¶
Cancels a pending request in the pool.
- Parameters:
i – index of the request for which shall be cancelled
-
inline void cancelall()¶
Cancels all requests in the pool, stopping at the first error.
-
inline status_t wait(size_type i)¶
Wait for completion of a single pending communication operation in the pool.
- Parameters:
i – index of the request to wait for
- Returns:
operation’s status after completion
-
inline std::optional<status_t> test(size_type i)¶
Tests for completion of a single pending communication operation in the pool.
- Parameters:
i – index of the request to test
- Returns:
the operation’s status if completed successfully
-
inline void push(irequest &&request)¶
Move a request into the request pool.
- Parameters:
request – request to move into the pool
-
inline std::pair<test_result, size_type> waitany()¶
Wait for completion of any pending communication operation.
- Returns:
pair containing the outcome of the wait operation and an index to the completed request if there was any pending request
-
inline std::pair<test_result, size_type> testany()¶
Test for completion of any pending communication operation.
- Returns:
pair containing the outcome of the test and an index to the completed request if there was any pending request
-
inline void store_some_statuses(const int return_code, const int count, const std::vector<int> &out_indices, const std::vector<status_t> &out_statuses)¶
-
inline void waitall()¶
Waits for completion of all pending requests.
-
inline bool testall()¶
Tests for completion of all pending requests.
- Returns:
true if all pending requests have completed
-
inline std::pair<test_result, std::vector<size_type>> waitsome()¶
Waits until one or more pending requests have finished.
- Returns:
pair containing the outcome of the wait operation and a list of indices to the completed requests if there was any pending request
-
inline std::pair<test_result, std::vector<size_type>> testsome()¶
Tests if one or more pending requests have finished.
- Returns:
pair containing the outcome of the test and a list of indices to the completed requests if there was any pending request
Public Static Functions
-
static inline void check_statuses(const int return_code, const S *statuses, const int n, const int *indices = nullptr)¶
-
using size_type = std::vector<MPI_Request>::size_type¶
Persistent communication requests¶
-
class prequest : public base_request<impl::base_prequest>¶
Represents a persistent communication request.
Public Functions
-
inline prequest(prequest &&other) noexcept¶
Move constructor.
- Parameters:
other – the request to move from
-
inline prequest &operator=(prequest &&other) noexcept¶
Move operator.
- Parameters:
other – the request to move from
- Returns:
reference to the moved-to request
-
inline void start()¶
Start communication operation.
-
inline void cancel()¶
Cancels the request if it is pending.
-
inline std::optional<status_t> test()¶
Tests for the completion.
- Returns:
the operation’s status if completed successfully
Friends
- friend class impl::request_pool< prequest >
-
inline prequest(prequest &&other) noexcept¶
-
class prequest_pool : public request_pool<prequest>¶
Container for managing a list of persisting communication requests.
Public Types
-
using size_type = typename base::size_type¶
Public Functions
-
prequest_pool() = default¶
Constructs an empty pool of persistent communication requests.
-
prequest_pool(const prequest_pool&) = delete¶
Deleted copy constructor.
-
inline prequest_pool(prequest_pool &&other) noexcept¶
Move constructor.
- Parameters:
other – the request pool to move from
-
void operator=(const prequest_pool&) = delete¶
Deleted copy constructor.
-
inline prequest_pool &operator=(prequest_pool &&other) noexcept¶
Move operator.
- Parameters:
other – the request pool to move from
-
inline void push(prequest &&request)¶
Move a persistent request into the request pool.
- Parameters:
request – request to move into the pool
-
inline void start(size_type i)¶
Start a single persistent request in the pool.
- Parameters:
i – index of the persistent request to start
-
inline void startall()¶
Start all persistent requests in the pool.
-
inline status_t wait(const size_type i)¶
Wait for completion of a single persistent communication operation.
- Parameters:
i – index of the request to wait for
- Returns:
operation’s status after completion
-
inline std::optional<status_t> test(const size_type i)¶
Test for completion of a single persistent communication operation.
- Parameters:
i – index of the request to test
- Returns:
the operation’s status if completed successfully
-
inline std::pair<test_result, size_type> waitany()¶
Wait for completion of any active persistent communication operation.
- Returns:
outcome and index of the completed request
-
inline std::pair<test_result, size_type> testany()¶
Test for completion of any active persistent communication operation.
- Returns:
outcome and index of the completed request
-
inline void waitall()¶
Wait for completion of all active persistent communication operations.
-
inline bool testall()¶
Test for completion of all active persistent communication operations.
- Returns:
true if all active requests have completed
-
inline std::pair<test_result, std::vector<size_type>> waitsome()¶
Wait until one or more active persistent requests have completed.
- Returns:
outcome and indices of the completed requests
-
inline std::pair<test_result, std::vector<size_type>> testsome()¶
Test whether one or more active persistent requests have completed.
- Returns:
outcome and indices of the completed requests
-
inline size_type size() const¶
Determine the size of request pool.
- Returns:
number of requests currently in request pool
-
inline bool empty() const¶
Determine if request pool is empty.
- Returns:
true if number of requests currently in request pool is non-zero
-
inline const status_t &get_status(size_type i) const¶
Get status of a request.
Status validity depends on the most recent completion call. In particular, a testall that returns false does not provide usable completion statuses, and the MPI error field is defined only for an MPI_ERR_IN_STATUS result.
- Parameters:
i – index of the request for which the status will be returned
- Returns:
status of request
-
inline void cancel(size_type i)¶
Cancels a pending request in the pool.
- Parameters:
i – index of the request for which shall be cancelled
-
inline void cancelall()¶
Cancels all requests in the pool, stopping at the first error.
Public Static Functions
-
static inline void check_statuses(const int return_code, const S *statuses, const int n, const int *indices = nullptr)¶
-
using size_type = typename base::size_type¶
Command-line arguments¶
-
class command_line : private std::vector<std::string>¶
Represents a set of command-line arguments.
See also
class
communicator::spawnPublic Functions
-
explicit command_line() = default¶
Constructs an empty set of command-line arguments.
-
inline command_line(std::initializer_list<std::string> init)¶
Constructs set of command-line arguments from a braces expression of strings.
- Parameters:
init – list of initial values
-
command_line(const command_line &other) = default¶
Constructs set of command-line arguments from another set.
- Parameters:
other – the other set to copy from
-
inline command_line(command_line &&other) noexcept¶
Move-constructs set of command-line arguments from another set.
- Parameters:
other – the other set to move from
-
explicit command_line() = default¶
-
class command_lines : private std::vector<command_line>¶
Represents a list of command-line argument sets.
See also
Public Functions
-
command_lines() = default¶
Constructs an empty list of command-line argument sets.
-
inline command_lines(std::initializer_list<command_line> init)¶
Constructs list of command-line argument sets from a braces expression of strings.
- Parameters:
init – list of initial values
-
command_lines(const command_lines &other) = default¶
Constructs list of command-line argument sets from another list.
- Parameters:
other – the other list to copy from
-
inline command_lines(command_lines &&other) noexcept¶
Move-constructs list of command-line argument sets from another list.
- Parameters:
other – the other list to move from
-
command_lines() = default¶