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 <tuple>
31#include <unordered_set>
32
33/*
34 Below is the std::map with the keywords that are supported by Damaris.
35
36 Most entries in the map below are not critical ('static') and will not
37 be changed. We only allow changing FileMode together with output directory
38*/
39
40namespace Opm::DamarisOutput {
41
49bool FileExists(const std::string& filename_in,
50 const Parallel::Communication& comm);
51
53{
55 bool saveToDamarisHDF5_ = true;
56 // if saveMeshToDamarisHDF5 is true, requires enableDamarisOutputCollective to be false
57 // (until offsets are are added to mesh data for collective writing)
58 bool saveMeshToHDF5_ = false;
59 std::string pythonFilename_;
61
62 std::string damarisSimName_; // empty and set to "opm-flow-<random-number>" if none provided on command line. Used as prefix to HDF5 filenames
63 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.
64 std::string damarisLogLevel_ = "info";
65 std::string damarisDaskFile_ = "";
66 // std::string damarisLimitVars_ = "";
67 int nDamarisCores_ = 1; // this is the number of (Damaris server) cores per node
69 long shmemSizeBytes_ = 536870912; // 512 MB
70
71 std::string rand_value_str_ ; // to be added to sheared memory name to make unique
72
73 std::map<std::string, std::string>
75 const std::string& OutputDir);
76
77private:
78 void SetRandString(); // sets the value of rand_value_str_
79
80 struct StartEnd
81 {
82 std::string start;
83 std::string end;
84 };
85
86 std::tuple<StartEnd, StartEnd, std::string>
87 checkFiles(const Parallel::Communication& comm);
88};
89
100std::map<std::string, std::string>
101getDamarisKeywords(const Parallel::Communication& comm, const std::string& OutputDir);
102
103std::unordered_set<std::string> getSetOfIncludedVariables();
104
105} // namespace Opm::DamarisOutput
106
107
108#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:53
bool saveMeshToHDF5_
Definition: DamarisKeywords.hpp:58
std::string paraviewPythonFilename_
Definition: DamarisKeywords.hpp:60
std::string shmemName_
Definition: DamarisKeywords.hpp:63
long shmemSizeBytes_
Definition: DamarisKeywords.hpp:69
std::string rand_value_str_
Definition: DamarisKeywords.hpp:71
int nDamarisNodes_
Definition: DamarisKeywords.hpp:68
std::string damarisSimName_
Definition: DamarisKeywords.hpp:62
std::string damarisDaskFile_
Definition: DamarisKeywords.hpp:65
std::map< std::string, std::string > getKeywords(const Parallel::Communication &comm, const std::string &OutputDir)
std::string pythonFilename_
Definition: DamarisKeywords.hpp:59
bool enableDamarisOutputCollective_
Definition: DamarisKeywords.hpp:54
int nDamarisCores_
Definition: DamarisKeywords.hpp:67
std::string damarisLogLevel_
Definition: DamarisKeywords.hpp:64
bool saveToDamarisHDF5_
Definition: DamarisKeywords.hpp:55