DamarisKeywords.hpp
Go to the documentation of this file.
1/*
2 Copyright 2021 Equinor.
3
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef OPM_DAMARISKEYWORDS_HEADER_INCLUDED
21#define OPM_DAMARISKEYWORDS_HEADER_INCLUDED
22
24
27
28#include <map>
29#include <string>
30#include <sstream>
31#include <algorithm>
32#include <unordered_set>
33
34/*
35 Below is the std::map with the keywords that are supported by Damaris.
36
37 Most entries in the map below are not critical ('static') and will not
38 be changed. We only allow changing FileMode together with output directory
39*/
40
41namespace Opm::DamarisOutput {
42
50bool FileExists(const std::string& filename_in,
51 const Parallel::Communication& comm);
52
54{
56 bool saveToDamarisHDF5_ = true;
57 // if saveMeshToDamarisHDF5 is true, requires enableDamarisOutputCollective to be false
58 // (until offsets are are added to mesh data for collective writing)
59 bool saveMeshToHDF5_ = false;
60 std::string pythonFilename_;
62
63 std::string damarisSimName_; // empty and set to "opm-flow-<random-number>" if none provided on command line. Used as prefix to HDF5 filenames
64 std::string shmemName_; // empty and needs to be unique if multiple simulations are running on the same server/node. Used to name the Damaris shared memory region.
65 std::string damarisLogLevel_ = "info";
66 std::string damarisDaskFile_ = "";
67 // std::string damarisLimitVars_ = "";
68 int nDamarisCores_ = 1; // this is the number of (Damaris server) cores per node
70 long shmemSizeBytes_ = 536870912; // 512 MB
71
72 std::string rand_value_str_ ; // to be added to sheared memory name to make unique
73
74 std::map<std::string, std::string>
76 const std::string& OutputDir);
77
78 void SetRandString(void); // sets the value of rand_value_str_
79};
80
91std::map<std::string, std::string>
92getDamarisKeywords(const Parallel::Communication& comm, const std::string& OutputDir);
93
94std::unordered_set<std::string> getSetOfIncludedVariables();
95
96} // namespace Opm::DamarisOutput
97
98
99#endif
Definition: DamarisWriter.hpp:60
std::map< std::string, std::string > getDamarisKeywords(const Parallel::Communication &comm, const std::string &OutputDir)
std::unordered_set< std::string > getSetOfIncludedVariables()
bool FileExists(const std::string &filename_in, const Parallel::Communication &comm)
Dune::Communication< MPIComm > Communication
Definition: ParallelCommunication.hpp:30
This file provides the infrastructure to retrieve run-time parameters.
Definition: DamarisKeywords.hpp:54
bool saveMeshToHDF5_
Definition: DamarisKeywords.hpp:59
std::string paraviewPythonFilename_
Definition: DamarisKeywords.hpp:61
std::string shmemName_
Definition: DamarisKeywords.hpp:64
long shmemSizeBytes_
Definition: DamarisKeywords.hpp:70
std::string rand_value_str_
Definition: DamarisKeywords.hpp:72
int nDamarisNodes_
Definition: DamarisKeywords.hpp:69
std::string damarisSimName_
Definition: DamarisKeywords.hpp:63
std::string damarisDaskFile_
Definition: DamarisKeywords.hpp:66
std::map< std::string, std::string > getKeywords(const Parallel::Communication &comm, const std::string &OutputDir)
std::string pythonFilename_
Definition: DamarisKeywords.hpp:60
bool enableDamarisOutputCollective_
Definition: DamarisKeywords.hpp:55
int nDamarisCores_
Definition: DamarisKeywords.hpp:68
std::string damarisLogLevel_
Definition: DamarisKeywords.hpp:65
bool saveToDamarisHDF5_
Definition: DamarisKeywords.hpp:56