--- trunk/src/constraints/ZconstraintForceManager.cpp 2012/09/10 18:38:44 1796 +++ trunk/src/constraints/ZconstraintForceManager.cpp 2014/02/26 14:14:50 1969 @@ -35,20 +35,20 @@ * * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). - * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). + * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ +#ifdef IS_MPI +#include +#endif #include #include "constraints/ZconstraintForceManager.hpp" #include "integrators/Integrator.hpp" #include "utils/simError.h" #include "utils/PhysicalConstants.hpp" #include "utils/StringUtils.hpp" -#ifdef IS_MPI -#include -#endif namespace OpenMD { ZconstraintForceManager::ZconstraintForceManager(SimInfo* info): ForceManager(info), infiniteTime(1e31) { @@ -161,8 +161,8 @@ namespace OpenMD { #ifndef IS_MPI totMassUnconsMols_ = totMassUnconsMols_local; #else - MPI::COMM_WORLD.Allreduce(&totMassUnconsMols_local, &totMassUnconsMols_, 1, - MPI::REALTYPE, MPI::SUM); + MPI_Allreduce(&totMassUnconsMols_local, &totMassUnconsMols_, 1, + MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); #endif // creat zconsWriter @@ -326,8 +326,8 @@ namespace OpenMD { #ifndef IS_MPI pzMovingMols = pzMovingMols_local; #else - MPI::COMM_WORLD.Allreduce(&pzMovingMols_local, &pzMovingMols, 1, - MPI::REALTYPE, MPI::SUM); + MPI_Allreduce(&pzMovingMols_local, &pzMovingMols, 1, + MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); #endif RealType vzMovingMols = pzMovingMols / (totMassMovingZMols_ + totMassUnconsMols_); @@ -397,8 +397,8 @@ namespace OpenMD { //calculate total z-constraint force #ifdef IS_MPI - MPI::COMM_WORLD.Allreduce(&totalFZ_local, &totalFZ, 1, - MPI::REALTYPE, MPI::SUM); + MPI_Allreduce(&totalFZ_local, &totalFZ, 1, + MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); #else totalFZ = totalFZ_local; #endif @@ -481,8 +481,8 @@ namespace OpenMD { #ifndef IS_MPI totalFZ = totalFZ_local; #else - MPI::COMM_WORLD.Allreduce(&totalFZ_local, &totalFZ, 1, MPI::REALTYPE, - MPI::SUM); + MPI_Allreduce(&totalFZ_local, &totalFZ, 1, MPI_REALTYPE, + MPI_SUM, MPI_COMM_WORLD); #endif //modify the forces of unconstrained molecules @@ -554,7 +554,7 @@ namespace OpenMD { #ifndef IS_MPI changed = changed_local; #else - MPI::COMM_WORLD.Allreduce(&changed_local, &changed, 1, MPI::INT, MPI::SUM); + MPI_Allreduce(&changed_local, &changed, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); #endif return (changed > 0); @@ -567,8 +567,8 @@ namespace OpenMD { #ifndef IS_MPI havingFixed = havingFixed_local; #else - MPI::COMM_WORLD.Allreduce(&havingFixed_local, &havingFixed, 1, - MPI::INT, MPI::SUM); + MPI_Allreduce(&havingFixed_local, &havingFixed, 1, + MPI_INT, MPI_SUM, MPI_COMM_WORLD); #endif return havingFixed > 0; @@ -584,8 +584,8 @@ namespace OpenMD { #ifndef IS_MPI havingMoving = havingMoving_local; #else - MPI::COMM_WORLD.Allreduce(&havingMoving_local, &havingMoving, 1, - MPI::INT, MPI::SUM); + MPI_Allreduce(&havingMoving_local, &havingMoving, 1, + MPI_INT, MPI_SUM, MPI_COMM_WORLD); #endif return havingMoving > 0; @@ -600,8 +600,8 @@ namespace OpenMD { } #ifdef IS_MPI - MPI::COMM_WORLD.Allreduce(&totMassMovingZMols_local, &totMassMovingZMols_, - 1, MPI::REALTYPE, MPI::SUM); + MPI_Allreduce(&totMassMovingZMols_local, &totMassMovingZMols_, + 1, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); #else totMassMovingZMols_ = totMassMovingZMols_local; #endif @@ -648,7 +648,7 @@ namespace OpenMD { zTargetPos = com[whichDirection]; #else int whicProc = info_->getMolToProc(index); - MPI::COMM_WORLD.Bcast(&zTargetPos, 1, MPI::REALTYPE, whicProc); + MPI_Bcast(&zTargetPos, 1, MPI_REALTYPE, whicProc, MPI_COMM_WORLD); #endif return zTargetPos; }