Utility function to check if MPI was loaded

This commit is contained in:
Matthias Hochsteger 2024-05-14 22:17:42 +02:00
parent a80ae826c6
commit a018931437
2 changed files with 5 additions and 0 deletions

View File

@ -24,6 +24,7 @@ namespace py = pybind11;
namespace ngcore {
NGCORE_API bool MPI_Loaded();
NGCORE_API void InitMPI(
std::optional<std::filesystem::path> mpi_lib_path = std::nullopt);

View File

@ -28,6 +28,10 @@ struct MPIFinalizer {
}
} mpi_finalizer;
bool MPI_Loaded() {
return ng_mpi_lib != nullptr;
}
void InitMPI(std::optional<std::filesystem::path> mpi_lib_path) {
if (ng_mpi_lib) return;