opm-simulators
Toggle main menu visibility
Loading...
Searching...
No Matches
ReservoirCouplingSpawnSlaves.hpp
1
/*
2
Copyright 2024 Equinor ASA
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_RESERVOIR_COUPLING_SPAWN_SLAVES_HPP
21
#define OPM_RESERVOIR_COUPLING_SPAWN_SLAVES_HPP
22
23
#include <opm/simulators/utils/ParallelCommunication.hpp>
24
#include <opm/simulators/flow/ReservoirCoupling.hpp>
25
#include <opm/simulators/flow/ReservoirCouplingMaster.hpp>
26
27
#include <opm/input/eclipse/Schedule/ResCoup/ReservoirCouplingInfo.hpp>
28
#include <opm/input/eclipse/Schedule/Schedule.hpp>
29
#include <opm/common/OpmLog/OpmLog.hpp>
30
31
#include <mpi.h>
32
33
#include <filesystem>
34
#include <vector>
35
36
namespace
Opm
{
37
38
class
ReservoirCouplingSpawnSlaves {
39
public
:
40
using
MessageTag = ReservoirCoupling::MessageTag;
41
42
ReservoirCouplingSpawnSlaves(
43
ReservoirCouplingMaster
&master,
44
const
ReservoirCoupling::CouplingInfo &rescoup
45
);
46
47
void
spawn();
48
49
private
:
50
void
createMasterGroupNameOrder_();
51
void
createMasterGroupToSlaveNameMap_();
52
std::pair<std::vector<char>, std::size_t>
53
getMasterGroupNamesForSlave_(
const
std::string &slave_name)
const
;
54
std::vector<char *> getSlaveArgv_(
55
const
std::filesystem::path &data_file,
56
const
std::string &slave_name,
57
std::string &log_filename)
const
;
58
void
prepareTimeStepping_();
59
void
receiveActivationDateFromSlaves_();
60
void
receiveSimulationStartDateFromSlaves_();
61
void
sendMasterGroupNamesToSlaves_();
62
void
sendSlaveNamesToSlaves_();
63
void
spawnSlaveProcesses_();
64
65
ReservoirCouplingMaster
&master_;
66
const
ReservoirCoupling::CouplingInfo &rescoup_;
67
const
Parallel::Communication &comm_;
68
ReservoirCoupling::Logger
logger_;
69
};
70
71
}
// namespace Opm
72
#endif
// OPM_RESERVOIR_COUPLING_SPAWN_SLAVES_HPP
Opm::ReservoirCouplingMaster
Definition
ReservoirCouplingMaster.hpp:35
Opm::ReservoirCoupling::Logger
Definition
ReservoirCoupling.hpp:35
Opm
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition
blackoilbioeffectsmodules.hh:43
opm
simulators
flow
ReservoirCouplingSpawnSlaves.hpp
Generated by
1.17.0