diff --git a/runtime/copper_fcc_lattice.hpp b/runtime/copper_fcc_lattice.hpp index e1b063b542acfa44ee08dcbbf1d21e37febffed3..c883d6534d025e29605048d13a8b74d07c78293a 100644 --- a/runtime/copper_fcc_lattice.hpp +++ b/runtime/copper_fcc_lattice.hpp @@ -73,7 +73,7 @@ double copper_fcc_lattice(PairsSimulation *ps, int nx, int ny, int nz, double xp double ylo = 0.0, yhi = yprd; double zlo = 0.0, zhi = zprd; int natoms = 0; - int natoms_expected = 4 * nx * ny * nz; + //int natoms_expected = 4 * nx * ny * nz; double alat = pow((4.0 / rho), (1.0 / 3.0)); int ilo = (int) (xlo / (0.5 * alat) - 1); @@ -142,12 +142,6 @@ double copper_fcc_lattice(PairsSimulation *ps, int nx, int ny, int nz, double xp if(oy * subboxdim > jhi) { oy = 0; oz++; } } - if(natoms != natoms_expected) { - std::cerr << "copper_fcc_lattice(): incorrect number of atoms " - << "(" << natoms << " / " << natoms_expected << ")" << std::endl; - exit(-1); - } - return natoms; } diff --git a/runtime/pairs.hpp b/runtime/pairs.hpp index 74aa5ed3e750ca43d00a0648b02acd1d05c91e8d..aa6be15359801854adb0995ffb4d9e8460c56663 100644 --- a/runtime/pairs.hpp +++ b/runtime/pairs.hpp @@ -171,6 +171,11 @@ public: void fillCommunicationArrays(int neighbor_ranks[], int pbc[], real_t subdom[]); void sync() { device_synchronize(); } + void printTimers() { + if(this->getDomainPartitioner()->getRank() == 0) { + this->getTimers()->print(); + } + } }; template<typename T_ptr> diff --git a/runtime/thermo.hpp b/runtime/thermo.hpp index 7c999d612a7fa3e7fcf94a50937a285204172c15..8f00fd213e0d0156d5487cd97d4870ccd87ed912 100644 --- a/runtime/thermo.hpp +++ b/runtime/thermo.hpp @@ -15,7 +15,7 @@ double compute_thermo(PairsSimulation *ps, int nlocal, double xprd, double yprd, if(ps->getDomainPartitioner()->getWorldSize() > 1) { int global_natoms; - MPI_Reduce(&natoms, &global_natoms, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); + MPI_Allreduce(&natoms, &global_natoms, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); natoms = global_natoms; } @@ -37,7 +37,7 @@ double compute_thermo(PairsSimulation *ps, int nlocal, double xprd, double yprd, if(ps->getDomainPartitioner()->getWorldSize() > 1) { double global_t; - MPI_Reduce(&t, &global_t, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); + MPI_Allreduce(&t, &global_t, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); t = global_t; } @@ -66,7 +66,7 @@ void adjust_thermo(PairsSimulation *ps, int nlocal, double xprd, double yprd, do if(ps->getDomainPartitioner()->getWorldSize() > 1) { int global_natoms; - MPI_Reduce(&natoms, &global_natoms, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); + MPI_Allreduce(&natoms, &global_natoms, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); natoms = global_natoms; MPI_Allreduce(&vxtot, &tmp, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); vxtot = tmp / natoms; diff --git a/runtime/timing.hpp b/runtime/timing.hpp index 671a48b61294d2a4a8a2554ac201edbbeb98f94c..6c35e222e049fefd9aac991cf7e9e400ef3cc1ce 100644 --- a/runtime/timing.hpp +++ b/runtime/timing.hpp @@ -19,7 +19,7 @@ void stop_timer(PairsSimulation *ps, int id) { } void print_timers(PairsSimulation *ps) { - ps->getTimers()->print(); + ps->printTimers(); } }