Update 1 for code after code review of PR 4889

This commit is contained in:
Josh Bowden
2023-12-08 21:22:55 +01:00
parent 0f1d31c88a
commit 54d6db6f35
10 changed files with 476 additions and 457 deletions

View File

@@ -240,19 +240,25 @@ void Main::setupDamaris(const std::string& outputDir )
ensureOutputDirExists(outputDir);
}
std::map<std::string, std::string> find_replace_map ;
find_replace_map = Opm::DamarisOutput::DamarisKeywords<PreTypeTag>(EclGenericVanguard::comm(), 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(), find_replace_map);
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);

View File

@@ -344,7 +344,7 @@ private:
}
if (enableDamarisOutput_) {
this->setupDamaris(outputDir);
this->setupDamaris(outputDir); // Damaris server ranks will block here until damaris_stop() is called by client ranks
}
#endif // HAVE_DAMARIS