Container for all parallel communication domains.
More...
#include <para_collection.h>
|
| | ParaCollection ()=default |
| void | add (std::unique_ptr< ParaWorld > world) |
| | Append a domain to the collection.
|
| const ParaWorld & | find (const std::string &tag) const |
| | Look up a domain by tag.
|
| template<typename T> |
| const T * | find_as (const std::string &tag) const |
| | Look up a domain by tag and cast to the requested subclass.
|
| size_t | size () const |
| | Number of domains in the collection.
|
Container for all parallel communication domains.
A ParaCollection owns a set of ParaWorld objects (base class pointers), each describing one communication domain (see ParaTag). Callers look up domains by tag via find(); a missing tag yields a static empty (invalid) domain as a safe degradation, never an exception.
The collection is passed explicitly to functions that need communicator access, replacing reads of loose globals such as GlobalV::POOL_WORLD.
◆ ParaCollection()
| Parallel::ParaCollection::ParaCollection |
( |
| ) |
|
|
default |
◆ add()
| void Parallel::ParaCollection::add |
( |
std::unique_ptr< ParaWorld > | world | ) |
|
Append a domain to the collection.
Duplicate tags are rejected (the existing entry is kept).
- Parameters
-
| [in] | world | domain to add (ownership transferred) |
◆ find()
| const ParaWorld & Parallel::ParaCollection::find |
( |
const std::string & | tag | ) |
const |
Look up a domain by tag.
- Parameters
-
- Returns
- the matching ParaWorld, or a static empty domain if not found
◆ find_as()
| const T * Parallel::ParaCollection::find_as |
( |
const std::string & | tag | ) |
const |
Look up a domain by tag and cast to the requested subclass.
- Template Parameters
-
- Parameters
-
- Returns
- pointer to the domain if found and type matches, nullptr otherwise
◆ size()
| size_t Parallel::ParaCollection::size |
( |
| ) |
const |
|
inline |
Number of domains in the collection.
◆ worlds_
| std::vector<std::unique_ptr<ParaWorld> > Parallel::ParaCollection::worlds_ |
|
private |
The documentation for this class was generated from the following files:
- /home/runner/work/abacus-develop/abacus-develop/source/source_base/module_parallel/para_collection.h
- /home/runner/work/abacus-develop/abacus-develop/source/source_base/module_parallel/para_collection.cpp