ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/parallel/ForceMatrixDecomposition.cpp
(Generate patch)

Comparing trunk/src/parallel/ForceMatrixDecomposition.cpp (file contents):
Revision 1929 by gezelter, Mon Aug 19 13:12:00 2013 UTC vs.
Revision 1969 by gezelter, Wed Feb 26 14:14:50 2014 UTC

# Line 119 | Line 119 | namespace OpenMD {
119      
120   #ifdef IS_MPI
121  
122 <    MPI::Intracomm row = rowComm.getComm();
123 <    MPI::Intracomm col = colComm.getComm();
122 >    MPI_Comm row = rowComm.getComm();
123 >    MPI_Comm col = colComm.getComm();
124  
125      AtomPlanIntRow = new Plan<int>(row, nLocal_);
126      AtomPlanRealRow = new Plan<RealType>(row, nLocal_);
# Line 424 | Line 424 | namespace OpenMD {
424                                       gTypeCutoffs.end());
425  
426   #ifdef IS_MPI
427 <    MPI::COMM_WORLD.Allreduce(&groupMax, &groupMax, 1, MPI::REALTYPE,
428 <                              MPI::MAX);
427 >    MPI_Allreduce(&groupMax, &groupMax, 1, MPI_REALTYPE,
428 >                  MPI_MAX, MPI_COMM_WORLD);
429   #endif
430      
431      RealType tradRcut = groupMax;
# Line 916 | Line 916 | namespace OpenMD {
916      for (int ii = 0; ii < N_INTERACTION_FAMILIES; ii++) {
917        RealType ploc1 = pairwisePot[ii];
918        RealType ploc2 = 0.0;
919 <      MPI::COMM_WORLD.Allreduce(&ploc1, &ploc2, 1, MPI::REALTYPE, MPI::SUM);
919 >      MPI_Allreduce(&ploc1, &ploc2, 1, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD);
920        pairwisePot[ii] = ploc2;
921      }
922  
923      for (int ii = 0; ii < N_INTERACTION_FAMILIES; ii++) {
924        RealType ploc1 = excludedPot[ii];
925        RealType ploc2 = 0.0;
926 <      MPI::COMM_WORLD.Allreduce(&ploc1, &ploc2, 1, MPI::REALTYPE, MPI::SUM);
926 >      MPI_Allreduce(&ploc1, &ploc2, 1, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD);
927        excludedPot[ii] = ploc2;
928      }
929  
930      // Here be dragons.
931 <    MPI::Intracomm col = colComm.getComm();
932 <
933 <    col.Allreduce(MPI::IN_PLACE,
931 >    MPI_Comm col = colComm.getComm();
932 >
933 >    MPI_Allreduce(MPI_IN_PLACE,
934                    &snap_->frameData.conductiveHeatFlux[0], 3,
935 <                  MPI::REALTYPE, MPI::SUM);
935 >                  MPI_REALTYPE, MPI_SUM, col);
936  
937  
938   #endif
# Line 951 | Line 951 | namespace OpenMD {
951      for (int ii = 0; ii < N_INTERACTION_FAMILIES; ii++) {
952        RealType ploc1 = embeddingPot[ii];
953        RealType ploc2 = 0.0;
954 <      MPI::COMM_WORLD.Allreduce(&ploc1, &ploc2, 1, MPI::REALTYPE, MPI::SUM);
954 >      MPI_Allreduce(&ploc1, &ploc2, 1, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD);
955        embeddingPot[ii] = ploc2;
956      }    
957      for (int ii = 0; ii < N_INTERACTION_FAMILIES; ii++) {
958        RealType ploc1 = excludedSelfPot[ii];
959        RealType ploc2 = 0.0;
960 <      MPI::COMM_WORLD.Allreduce(&ploc1, &ploc2, 1, MPI::REALTYPE, MPI::SUM);
960 >      MPI_Allreduce(&ploc1, &ploc2, 1, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD);
961        excludedSelfPot[ii] = ploc2;
962      }    
963   #endif
# Line 1175 | Line 1175 | namespace OpenMD {
1175      idat.excluded = excludeAtomPair(atom1, atom2);
1176    
1177   #ifdef IS_MPI
1178 <    idat.atypes = make_pair( atypesRow[atom1], atypesCol[atom2]);
1178 >    //idat.atypes = make_pair( atypesRow[atom1], atypesCol[atom2]);
1179      idat.atid1 = identsRow[atom1];
1180      idat.atid2 = identsCol[atom2];
1181  
1182 <    if (regionsRow[atom1] >= 0 && regionsCol[atom2] >= 0)
1182 >    if (regionsRow[atom1] >= 0 && regionsCol[atom2] >= 0) {
1183        idat.sameRegion = (regionsRow[atom1] == regionsCol[atom2]);
1184 <      
1185 <    //idat.atypes = make_pair( ff_->getAtomType(identsRow[atom1]),
1186 <    //                         ff_->getAtomType(identsCol[atom2]) );
1187 <    
1184 >    } else {
1185 >      idat.sameRegion = false;
1186 >    }
1187 >
1188      if (storageLayout_ & DataStorage::dslAmat) {
1189        idat.A1 = &(atomRowData.aMat[atom1]);
1190        idat.A2 = &(atomColData.aMat[atom2]);
# Line 1237 | Line 1237 | namespace OpenMD {
1237  
1238   #else
1239      
1240 <    idat.atypes = make_pair( atypesLocal[atom1], atypesLocal[atom2]);
1240 >    //idat.atypes = make_pair( atypesLocal[atom1], atypesLocal[atom2]);
1241      idat.atid1 = idents[atom1];
1242      idat.atid2 = idents[atom2];
1243  
1244 <    if (regions[atom1] >= 0 && regions[atom2] >= 0)
1244 >    if (regions[atom1] >= 0 && regions[atom2] >= 0) {
1245        idat.sameRegion = (regions[atom1] == regions[atom2]);
1246 +    } else {
1247 +      idat.sameRegion = false;
1248 +    }
1249  
1250      if (storageLayout_ & DataStorage::dslAmat) {
1251        idat.A1 = &(snap_->atomData.aMat[atom1]);
# Line 1389 | Line 1392 | namespace OpenMD {
1392      Vector3d boxY = box.getColumn(1);
1393      Vector3d boxZ = box.getColumn(2);
1394      
1395 <    nCells_.x() = (int) ( boxX.length() )/ rList_;
1396 <    nCells_.y() = (int) ( boxY.length() )/ rList_;
1397 <    nCells_.z() = (int) ( boxZ.length() )/ rList_;
1395 >    nCells_.x() = int( boxX.length() / rList_ );
1396 >    nCells_.y() = int( boxY.length() / rList_ );
1397 >    nCells_.z() = int( boxZ.length() / rList_ );
1398      
1399      // handle small boxes where the cell offsets can end up repeating cells
1400      
# Line 1487 | Line 1490 | namespace OpenMD {
1490          }
1491          
1492          // find xyz-indices of cell that cutoffGroup is in.
1493 <        whichCell.x() = nCells_.x() * scaled.x();
1494 <        whichCell.y() = nCells_.y() * scaled.y();
1495 <        whichCell.z() = nCells_.z() * scaled.z();
1493 >        whichCell.x() = int(nCells_.x() * scaled.x());
1494 >        whichCell.y() = int(nCells_.y() * scaled.y());
1495 >        whichCell.z() = int(nCells_.z() * scaled.z());
1496          
1497          // find single index of this cell:
1498          cellIndex = Vlinear(whichCell, nCells_);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines