mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-22 15:33:29 -06:00
Move Hypre initialization and finalization out to Main
This commit is contained in:
parent
56897e6d11
commit
6fa9c25ba5
@ -35,6 +35,10 @@
|
||||
#include <opm/simulators/utils/DamarisOutputModule.hpp>
|
||||
#endif
|
||||
|
||||
#if HAVE_HYPRE
|
||||
#include <HYPRE_utilities.h>
|
||||
#endif
|
||||
|
||||
namespace Opm {
|
||||
|
||||
Main::Main(int argc, char** argv, bool ownMPI)
|
||||
@ -88,6 +92,10 @@ Main::~Main()
|
||||
}
|
||||
#endif // HAVE_MPI
|
||||
|
||||
#if HAVE_HYPRE
|
||||
HYPRE_Finalize();
|
||||
#endif
|
||||
|
||||
if (ownMPI_) {
|
||||
FlowGenericVanguard::setCommunication(nullptr);
|
||||
}
|
||||
@ -163,6 +171,10 @@ void Main::initMPI()
|
||||
#endif
|
||||
|
||||
#endif // HAVE_MPI
|
||||
|
||||
#if HAVE_HYPRE
|
||||
HYPRE_Initialize();
|
||||
#endif
|
||||
}
|
||||
|
||||
void Main::handleVersionCmdLine_(int argc, char** argv,
|
||||
|
@ -55,8 +55,6 @@ public:
|
||||
|
||||
use_gpu_ = prm_.get<bool>("use_gpu", false);
|
||||
|
||||
HYPRE_Initialize();
|
||||
|
||||
// Set memory location and execution policy
|
||||
if (use_gpu_) {
|
||||
HYPRE_SetMemoryLocation(HYPRE_MEMORY_DEVICE);
|
||||
@ -155,7 +153,6 @@ public:
|
||||
if (indices_device_) {
|
||||
hypre_TFree(indices_device_, HYPRE_MEMORY_DEVICE);
|
||||
}
|
||||
HYPRE_Finalize();
|
||||
}
|
||||
|
||||
void update() override {
|
||||
|
Loading…
Reference in New Issue
Block a user