--- branches/development/src/brains/SimInfo.cpp 2012/08/20 17:51:39 1779 +++ branches/development/src/brains/SimInfo.cpp 2013/05/15 15:09:35 1874 @@ -35,7 +35,7 @@ * * [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). */ @@ -268,8 +268,9 @@ namespace OpenMD { ndf_local -= nConstraints_; #ifdef IS_MPI - MPI_Allreduce(&ndf_local,&ndf_,1,MPI_INT,MPI_SUM, MPI_COMM_WORLD); - MPI_Allreduce(&nfq_local,&nGlobalFluctuatingCharges_,1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); + MPI::COMM_WORLD.Allreduce(&ndf_local, &ndf_, 1, MPI::INT,MPI::SUM); + MPI::COMM_WORLD.Allreduce(&nfq_local, &nGlobalFluctuatingCharges_, 1, + MPI::INT, MPI::SUM); #else ndf_ = ndf_local; nGlobalFluctuatingCharges_ = nfq_local; @@ -283,7 +284,7 @@ namespace OpenMD { int SimInfo::getFdf() { #ifdef IS_MPI - MPI_Allreduce(&fdf_local,&fdf_,1,MPI_INT,MPI_SUM, MPI_COMM_WORLD); + MPI::COMM_WORLD.Allreduce(&fdf_local, &fdf_, 1, MPI::INT, MPI::SUM); #else fdf_ = fdf_local; #endif @@ -339,7 +340,7 @@ namespace OpenMD { } #ifdef IS_MPI - MPI_Allreduce(&ndfRaw_local,&ndfRaw_,1,MPI_INT,MPI_SUM, MPI_COMM_WORLD); + MPI::COMM_WORLD.Allreduce(&ndfRaw_local, &ndfRaw_, 1, MPI::INT, MPI::SUM); #else ndfRaw_ = ndfRaw_local; #endif @@ -352,7 +353,8 @@ namespace OpenMD { #ifdef IS_MPI - MPI_Allreduce(&ndfTrans_local,&ndfTrans_,1,MPI_INT,MPI_SUM, MPI_COMM_WORLD); + MPI::COMM_WORLD.Allreduce(&ndfTrans_local, &ndfTrans_, 1, + MPI::INT, MPI::SUM); #else ndfTrans_ = ndfTrans_local; #endif @@ -780,6 +782,22 @@ namespace OpenMD { return atomTypes; } + + int getGlobalCountOfType(AtomType* atype) { + /* + set atypes = getSimulatedAtomTypes(); + map counts_; + + for(mol = beginMolecule(mi); mol != NULL; mol = nextMolecule(mi)) { + for(atom = mol->beginAtom(ai); atom != NULL; + atom = mol->nextAtom(ai)) { + atom->getAtomType(); + } + } + */ + return 0; + } + void SimInfo::setupSimVariables() { useAtomicVirial_ = simParams_->getUseAtomicVirial(); // we only call setAccumulateBoxDipole if the accumulateBoxDipole @@ -877,7 +895,6 @@ namespace OpenMD { void SimInfo::prepareTopology() { - int nExclude, nOneTwo, nOneThree, nOneFour; //calculate mass ratio of cutoff group SimInfo::MoleculeIterator mi; @@ -924,18 +941,6 @@ namespace OpenMD { } } - //scan topology - - nExclude = excludedInteractions_.getSize(); - nOneTwo = oneTwoInteractions_.getSize(); - nOneThree = oneThreeInteractions_.getSize(); - nOneFour = oneFourInteractions_.getSize(); - - int* excludeList = excludedInteractions_.getPairList(); - int* oneTwoList = oneTwoInteractions_.getPairList(); - int* oneThreeList = oneThreeInteractions_.getPairList(); - int* oneFourList = oneFourInteractions_.getPairList(); - topologyDone_ = true; } @@ -1007,7 +1012,7 @@ namespace OpenMD { StuntDouble* SimInfo::getIOIndexToIntegrableObject(int index) { - if (index >= IOIndexToIntegrableObject.size()) { + if (index >= int(IOIndexToIntegrableObject.size())) { sprintf(painCave.errMsg, "SimInfo::getIOIndexToIntegrableObject Error: Integrable Object\n" "\tindex exceeds number of known objects!\n"); @@ -1025,8 +1030,8 @@ namespace OpenMD { int SimInfo::getNGlobalConstraints() { int nGlobalConstraints; #ifdef IS_MPI - MPI_Allreduce(&nConstraints_, &nGlobalConstraints, 1, MPI_INT, MPI_SUM, - MPI_COMM_WORLD); + MPI::COMM_WORLD.Allreduce(&nConstraints_, &nGlobalConstraints, 1, + MPI::INT, MPI::SUM); #else nGlobalConstraints = nConstraints_; #endif