37 using MessageTag = ReservoirCoupling::MessageTag;
40 const Parallel::Communication &comm,
45 bool activated() {
return this->numSlavesStarted() > 0; }
46 void addSlaveCommunicator(
MPI_Comm comm) {
47 this->master_slave_comm_.push_back(comm);
49 void addSlaveName(
const std::string &name) { this->slave_names_.push_back(name); }
50 void addSlaveNextReportTimeOffset(
double offset) {
51 this->slave_next_report_time_offsets_.push_back(offset);
53 void addSlaveStartDate(std::time_t
date) { this->slave_start_dates_.push_back(
date); }
54 double getActivationDate()
const {
return this->activation_date_; }
55 int getArgc()
const {
return this->argc_; }
56 char *getArgv(
int index)
const {
return this->argv_[index]; }
57 char **getArgv()
const {
return this->argv_; }
58 const Parallel::Communication &getComm()
const {
return this->comm_; }
59 double getSimulationStartDate()
const {
return this->schedule_.getStartTime(); }
60 MPI_Comm getSlaveComm(
int index)
const {
return this->master_slave_comm_[index]; }
61 const std::string &getSlaveName(
int index)
const {
return this->slave_names_[index]; }
62 const double *getSlaveStartDates() {
return this->slave_start_dates_.data(); }
64 void maybeSpawnSlaveProcesses(
int report_step);
65 std::size_t numSlavesStarted()
const;
66 void receiveNextReportDateFromSlaves();
67 void resizeSlaveStartDates(
int size) { this->slave_start_dates_.resize(size); }
68 void resizeNextReportDates(
int size) { this->slave_next_report_time_offsets_.resize(size); }
71 void setSlaveStartDate(
int index, std::time_t
date) { this->slave_start_dates_[index] =
date; }
72 void setSlaveNextReportTimeOffset(
int index,
double offset) {
73 this->slave_next_report_time_offsets_[index] = offset;
77 double getMasterActivationDate_()
const;
79 const Parallel::Communication &comm_;
84 std::vector<MPI_Comm> master_slave_comm_;
85 std::vector<std::string> slave_names_;
92 std::vector<double> slave_start_dates_;
94 std::vector<double> slave_next_report_time_offsets_;
95 double activation_date_{0.0};
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242