# | 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(MPI_IN_PLACE, &groupMax, 1, MPI_REALTYPE, |
428 | > | MPI_MAX, MPI_COMM_WORLD); |
429 | #endif | |
430 | ||
431 | RealType tradRcut = groupMax; | |
# | Line 586 | Line 586 | namespace OpenMD { | |
586 | atomColData.electricField.end(), V3Zero); | |
587 | } | |
588 | ||
589 | + | if (storageLayout_ & DataStorage::dslSitePotential) { |
590 | + | fill(atomRowData.sitePotential.begin(), |
591 | + | atomRowData.sitePotential.end(), 0.0); |
592 | + | fill(atomColData.sitePotential.begin(), |
593 | + | atomColData.sitePotential.end(), 0.0); |
594 | + | } |
595 | + | |
596 | #endif | |
597 | // even in parallel, we need to zero out the local arrays: | |
598 | ||
# | Line 618 | Line 625 | namespace OpenMD { | |
625 | fill(snap_->atomData.electricField.begin(), | |
626 | snap_->atomData.electricField.end(), V3Zero); | |
627 | } | |
628 | + | if (storageLayout_ & DataStorage::dslSitePotential) { |
629 | + | fill(snap_->atomData.sitePotential.begin(), |
630 | + | snap_->atomData.sitePotential.end(), 0.0); |
631 | + | } |
632 | } | |
633 | ||
634 | ||
# | Line 832 | Line 843 | namespace OpenMD { | |
843 | snap_->atomData.electricField[i] += efield_tmp[i]; | |
844 | } | |
845 | ||
846 | + | if (storageLayout_ & DataStorage::dslSitePotential) { |
847 | ||
848 | + | int nsp = snap_->atomData.sitePotential.size(); |
849 | + | vector<RealType> sp_tmp(nsp, 0.0); |
850 | + | |
851 | + | AtomPlanRealRow->scatter(atomRowData.sitePotential, sp_tmp); |
852 | + | for (int i = 0; i < nsp; i++) { |
853 | + | snap_->atomData.sitePotential[i] += sp_tmp[i]; |
854 | + | sp_tmp[i] = 0.0; |
855 | + | } |
856 | + | |
857 | + | AtomPlanRealColumn->scatter(atomColData.sitePotential, sp_tmp); |
858 | + | for (int i = 0; i < nsp; i++) |
859 | + | snap_->atomData.sitePotential[i] += sp_tmp[i]; |
860 | + | } |
861 | + | |
862 | nLocal_ = snap_->getNumberOfAtoms(); | |
863 | ||
864 | vector<potVec> pot_temp(nLocal_, | |
# | Line 916 | Line 942 | namespace OpenMD { | |
942 | for (int ii = 0; ii < N_INTERACTION_FAMILIES; ii++) { | |
943 | RealType ploc1 = pairwisePot[ii]; | |
944 | RealType ploc2 = 0.0; | |
945 | < | MPI::COMM_WORLD.Allreduce(&ploc1, &ploc2, 1, MPI::REALTYPE, MPI::SUM); |
945 | > | MPI_Allreduce(&ploc1, &ploc2, 1, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); |
946 | pairwisePot[ii] = ploc2; | |
947 | } | |
948 | ||
949 | for (int ii = 0; ii < N_INTERACTION_FAMILIES; ii++) { | |
950 | RealType ploc1 = excludedPot[ii]; | |
951 | RealType ploc2 = 0.0; | |
952 | < | MPI::COMM_WORLD.Allreduce(&ploc1, &ploc2, 1, MPI::REALTYPE, MPI::SUM); |
952 | > | MPI_Allreduce(&ploc1, &ploc2, 1, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); |
953 | excludedPot[ii] = ploc2; | |
954 | } | |
955 | ||
956 | // Here be dragons. | |
957 | < | MPI::Intracomm col = colComm.getComm(); |
957 | > | MPI_Comm col = colComm.getComm(); |
958 | ||
959 | < | col.Allreduce(MPI::IN_PLACE, |
959 | > | MPI_Allreduce(MPI_IN_PLACE, |
960 | &snap_->frameData.conductiveHeatFlux[0], 3, | |
961 | < | MPI::REALTYPE, MPI::SUM); |
961 | > | MPI_REALTYPE, MPI_SUM, col); |
962 | ||
963 | ||
964 | #endif | |
# | Line 951 | Line 977 | namespace OpenMD { | |
977 | for (int ii = 0; ii < N_INTERACTION_FAMILIES; ii++) { | |
978 | RealType ploc1 = embeddingPot[ii]; | |
979 | RealType ploc2 = 0.0; | |
980 | < | MPI::COMM_WORLD.Allreduce(&ploc1, &ploc2, 1, MPI::REALTYPE, MPI::SUM); |
980 | > | MPI_Allreduce(&ploc1, &ploc2, 1, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); |
981 | embeddingPot[ii] = ploc2; | |
982 | } | |
983 | for (int ii = 0; ii < N_INTERACTION_FAMILIES; ii++) { | |
984 | RealType ploc1 = excludedSelfPot[ii]; | |
985 | RealType ploc2 = 0.0; | |
986 | < | MPI::COMM_WORLD.Allreduce(&ploc1, &ploc2, 1, MPI::REALTYPE, MPI::SUM); |
986 | > | MPI_Allreduce(&ploc1, &ploc2, 1, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); |
987 | excludedSelfPot[ii] = ploc2; | |
988 | } | |
989 | #endif | |
# | Line 1319 | Line 1345 | namespace OpenMD { | |
1345 | if (storageLayout_ & DataStorage::dslElectricField) { | |
1346 | atomRowData.electricField[atom1] += *(idat.eField1); | |
1347 | atomColData.electricField[atom2] += *(idat.eField2); | |
1348 | + | } |
1349 | + | |
1350 | + | if (storageLayout_ & DataStorage::dslSitePotential) { |
1351 | + | atomRowData.sitePotential[atom1] += *(idat.sPot1); |
1352 | + | atomColData.sitePotential[atom2] += *(idat.sPot2); |
1353 | } | |
1354 | ||
1355 | #else | |
# | Line 1345 | Line 1376 | namespace OpenMD { | |
1376 | if (storageLayout_ & DataStorage::dslElectricField) { | |
1377 | snap_->atomData.electricField[atom1] += *(idat.eField1); | |
1378 | snap_->atomData.electricField[atom2] += *(idat.eField2); | |
1379 | + | } |
1380 | + | |
1381 | + | if (storageLayout_ & DataStorage::dslSitePotential) { |
1382 | + | snap_->atomData.sitePotential[atom1] += *(idat.sPot1); |
1383 | + | snap_->atomData.sitePotential[atom2] += *(idat.sPot2); |
1384 | } | |
1385 | ||
1386 | #endif | |
# | Line 1392 | Line 1428 | namespace OpenMD { | |
1428 | Vector3d boxY = box.getColumn(1); | |
1429 | Vector3d boxZ = box.getColumn(2); | |
1430 | ||
1431 | < | nCells_.x() = (int) ( boxX.length() )/ rList_; |
1432 | < | nCells_.y() = (int) ( boxY.length() )/ rList_; |
1433 | < | nCells_.z() = (int) ( boxZ.length() )/ rList_; |
1431 | > | nCells_.x() = int( boxX.length() / rList_ ); |
1432 | > | nCells_.y() = int( boxY.length() / rList_ ); |
1433 | > | nCells_.z() = int( boxZ.length() / rList_ ); |
1434 | ||
1435 | // handle small boxes where the cell offsets can end up repeating cells | |
1436 | ||
# | Line 1490 | Line 1526 | namespace OpenMD { | |
1526 | } | |
1527 | ||
1528 | // find xyz-indices of cell that cutoffGroup is in. | |
1529 | < | whichCell.x() = nCells_.x() * scaled.x(); |
1530 | < | whichCell.y() = nCells_.y() * scaled.y(); |
1531 | < | whichCell.z() = nCells_.z() * scaled.z(); |
1529 | > | whichCell.x() = int(nCells_.x() * scaled.x()); |
1530 | > | whichCell.y() = int(nCells_.y() * scaled.y()); |
1531 | > | whichCell.z() = int(nCells_.z() * scaled.z()); |
1532 | ||
1533 | // find single index of this cell: | |
1534 | cellIndex = Vlinear(whichCell, nCells_); |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |