Info objects#

Overview#

Info objects store key-value pairs of string type. The semantics of these key-value pairs is defined by the MPI standard and by the employed MPI implementation. See the MPI standard and the documentation of your MPI implementation for details. Info objects are used by some MPL to pass the key-value pairs to the underlying MPI implementation to improve performance or resource utilization.

Class documentation#

class info#

Stores key-value pairs to affect specific as well as implementation defined MPI functionalities.

Public Functions

info() = default#

Creates a new info object with no key-value pairs attached.

inline info(const info &other)#

Copy-constructs a new info object.

Parameters:

other – the other info object to copy from

inline info(info &&other) noexcept#

Move-constructs a new info object.

Parameters:

other – the other info object to move from

inline info &operator()(const info &other)#

Copies an info object.

Parameters:

other – the other info object to copy from

inline info &operator()(info &&other) noexcept#

Moves an info object.

Parameters:

other – the other info object to move from

inline ~info()#

Destructor.

inline void set(const std::string &key, const std::string &value)#

Stores a key-value pair.

Parameters:
  • key – the key

  • value – the value

inline void remove(const std::string &key)#

Removes a key-value pair with the the given key.

Parameters:

key – the key

inline std::optional<std::string> value(const std::string &key) const#

Retrieves the value for a given key.

Parameters:

key – the key

Returns:

the value if the info object contains a key-value pair with the given key.

inline int size() const#

Gets the number of key-value pairs.

Returns:

number of key-value pairs in the info object

inline std::string key(int n) const#

Gets the nth key.

Parameters:

n – index, must be non-negative but less than size()

Returns:

the nth key in the info object

Friends

friend class impl::base_communicator
friend class communicator
friend class file
class infos : private std::vector<info>#

See also

class communicator::spawn_multiple

Public Functions

inline explicit infos()#

Constructs an empty list of info objects.

inline infos(std::initializer_list<info> init)#

Constructs list of info objects from a braces expression of info objects.

Parameters:

init – list of initial values

infos(const infos &other) = default#

Constructs list of info objects from another set.

Parameters:

other – the other list to copy from

inline infos(infos &&other) noexcept#

Move-constructs list of info objects from another list.

Parameters:

other – the other list to move from