mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Update for support of Damaris mesh based in situ processing
Moved damaris command line parameter accessors to Main.cpp and fixed support for both Python and Paraview Python scripts, as they both cannot be present in the same simulation (seems to be an initialization conflict or double initialization)
This commit is contained in:
@@ -233,12 +233,48 @@ void Main::setupVanguard()
|
||||
}
|
||||
|
||||
#if HAVE_DAMARIS
|
||||
void Main::setupDamaris(const std::string& outputDir , std::map<std::string, std::string>& find_replace_map)
|
||||
void Main::setupDamaris(const std::string& outputDir )
|
||||
{
|
||||
typedef Properties::TTag::FlowEarlyBird PreTypeTag;
|
||||
if (!outputDir.empty()) {
|
||||
ensureOutputDirExists(outputDir);
|
||||
}
|
||||
|
||||
bool enableDamarisOutputCollective = true ;
|
||||
bool saveToDamarisHDF5 = true ;
|
||||
std::string damarisPythonFilename = "" ;
|
||||
std::string damarisPythonParaviewFilename = "" ;
|
||||
|
||||
std::string damarisSimName = "" ; // empty defaults to opm-sim-<magic_number>
|
||||
std::string damarisLogLevel = "info" ;
|
||||
int nDamarisCores = 1 ;
|
||||
int nDamarisNodes = 0 ;
|
||||
long shmemSizeBytes = 536870912 ;
|
||||
|
||||
enableDamarisOutputCollective = EWOMS_GET_PARAM(PreTypeTag, bool, EnableDamarisOutputCollective) ;
|
||||
saveToDamarisHDF5 = EWOMS_GET_PARAM(PreTypeTag, bool, DamarisSaveToHdf);
|
||||
damarisPythonFilename = EWOMS_GET_PARAM(PreTypeTag, std::string, DamarisPythonScript);
|
||||
damarisPythonParaviewFilename = EWOMS_GET_PARAM(PreTypeTag, std::string, DamarisPythonParaviewScript);
|
||||
damarisSimName = EWOMS_GET_PARAM(PreTypeTag, std::string, DamarisSimName);
|
||||
nDamarisCores = EWOMS_GET_PARAM(PreTypeTag, int, DamarisDedicatedCores);
|
||||
nDamarisNodes = EWOMS_GET_PARAM(PreTypeTag, int, DamarisDedicatedNodes);
|
||||
shmemSizeBytes = EWOMS_GET_PARAM(PreTypeTag, long, DamarisSharedMemeorySizeBytes);
|
||||
damarisLogLevel = EWOMS_GET_PARAM(PreTypeTag, std::string, DamarisLogLevel);
|
||||
|
||||
std::map<std::string, std::string> find_replace_map ;
|
||||
find_replace_map = Opm::DamarisOutput::DamarisKeywords(EclGenericVanguard::comm(),
|
||||
outputDir,
|
||||
enableDamarisOutputCollective,
|
||||
saveToDamarisHDF5,
|
||||
nDamarisCores,
|
||||
nDamarisNodes,
|
||||
shmemSizeBytes,
|
||||
damarisPythonFilename,
|
||||
damarisSimName,
|
||||
damarisLogLevel,
|
||||
damarisPythonParaviewFilename
|
||||
);
|
||||
|
||||
// By default EnableDamarisOutputCollective is true so all simulation results will
|
||||
// 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
|
||||
|
@@ -342,34 +342,9 @@ private:
|
||||
OpmLog::warning(msg);
|
||||
enableDamarisOutput_ = false ;
|
||||
}
|
||||
|
||||
|
||||
if (enableDamarisOutput_) {
|
||||
enableDamarisOutputCollective_ = EWOMS_GET_PARAM(PreTypeTag, bool, EnableDamarisOutputCollective) ;
|
||||
saveToDamarisHDF5_ = EWOMS_GET_PARAM(PreTypeTag, bool, DamarisSaveToHdf);
|
||||
damarisPythonFilename_ = EWOMS_GET_PARAM(PreTypeTag, std::string, DamarisPythonScript);
|
||||
damarisPythonParaviewFilename_ = EWOMS_GET_PARAM(PreTypeTag, std::string, DamarisPythonParaviewScript);
|
||||
damarisSimName_ = EWOMS_GET_PARAM(PreTypeTag, std::string, DamarisSimName);
|
||||
|
||||
nDamarisCores_ = EWOMS_GET_PARAM(PreTypeTag, int, DamarisDedicatedCores);
|
||||
nDamarisNodes_ = EWOMS_GET_PARAM(PreTypeTag, int, DamarisDedicatedNodes);
|
||||
shmemSizeBytes_ = EWOMS_GET_PARAM(PreTypeTag, long, DamarisSharedMemeorySizeBytes);
|
||||
|
||||
damarisLogLevel_ = EWOMS_GET_PARAM(PreTypeTag, std::string, DamarisLogLevel);
|
||||
|
||||
std::map<std::string, std::string> find_replace_map ;
|
||||
find_replace_map = Opm::DamarisOutput::DamarisKeywords(EclGenericVanguard::comm(),
|
||||
outputDir,
|
||||
enableDamarisOutputCollective_,
|
||||
saveToDamarisHDF5_,
|
||||
nDamarisCores_,
|
||||
nDamarisNodes_,
|
||||
shmemSizeBytes_,
|
||||
damarisPythonFilename_,
|
||||
damarisSimName_,
|
||||
damarisLogLevel_,
|
||||
damarisPythonParaviewFilename_
|
||||
);
|
||||
this->setupDamaris(outputDir, find_replace_map);
|
||||
this->setupDamaris(outputDir);
|
||||
}
|
||||
#endif // HAVE_DAMARIS
|
||||
|
||||
@@ -737,8 +712,7 @@ private:
|
||||
}
|
||||
|
||||
#if HAVE_DAMARIS
|
||||
void setupDamaris(const std::string& outputDir,
|
||||
std::map<std::string, std::string>& find_replace_map);
|
||||
void setupDamaris(const std::string& outputDir);
|
||||
#endif
|
||||
|
||||
int argc_{0};
|
||||
@@ -763,16 +737,6 @@ private:
|
||||
bool isSimulationRank_ = true;
|
||||
#if HAVE_DAMARIS
|
||||
bool enableDamarisOutput_ = false;
|
||||
bool enableDamarisOutputCollective_ = true ;
|
||||
bool saveToDamarisHDF5_ = true ;
|
||||
std::string damarisPythonFilename_ = "" ;
|
||||
std::string damarisPythonParaviewFilename_ = "" ;
|
||||
|
||||
std::string damarisSimName_ = "" ; // empty defaults to opm-sim-<magic_number>
|
||||
std::string damarisLogLevel_ = "info" ;
|
||||
int nDamarisCores_ = 1 ;
|
||||
int nDamarisNodes_ = 0 ;
|
||||
long shmemSizeBytes_ = 536870912 ;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user