![]() |
KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
|
Holder for general data related to MPI (or suitable serial equivalents for non-MPI runs). More...
#include <parallel_environment.h>
Public Member Functions | |
| template<> | |
| void | RegisterFillCommunicatorFactoryDetail (std::function< FillCommunicator::Pointer(ModelPart &, const std::string &)> FillCommunicatorFactory) |
| template<> | |
| void | RegisterFillCommunicatorFactoryDetail (std::function< FillCommunicator::Pointer(ModelPart &, const DataCommunicator &)> FillCommunicatorFactory) |
| template<> | |
| void | RegisterCommunicatorFactoryDetail (std::function< Communicator::UniquePointer(ModelPart &, const std::string &)> CommunicatorFactory) |
| template<> | |
| void | RegisterCommunicatorFactoryDetail (std::function< Communicator::UniquePointer(ModelPart &, const DataCommunicator &)> CommunicatorFactory) |
Static Public Member Functions | |
Access | |
| static DataCommunicator & | GetDataCommunicator (const std::string &rName) |
| Retrieve a registered DataCommunicator instance. More... | |
| static DataCommunicator & | GetDefaultDataCommunicator () |
| Retrieve the default DataCommunicator instance. More... | |
| static void | SetDefaultDataCommunicator (const std::string &rName) |
| Set a new default DataCommunicator instance. More... | |
| static int | GetDefaultRank () |
| Get the rank of the current process, as given by the default DataCommunicator. More... | |
| static int | GetDefaultSize () |
| Get the MPI Comm size, as given by the default DataCommunicator. More... | |
| static std::string | RetrieveRegisteredName (const DataCommunicator &rComm) |
| Get the MPI Comm size, as given by the default DataCommunicator. More... | |
Operations | |
| static void | SetUpMPIEnvironment (EnvironmentManager::Pointer pEnvironmentManager) |
| template<class TDataCommunicatorInputType > | |
| static void | RegisterFillCommunicatorFactory (std::function< FillCommunicator::Pointer(ModelPart &, TDataCommunicatorInputType &)> FillCommunicatorFactory) |
| Registers the fill communicator factory This method takes the provided fill communicator pointer factory and saves it to be used later on. More... | |
| template<class TDataCommunicatorInputType > | |
| static void | RegisterCommunicatorFactory (std::function< Communicator::UniquePointer(ModelPart &, TDataCommunicatorInputType &)> CommunicatorFactory) |
| Registers the communicator factory This method takes the provided communicator pointer factory and saves it to be used later on. More... | |
| static FillCommunicator::Pointer | CreateFillCommunicator (ModelPart &rModelPart) |
| Create a fill communicator object This method uses the previously registered fill communicator factory for the creation of a new fill communicator pointer. More... | |
| static FillCommunicator::Pointer | CreateFillCommunicatorFromGlobalParallelism (ModelPart &rModelPart, const std::string &rDataCommunicatorName) |
| Create a fill communicator object This method uses the previously registered fill communicator factory for the creation of a new fill communicator pointer. More... | |
| static FillCommunicator::Pointer | CreateFillCommunicatorFromGlobalParallelism (ModelPart &rModelPart, const DataCommunicator &rDataCommunicator) |
| Create a fill communicator object This method uses the previously registered fill communicator factory for the creation of a new fill communicator pointer. More... | |
| static Communicator::UniquePointer | CreateCommunicatorFromGlobalParallelism (ModelPart &rModelPart, const std::string &rDataCommunicatorName) |
| Create a Communicator object This method uses the previously registered communicator factory for the creation of a new communicator pointer. More... | |
| static Communicator::UniquePointer | CreateCommunicatorFromGlobalParallelism (ModelPart &rModelPart, const DataCommunicator &rDataCommunicator) |
| Create a Communicator object This method uses the previously registered communicator factory for the creation of a new communicator pointer. More... | |
| static void | RegisterDataCommunicator (const std::string &rName, DataCommunicator::UniquePointer pPrototype, const bool Default=DoNotMakeDefault) |
| Add a new DataCommunicator instance to the ParallelEnvironment. More... | |
| static void | UnregisterDataCommunicator (const std::string &rName) |
| Remove a DataCommunicator instance from the ParallelEnvironment. More... | |
Inquiry | |
| static bool | HasDataCommunicator (const std::string &rName) |
| Check if a DataCommunicator is registered as rName. More... | |
| static std::string | GetDefaultDataCommunicatorName () |
| Get the registered name of the current default. More... | |
| static bool | MPIIsInitialized () |
| static bool | MPIIsFinalized () |
Input and output | |
| static std::string | Info () |
| Turn back information as a string. More... | |
| static void | PrintInfo (std::ostream &rOStream) |
| Print information about this object. More... | |
| static void | PrintData (std::ostream &rOStream) |
| Print object's data. More... | |
Static Public Attributes | |
Type Definitions | |
| constexpr static bool | MakeDefault = true |
| constexpr static bool | DoNotMakeDefault = false |
Holder for general data related to MPI (or suitable serial equivalents for non-MPI runs).
This class manages a registry of DataCommunicators, which can be used to perform MPI communication.
|
static |
Create a Communicator object This method uses the previously registered communicator factory for the creation of a new communicator pointer.
| rModelPart | Model part required to retrieve the variables list from it |
| rDataCommunicator | reference to the data communicator to be used for the communicator construction |
|
static |
Create a Communicator object This method uses the previously registered communicator factory for the creation of a new communicator pointer.
| rModelPart | Model part required to retrieve the variables list from it |
| rDataCommunicatorName | Name of the data communicator to be retrieved for the communicator construction |
|
static |
Create a fill communicator object This method uses the previously registered fill communicator factory for the creation of a new fill communicator pointer.
| rModelPart | Model part to which the fill communicator will be applied |
|
static |
Create a fill communicator object This method uses the previously registered fill communicator factory for the creation of a new fill communicator pointer.
| rModelPart | Model part to which the fill communicator will be applied |
| rDataCommunicator | reference to the data communicator to be used for the fill communicator construction |
|
static |
Create a fill communicator object This method uses the previously registered fill communicator factory for the creation of a new fill communicator pointer.
| rModelPart | Model part to which the fill communicator will be applied |
| rDataCommunicatorName | Name of the data communicator to be retrieved for the fill communicator construction |
|
static |
Retrieve a registered DataCommunicator instance.
| rName | The name used to register the string. |
|
static |
Retrieve the default DataCommunicator instance.
|
static |
Get the registered name of the current default.
This is a convenience function to help with temporarily changing the default DataCommunicator.
|
static |
Get the rank of the current process, as given by the default DataCommunicator.
|
static |
Get the MPI Comm size, as given by the default DataCommunicator.
|
static |
Check if a DataCommunicator is registered as rName.
|
static |
Turn back information as a string.
|
static |
|
static |
|
static |
Print object's data.
|
static |
Print information about this object.
|
static |
Registers the communicator factory This method takes the provided communicator pointer factory and saves it to be used later on.
| CommunicatorFactory | Factory function returning a pointer to a (parallel or serial) communicator |
| void Kratos::ParallelEnvironment::RegisterCommunicatorFactoryDetail | ( | std::function< Communicator::UniquePointer(ModelPart &, const DataCommunicator &)> | CommunicatorFactory | ) |
| void Kratos::ParallelEnvironment::RegisterCommunicatorFactoryDetail | ( | std::function< Communicator::UniquePointer(ModelPart &, const std::string &)> | CommunicatorFactory | ) |
|
static |
Add a new DataCommunicator instance to the ParallelEnvironment.
| rName | The name to be used to identify the DataCommunicator within ParallelEnvironment. |
| rPrototype | The DataCommunicator instance. |
| Default | If set to ParallelEnvironment::MakeDefault (a.k.a. true), the provided DataCommunicator will also be made default. |
|
static |
Registers the fill communicator factory This method takes the provided fill communicator pointer factory and saves it to be used later on.
| CommunicatorFactory | Factory function returning a pointer to a (parallel or serial) fill communicator |
| void Kratos::ParallelEnvironment::RegisterFillCommunicatorFactoryDetail | ( | std::function< FillCommunicator::Pointer(ModelPart &, const DataCommunicator &)> | FillCommunicatorFactory | ) |
| void Kratos::ParallelEnvironment::RegisterFillCommunicatorFactoryDetail | ( | std::function< FillCommunicator::Pointer(ModelPart &, const std::string &)> | FillCommunicatorFactory | ) |
|
static |
Get the MPI Comm size, as given by the default DataCommunicator.
|
static |
Set a new default DataCommunicator instance.
| rName | The name the new default DataCommunicator was registered with. |
|
static |
|
static |
Remove a DataCommunicator instance from the ParallelEnvironment.
| rName | The name used to register the DataCommunicator within ParallelEnvironment. |
|
staticconstexpr |
|
staticconstexpr |