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
group
Public 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.
-
using mpl::message_t = MPI_Message¶
Status of a received message.
-
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 int get_count() const¶ - Template Parameters:
T – received data type
- Returns:
number of top level elements of type
T
received in associated message
-
template<typename T>
inline int 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
T
received in associated message
-
inline status_t()¶
default constructor initializes source and tag with wildcards given by
any_source
andtag_t::any
and 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<MPI_Aint>¶
Indicates the beginning of data buffers in various collective communication operations.
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<MPI_Aint> 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 const MPI_Aint *operator()() const¶
Get raw displacement data.
- Returns:
pointer to array of displacements
-
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 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
-
inline std::optional<status_t> test()
Tests for the completion.
- Returns:
the operation’s status if completed successfully
-
inline status_t wait()¶
Wait for a pending communication operation.
- Returns:
operation’s status after completion
-
inline status_t wait()
Wait for a pending communication operation.
- Returns:
operation’s status after completion
-
inline std::optional<status_t> get_status()¶
Access information associated with a request without freeing the request.
- Returns:
the operation’s status if completed successfully
-
inline std::optional<status_t> get_status()
Access information associated with a request without freeing the request.
- 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 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 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.
- Parameters:
i – index of the request for which the status will be returned
- Returns:
status of request
-
inline const status_t &get_status(size_type i) const
Get status of a request.
- 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 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.
-
inline void cancelall()
Cancels all requests in the pool.
-
inline void push(irequest &&request)¶
Move a request into the request pool.
- Parameters:
request – request to move into the pool
-
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> 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 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 waitall()¶
Waits for completion of all pending requests.
-
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 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>> 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
-
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
-
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 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
-
inline std::optional<status_t> test()
Tests for the completion.
- Returns:
the operation’s status if completed successfully
-
inline status_t wait()¶
Wait for a pending communication operation.
- Returns:
operation’s status after completion
-
inline status_t wait()
Wait for a pending communication operation.
- Returns:
operation’s status after completion
-
inline std::optional<status_t> get_status()¶
Access information associated with a request without freeing the request.
- Returns:
the operation’s status if completed successfully
-
inline std::optional<status_t> get_status()
Access information associated with a request without freeing the request.
- 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 = std::vector<MPI_Request>::size_type¶
Type used in all index-based operations.
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 startall()¶
Start all persistent requests in the pool.
-
inline size_type size() const¶
Determine the size of request pool.
- Returns:
number of requests currently in 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 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.
- Parameters:
i – index of the request for which the status will be returned
- Returns:
status of request
-
inline const status_t &get_status(size_type i) const
Get status of a request.
- 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 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.
-
inline void cancelall()
Cancels all requests in the pool.
-
inline void push(prequest &&request)¶
Move a request into the request pool.
- Parameters:
request – request to move into the pool
-
inline void push(prequest &&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> 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 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 waitall()¶
Waits for completion of all pending requests.
-
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 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>> 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
-
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
-
using size_type = std::vector<MPI_Request>::size_type¶
Command-line arguments¶
-
class command_line : private std::vector<std::string>¶
Represents a set of command-line arguments.
See also
class
communicator::spawn
Public 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
class
communicator::spawn_multiple
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¶