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

Refactor thermostat infrastructure #3888

Merged
merged 22 commits into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9f9fc26
utils: Fixed parameter type for uint64_t u32_to_u64
fweik Mar 17, 2020
f956bac
core: Use seed+salt in key of Philox
fweik Mar 17, 2020
ea031c6
core: Use Philox infrastructure for SD thermostat
jngrad Sep 1, 2020
4af67b4
docs: Document unified thermostat infrastructure
jngrad Sep 1, 2020
0c9a9b1
core: Make statistical unit tests faster
jngrad Sep 3, 2020
69c999a
core: Make statistical unit tests faster
jngrad Sep 3, 2020
0c97c61
core: Break integrator/thermostat cyclic dependency
jngrad Sep 4, 2020
fc7d191
core: Cleanup code
jngrad Sep 4, 2020
ae13462
core: Move NpT functions to dedicated file
jngrad Sep 4, 2020
dbe96b0
core: Split thermostats from integrators
jngrad Sep 4, 2020
c475c38
core: Header cleanup
jngrad Sep 4, 2020
5428fca
core: Remove redundant thermostat free functions
jngrad Sep 8, 2020
df90e9c
tests: Improve interaction checkpointing tests
jngrad Sep 10, 2020
9c454a6
python: Pickle counter without altering params
jngrad Sep 16, 2020
cc2e0df
docs: Update thermostat counter/seed explanation
jngrad Sep 16, 2020
6073521
core: Use boost::mpi
jngrad Sep 16, 2020
2366434
Merge branch 'python' into thermostats-correlation
jngrad Sep 16, 2020
11b9b0b
core: Remove unused NpT parameter
jngrad Sep 16, 2020
d21c7a4
core: Move NpT communication to npt.cpp
jngrad Sep 16, 2020
5d6e1d3
core: Guard NpT callback
jngrad Sep 16, 2020
8d28cfa
tests: Remove calls to private methods
jngrad Sep 18, 2020
3323d57
Merge branch 'python' into thermostats-correlation
kodiakhq[bot] Sep 18, 2020
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
Prev Previous commit
Next Next commit
core: Move NpT communication to npt.cpp
  • Loading branch information
jngrad committed Sep 16, 2020
commit d21c7a4e35eb7ca6dce7c7ca44930916ffe14fb0
13 changes: 3 additions & 10 deletions src/core/communication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ int n_nodes = -1;
CB(mpi_bcast_coulomb_params_slave) \
CB(mpi_remove_particle_slave) \
CB(mpi_rescale_particles_slave) \
CB(mpi_bcast_nptiso_geom_slave) \
CB(mpi_bcast_nptiso_geom_worker) \
CB(mpi_bcast_steepest_descent_worker) \
CB(mpi_bcast_cuda_global_part_vars_slave) \
CB(mpi_resort_particles_slave) \
Expand Down Expand Up @@ -497,15 +497,8 @@ void mpi_set_use_verlet_lists(bool use_verlet_lists) {
/*************** BCAST NPTISO GEOM *****************/

void mpi_bcast_nptiso_geom() {
mpi_call(mpi_bcast_nptiso_geom_slave, -1, 0);
mpi_bcast_nptiso_geom_slave(-1, 0);
}

void mpi_bcast_nptiso_geom_slave(int, int) {
MPI_Bcast(&nptiso.geometry, 1, MPI_INT, 0, comm_cart);
MPI_Bcast(&nptiso.dimension, 1, MPI_INT, 0, comm_cart);
MPI_Bcast(&nptiso.cubic_box, 1, MPI_LOGICAL, 0, comm_cart);
MPI_Bcast(&nptiso.non_const_dim, 1, MPI_INT, 0, comm_cart);
mpi_call(mpi_bcast_nptiso_geom_worker, -1, 0);
mpi_bcast_nptiso_geom_worker(-1, 0);
}

/*************** BCAST STEEPEST DESCENT *****************/
Expand Down
18 changes: 15 additions & 3 deletions src/core/npt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,21 @@
#include "errorhandling.hpp"
#include "integrate.hpp"

#include <boost/mpi/collectives/broadcast.hpp>
#include <boost/mpi/operations.hpp>

#ifdef NPT
void synchronize_npt_state() {
MPI_Bcast(&nptiso.p_inst, 1, MPI_DOUBLE, 0, comm_cart);
MPI_Bcast(&nptiso.p_diff, 1, MPI_DOUBLE, 0, comm_cart);
MPI_Bcast(&nptiso.volume, 1, MPI_DOUBLE, 0, comm_cart);
boost::mpi::broadcast(comm_cart, nptiso.p_inst, 0);
boost::mpi::broadcast(comm_cart, nptiso.p_diff, 0);
boost::mpi::broadcast(comm_cart, nptiso.volume, 0);
}

void mpi_bcast_nptiso_geom_worker(int, int) {
boost::mpi::broadcast(comm_cart, nptiso.geometry, 0);
boost::mpi::broadcast(comm_cart, nptiso.dimension, 0);
boost::mpi::broadcast(comm_cart, nptiso.cubic_box, 0);
boost::mpi::broadcast(comm_cart, nptiso.non_const_dim, 0);
}

void npt_ensemble_init(const BoxGeometry &box) {
Expand Down Expand Up @@ -71,4 +81,6 @@ void npt_add_virial_contribution(const Utils::Vector3d &force,
}
}
}
#else // NPT
void mpi_bcast_nptiso_geom_worker(int, int) {}
#endif // NPT
1 change: 1 addition & 0 deletions src/core/npt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ extern nptiso_struct nptiso;
/** @brief Synchronizes NpT state such as instantaneous and average pressure
*/
void synchronize_npt_state();
void mpi_bcast_nptiso_geom_worker(int, int);
void npt_ensemble_init(const BoxGeometry &box);
void integrator_npt_sanity_checks();
void npt_reset_instantaneous_virials();
Expand Down