mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #4889 from jcbowden/damariswriter-for-sim-fields-v5
Geometric mesh data added for Damaris in-situ visualisation
This commit is contained in:
@@ -235,23 +235,32 @@ void Main::setupVanguard()
|
||||
}
|
||||
|
||||
#if HAVE_DAMARIS
|
||||
void Main::setupDamaris(const std::string& outputDir,
|
||||
const bool enableDamarisOutputCollective)
|
||||
void Main::setupDamaris(const std::string& outputDir )
|
||||
{
|
||||
typedef Properties::TTag::FlowEarlyBird PreTypeTag;
|
||||
if (!outputDir.empty()) {
|
||||
ensureOutputDirExists(outputDir);
|
||||
}
|
||||
|
||||
//const auto find_replace_map;
|
||||
//const auto find_replace_map = Opm::DamarisOutput::DamarisKeywords<PreTypeTag>(EclGenericVanguard::comm(), outputDir);
|
||||
std::map<std::string, std::string> find_replace_map;
|
||||
find_replace_map = Opm::DamarisOutput::getDamarisKeywords<PreTypeTag>(EclGenericVanguard::comm(), outputDir);
|
||||
|
||||
// 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
|
||||
// If 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.
|
||||
// Irrespective of mode, output is written asynchronously at the end of each timestep.
|
||||
// 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(),
|
||||
find_replace_map);
|
||||
int is_client;
|
||||
MPI_Comm new_comm;
|
||||
int err = damaris_start(&is_client);
|
||||
// damaris_start() is where the Damaris Server ranks will block, until damaris_stop()
|
||||
// is called from the client ranks
|
||||
int err = damaris_start(&is_client);
|
||||
isSimulationRank_ = (is_client > 0);
|
||||
if (isSimulationRank_ && err == DAMARIS_OK) {
|
||||
damaris_client_comm_get(&new_comm);
|
||||
|
@@ -72,6 +72,10 @@
|
||||
#include <opm/simulators/utils/ParallelEclipseState.hpp>
|
||||
#endif
|
||||
|
||||
#if HAVE_DAMARIS
|
||||
#include <opm/simulators/utils/DamarisKeywords.hpp>
|
||||
#endif
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
@@ -323,9 +327,14 @@ private:
|
||||
deckFilename = EWOMS_GET_PARAM(PreTypeTag, std::string, EclDeckFileName);
|
||||
outputDir = EWOMS_GET_PARAM(PreTypeTag, std::string, OutputDir);
|
||||
}
|
||||
|
||||
if (outputDir.empty()) {
|
||||
outputDir = ".";
|
||||
}
|
||||
|
||||
#if HAVE_DAMARIS
|
||||
enableDamarisOutput_ = EWOMS_GET_PARAM(PreTypeTag, bool, EnableDamarisOutput);
|
||||
|
||||
// Reset to false as we cannot use Damaris if there is only one rank.
|
||||
if ((enableDamarisOutput_ == true) && (EclGenericVanguard::comm().size() == 1)) {
|
||||
std::string msg ;
|
||||
@@ -333,10 +342,9 @@ private:
|
||||
OpmLog::warning(msg);
|
||||
enableDamarisOutput_ = false ;
|
||||
}
|
||||
|
||||
|
||||
if (enableDamarisOutput_) {
|
||||
this->setupDamaris(outputDir,
|
||||
EWOMS_GET_PARAM(PreTypeTag, bool, EnableDamarisOutputCollective));
|
||||
this->setupDamaris(outputDir); // Damaris server ranks will block here until damaris_stop() is called by client ranks
|
||||
}
|
||||
#endif // HAVE_DAMARIS
|
||||
|
||||
@@ -706,8 +714,7 @@ private:
|
||||
}
|
||||
|
||||
#if HAVE_DAMARIS
|
||||
void setupDamaris(const std::string& outputDir,
|
||||
const bool enableDamarisOutputCollective);
|
||||
void setupDamaris(const std::string& outputDir);
|
||||
#endif
|
||||
|
||||
int argc_{0};
|
||||
|
Reference in New Issue
Block a user