--- trunk/src/parallel/ForceMatrixDecomposition.cpp 2013/08/19 13:12:00 1929 +++ trunk/src/parallel/ForceMatrixDecomposition.cpp 2014/02/28 13:25:13 1971 @@ -119,8 +119,8 @@ namespace OpenMD { #ifdef IS_MPI - MPI::Intracomm row = rowComm.getComm(); - MPI::Intracomm col = colComm.getComm(); + MPI_Comm row = rowComm.getComm(); + MPI_Comm col = colComm.getComm(); AtomPlanIntRow = new Plan(row, nLocal_); AtomPlanRealRow = new Plan(row, nLocal_); @@ -424,8 +424,8 @@ namespace OpenMD { gTypeCutoffs.end()); #ifdef IS_MPI - MPI::COMM_WORLD.Allreduce(&groupMax, &groupMax, 1, MPI::REALTYPE, - MPI::MAX); + MPI_Allreduce(MPI_IN_PLACE, &groupMax, 1, MPI_REALTYPE, + MPI_MAX, MPI_COMM_WORLD); #endif RealType tradRcut = groupMax; @@ -916,23 +916,23 @@ namespace OpenMD { for (int ii = 0; ii < N_INTERACTION_FAMILIES; ii++) { RealType ploc1 = pairwisePot[ii]; RealType ploc2 = 0.0; - MPI::COMM_WORLD.Allreduce(&ploc1, &ploc2, 1, MPI::REALTYPE, MPI::SUM); + MPI_Allreduce(&ploc1, &ploc2, 1, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); pairwisePot[ii] = ploc2; } for (int ii = 0; ii < N_INTERACTION_FAMILIES; ii++) { RealType ploc1 = excludedPot[ii]; RealType ploc2 = 0.0; - MPI::COMM_WORLD.Allreduce(&ploc1, &ploc2, 1, MPI::REALTYPE, MPI::SUM); + MPI_Allreduce(&ploc1, &ploc2, 1, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); excludedPot[ii] = ploc2; } // Here be dragons. - MPI::Intracomm col = colComm.getComm(); - - col.Allreduce(MPI::IN_PLACE, + MPI_Comm col = colComm.getComm(); + + MPI_Allreduce(MPI_IN_PLACE, &snap_->frameData.conductiveHeatFlux[0], 3, - MPI::REALTYPE, MPI::SUM); + MPI_REALTYPE, MPI_SUM, col); #endif @@ -951,13 +951,13 @@ namespace OpenMD { for (int ii = 0; ii < N_INTERACTION_FAMILIES; ii++) { RealType ploc1 = embeddingPot[ii]; RealType ploc2 = 0.0; - MPI::COMM_WORLD.Allreduce(&ploc1, &ploc2, 1, MPI::REALTYPE, MPI::SUM); + MPI_Allreduce(&ploc1, &ploc2, 1, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); embeddingPot[ii] = ploc2; } for (int ii = 0; ii < N_INTERACTION_FAMILIES; ii++) { RealType ploc1 = excludedSelfPot[ii]; RealType ploc2 = 0.0; - MPI::COMM_WORLD.Allreduce(&ploc1, &ploc2, 1, MPI::REALTYPE, MPI::SUM); + MPI_Allreduce(&ploc1, &ploc2, 1, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); excludedSelfPot[ii] = ploc2; } #endif @@ -1175,16 +1175,16 @@ namespace OpenMD { idat.excluded = excludeAtomPair(atom1, atom2); #ifdef IS_MPI - idat.atypes = make_pair( atypesRow[atom1], atypesCol[atom2]); + //idat.atypes = make_pair( atypesRow[atom1], atypesCol[atom2]); idat.atid1 = identsRow[atom1]; idat.atid2 = identsCol[atom2]; - if (regionsRow[atom1] >= 0 && regionsCol[atom2] >= 0) + if (regionsRow[atom1] >= 0 && regionsCol[atom2] >= 0) { idat.sameRegion = (regionsRow[atom1] == regionsCol[atom2]); - - //idat.atypes = make_pair( ff_->getAtomType(identsRow[atom1]), - // ff_->getAtomType(identsCol[atom2]) ); - + } else { + idat.sameRegion = false; + } + if (storageLayout_ & DataStorage::dslAmat) { idat.A1 = &(atomRowData.aMat[atom1]); idat.A2 = &(atomColData.aMat[atom2]); @@ -1237,12 +1237,15 @@ namespace OpenMD { #else - idat.atypes = make_pair( atypesLocal[atom1], atypesLocal[atom2]); + //idat.atypes = make_pair( atypesLocal[atom1], atypesLocal[atom2]); idat.atid1 = idents[atom1]; idat.atid2 = idents[atom2]; - if (regions[atom1] >= 0 && regions[atom2] >= 0) + if (regions[atom1] >= 0 && regions[atom2] >= 0) { idat.sameRegion = (regions[atom1] == regions[atom2]); + } else { + idat.sameRegion = false; + } if (storageLayout_ & DataStorage::dslAmat) { idat.A1 = &(snap_->atomData.aMat[atom1]); @@ -1389,9 +1392,9 @@ namespace OpenMD { Vector3d boxY = box.getColumn(1); Vector3d boxZ = box.getColumn(2); - nCells_.x() = (int) ( boxX.length() )/ rList_; - nCells_.y() = (int) ( boxY.length() )/ rList_; - nCells_.z() = (int) ( boxZ.length() )/ rList_; + nCells_.x() = int( boxX.length() / rList_ ); + nCells_.y() = int( boxY.length() / rList_ ); + nCells_.z() = int( boxZ.length() / rList_ ); // handle small boxes where the cell offsets can end up repeating cells @@ -1487,9 +1490,9 @@ namespace OpenMD { } // find xyz-indices of cell that cutoffGroup is in. - whichCell.x() = nCells_.x() * scaled.x(); - whichCell.y() = nCells_.y() * scaled.y(); - whichCell.z() = nCells_.z() * scaled.z(); + whichCell.x() = int(nCells_.x() * scaled.x()); + whichCell.y() = int(nCells_.y() * scaled.y()); + whichCell.z() = int(nCells_.z() * scaled.z()); // find single index of this cell: cellIndex = Vlinear(whichCell, nCells_);