mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #4399 from akva2/fix_damaris
fix Damaris setup in Main
This commit is contained in:
commit
73968d9c6d
@ -218,14 +218,18 @@ void Main::setupVanguard()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if HAVE_DAMARIS
|
#if HAVE_DAMARIS
|
||||||
void Main::setupDamaris(const std::string& outputDir)
|
void Main::setupDamaris(const std::string& outputDir,
|
||||||
|
const bool enableDamarisOutputCollective)
|
||||||
{
|
{
|
||||||
|
if (!outputDir.empty()) {
|
||||||
|
ensureOutputDirExists(outputDir);
|
||||||
|
}
|
||||||
|
|
||||||
// By default EnableDamarisOutputCollective is true so all simulation results will
|
// By default EnableDamarisOutputCollective is true so all simulation results will
|
||||||
// be written into one single file for each iteration using Parallel HDF5.
|
// be written into one single file for each iteration using Parallel HDF5.
|
||||||
// It set to false, FilePerCore mode is used in Damaris, then simulation results in each
|
// It set to false, FilePerCore mode is used in Damaris, then simulation results in each
|
||||||
// node are aggregated by dedicated Damaris cores and stored to separate files per Damaris core.
|
// node are aggregated by dedicated Damaris cores and stored to separate files per Damaris core.
|
||||||
// Irrespective of mode, output is written asynchronously at the end of each timestep.
|
// Irrespective of mode, output is written asynchronously at the end of each timestep.
|
||||||
const bool enableDamarisOutputCollective = EWOMS_GET_PARAM(PreTypeTag, bool, EnableDamarisOutputCollective);
|
|
||||||
// Using the ModifyModel class to set the XML file for Damaris.
|
// Using the ModifyModel class to set the XML file for Damaris.
|
||||||
DamarisOutput::initializeDamaris(EclGenericVanguard::comm(), EclGenericVanguard::comm().rank(), outputDir, enableDamarisOutputCollective);
|
DamarisOutput::initializeDamaris(EclGenericVanguard::comm(), EclGenericVanguard::comm().rank(), outputDir, enableDamarisOutputCollective);
|
||||||
int is_client;
|
int is_client;
|
||||||
@ -235,8 +239,10 @@ void Main::setupDamaris(const std::string& outputDir)
|
|||||||
if (isSimulationRank_ && err == DAMARIS_OK) {
|
if (isSimulationRank_ && err == DAMARIS_OK) {
|
||||||
damaris_client_comm_get(&new_comm);
|
damaris_client_comm_get(&new_comm);
|
||||||
EclGenericVanguard::setCommunication(std::make_unique<Parallel::Communication>(new_comm));
|
EclGenericVanguard::setCommunication(std::make_unique<Parallel::Communication>(new_comm));
|
||||||
} else {
|
}
|
||||||
return false;
|
|
||||||
|
if (err != DAMARIS_OK) {
|
||||||
|
OPM_THROW(std::runtime_error, "Failed to configure Damaris: " + std::to_string(err));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -320,10 +320,8 @@ private:
|
|||||||
#if HAVE_DAMARIS
|
#if HAVE_DAMARIS
|
||||||
enableDamarisOutput_ = EWOMS_GET_PARAM(PreTypeTag, bool, EnableDamarisOutput);
|
enableDamarisOutput_ = EWOMS_GET_PARAM(PreTypeTag, bool, EnableDamarisOutput);
|
||||||
if (enableDamarisOutput_) {
|
if (enableDamarisOutput_) {
|
||||||
if (!outputDir.empty()) {
|
this->setupDamaris(outputDir,
|
||||||
ensureOutputDirExists(outputDir);
|
EWOMS_GET_PARAM(PreTypeTag, bool, EnableDamarisOutputCollective));
|
||||||
}
|
|
||||||
this->setupDamaris(outputDir);
|
|
||||||
}
|
}
|
||||||
#endif // HAVE_DAMARIS
|
#endif // HAVE_DAMARIS
|
||||||
|
|
||||||
@ -616,7 +614,8 @@ private:
|
|||||||
void setupVanguard();
|
void setupVanguard();
|
||||||
|
|
||||||
#if HAVE_DAMARIS
|
#if HAVE_DAMARIS
|
||||||
void setupDamaris(const std::string& outputDir);
|
void setupDamaris(const std::string& outputDir,
|
||||||
|
const bool enableDamarisOutputCollective);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int argc_{0};
|
int argc_{0};
|
||||||
|
Loading…
Reference in New Issue
Block a user