My Project
Loading...
Searching...
No Matches
DamarisKeywords.hpp
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
26#include <opm/simulators/utils/ParallelCommunication.hpp>
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{
55 bool enableDamarisOutputCollective_ = true;
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_;
61 std::string paraviewPythonFilename_;
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
69 int nDamarisNodes_ = 0;
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>
75 getKeywords(const Parallel::Communication& comm,
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
Collects necessary output values and pass them to Damaris server processes.
Below are the Damaris Keywords supported by Damaris to be filled in the built-in XML file.
Definition DamarisWriter.cpp:39
std::map< std::string, std::string > getDamarisKeywords(const Parallel::Communication &comm, const std::string &OutputDir)
Creates the map of search strings and repacement strings that will be used to modify a templated Dama...
Definition DamarisKeywords.cpp:261
bool FileExists(const std::string &filename_in, const Parallel::Communication &comm)
Returns true if the file exists.
Definition DamarisKeywords.cpp:52
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242
This file provides the infrastructure to retrieve run-time parameters.
Definition DamarisKeywords.hpp:54