atlas::mpi::Scope struct

RAII helper class to manage MPI communicator scopes. The constructor pushes a new scope, and the destructor pops the scope, ensuring that the previous default communicator is restored even in case of exceptions.

Constructors, destructors, conversion operators

Scope()
Scope(std::string_view name)
Scope(const Comm& comm)
Scope(int communicator)
Constructor using integer value. If the given communicator is not already registered, it will be registered with a generated name "int.<communicator>" for the duration of the scope, and unregistered when the scope is destructed.
Scope(const Scope&) deleted
Scope(Scope&&) deleted
~Scope()

Public functions

auto operator=(const Scope&) -> Scope& deleted
auto operator=(Scope&&) -> Scope& deleted

Function documentation

atlas::mpi::Scope::Scope(int communicator)

Constructor using integer value. If the given communicator is not already registered, it will be registered with a generated name "int.<communicator>" for the duration of the scope, and unregistered when the scope is destructed.

Parameters
communicator The integer value of the MPI communicator to use for the scope