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 1969 by gezelter, Wed Feb 26 14:14:50 2014 UTC vs.
Revision 1993 by gezelter, Tue Apr 29 17:32:31 2014 UTC

# Line 424 | Line 424 | namespace OpenMD {
424                                       gTypeCutoffs.end());
425  
426   #ifdef IS_MPI
427 <    MPI_Allreduce(&groupMax, &groupMax, 1, MPI_REALTYPE,
427 >    MPI_Allreduce(MPI_IN_PLACE, &groupMax, 1, MPI_REALTYPE,
428                    MPI_MAX, MPI_COMM_WORLD);
429   #endif
430      
# 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  
# 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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines