Rename option to EnableDamarisOutputCollective.

This commit is contained in:
Atgeirr Flø Rasmussen
2022-10-10 14:28:09 +02:00
committed by Elyes Ahmed
parent 066897bbf9
commit c1b3c5e973
7 changed files with 28 additions and 30 deletions

View File

@@ -33,9 +33,9 @@
namespace Opm::DamarisOutput
{
std::map<std::string, std::string>
DamarisKeywords(std::string OutputDir, bool enableAsyncDamarisOutput)
DamarisKeywords(std::string OutputDir, bool enableDamarisOutputCollective)
{
if (enableAsyncDamarisOutput) {
if (enableDamarisOutputCollective) {
std::map<std::string, std::string> damaris_keywords = {
{"_SHMEM_BUFFER_BYTES_REGEX_", "536870912"},
{"_DC_REGEX_", "1"},

View File

@@ -26,7 +26,7 @@
/*
Below is the std::map with the keywords that are supported by Damaris.
Most entries in the map below are not critical ('static') and will not
Most entries in the map below are not critical ('static') and will not
be changed. We only allow changing FileMode together with output directory
*/
@@ -34,7 +34,7 @@
namespace Opm::DamarisOutput
{
std::map<std::string,std::string> DamarisKeywords(std::string OutputDir, bool enableAsyncDamarisOutput);
std::map<std::string,std::string> DamarisKeywords(std::string outputDir, bool enableDamarisOutputCollective);
} // namespace Opm::DamarisOutput

View File

@@ -33,14 +33,14 @@ std::string initDamarisXmlFile(); // Defined in initDamarisXMLFile.cpp, to avoid
void
initializeDamaris(MPI_Comm comm, int mpiRank, std::string outputDir, bool enableAsyncDamarisOutput)
initializeDamaris(MPI_Comm comm, int mpiRank, std::string outputDir, bool enableDamarisOutputCollective)
{
// Prepare the XML file
std::string damaris_config_xml = initDamarisXmlFile();
damaris::model::ModifyModel myMod = damaris::model::ModifyModel(damaris_config_xml);
// The map will make it precise the output directory and FileMode (either FilePerCore or Collective storage)
// The map file find all occurences of the string in position 1 and repalce it/them with string in position 2
std::map<std::string, std::string> find_replace_map = DamarisKeywords(outputDir, enableAsyncDamarisOutput);
std::map<std::string, std::string> find_replace_map = DamarisKeywords(outputDir, enableDamarisOutputCollective);
myMod.RepalceWithRegEx(find_replace_map);
std::string damaris_xml_filename_str = outputDir + "/damaris_config.xml";

View File

@@ -24,7 +24,7 @@
/*
Below is the XML file for Damaris that is supported by Damaris.
The entries in the map below will be filled by corresponding Damaris
The entries in the map below will be filled by corresponding Damaris
Keywords.
*/
@@ -34,7 +34,7 @@ namespace Opm::DamarisOutput
// Initialize an XML file
std::string initDamarisXmlFile();
// Initialize Damaris by filling in th XML file and stroring it in the chosed directory
void initializeDamaris(MPI_Comm comm, int mpiRank, std::string OutputDir, bool enableAsyncDamarisOutput);
void initializeDamaris(MPI_Comm comm, int mpiRank, std::string OutputDir, bool enableDamarisOutputCollective);
// Setup Damaris Parameters for writing e.g., grid size and communicator to output "PRESSURE" field
void setupDamarisWritingPars(Parallel::Communication comm, const int n_elements_local_grid);