Skip to content

Commit

Permalink
Control::syncROMOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamer2368 committed Apr 19, 2024
1 parent 7c531d8 commit 1b40a1d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/Control.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2067,5 +2067,30 @@ void Control::setROMOptions(const boost::program_options::variables_map& vm)
} // onpe0

// synchronize all processors
sync();
syncROMOptions();
}

void Control::syncROMOptions()
{
if (onpe0 && verbose > 0)
(*MPIdata::sout) << "Control::syncROMOptions()" << std::endl;

MGmol_MPI& mmpi = *(MGmol_MPI::instance());

mmpi.bcast(rom_pri_option.restart_filename, comm_global_);

auto bcast_check = [](int mpirc) {
if (mpirc != MPI_SUCCESS)
{
(*MPIdata::sout) << "MPI Bcast of Control failed!!!" << std::endl;
MPI_Abort(comm_global_, 2);
}
};

short rom_stage = (short)static_cast<int>(rom_pri_option.rom_stage);
int mpirc;
mpirc = MPI_Bcast(&rom_stage, 1, MPI_SHORT, 0, comm_global_);
bcast_check(mpirc);

rom_pri_option.rom_stage = static_cast<ROMStage>(rom_stage);
}
1 change: 1 addition & 0 deletions src/Control.h
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@ class Control
bool rom_online;
bool rom_restore;
void setROMOptions(const boost::program_options::variables_map& vm);
void syncROMOptions();
const ROMPrivateOptions getROMOptions() { return rom_pri_option; }
};

Expand Down

0 comments on commit 1b40a1d

Please sign in to comment.