Allow Python bindings to setup MPI

Allows the Python bindings to control whether MPI_Init() and
MPI_Finalize() will be called when creating an OPM::Main object.
This commit is contained in:
Håkon Hægland
2024-05-01 11:04:36 +02:00
parent 9529c18235
commit a1b7d4b5dd
9 changed files with 85 additions and 10 deletions

View File

@@ -62,6 +62,7 @@ public:
const std::string &idx_name,
py::array_t<double,
py::array::c_style | py::array::forcecast> array);
void setupMpi(bool init_mpi, bool finalize_mpi);
int step();
int stepCleanup();
int stepInit();
@@ -74,6 +75,8 @@ private:
const std::string deck_filename_;
bool has_run_init_ = false;
bool has_run_cleanup_ = false;
bool mpi_init_ = true;
bool mpi_finalize_ = true;
//bool debug_ = false;
// This *must* be declared before other pointers
// to simulator objects. This in order to deinitialize