Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added Random slump parameter for tempering #434

Merged
merged 1 commit into from
Jun 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/move.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -725,11 +725,11 @@ void ParallelTempering::exchangeState(Change& change) {

void ParallelTempering::_move(Change& change) {
mpi.world.barrier(); // wait until all ranks reach here
if (!MPI::checkRandomEngineState(mpi.world, Move::slump)) {
if (!MPI::checkRandomEngineState(mpi.world, slump)) {
faunus_logger->error("Random numbers out of sync across MPI nodes. Do not use 'hardware' seed.");
mpi.world.abort(1); // neighbor search *requires* that random engines are in sync
}
partner->generate(mpi.world, Move::slump);
partner->generate(mpi.world, slump);
if (partner->rank.has_value()) {
exchangeState(change);
}
Expand Down
2 changes: 1 addition & 1 deletion src/move.h
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ class ParallelTempering : public Move {
std::unique_ptr<MPI::Partner> partner; //!< Policy for finding MPI partners
Geometry::VolumeMethod volume_scaling_method = Geometry::VolumeMethod::ISOTROPIC; //!< How to scale volumes
std::map<MPI::Partner::PartnerPair, Average<double>> acceptance_map; //!< Exchange statistics

Random slump; // static instance of Random (shared for all in ParallelTempering)
void _to_json(json& j) const override;
void _from_json(const json& j) override;
void _move(Change& change) override;
Expand Down