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

Comparing branches/development/src/parallel/ForceMatrixDecomposition.cpp (file contents):
Revision 1589 by gezelter, Sun Jul 10 16:05:34 2011 UTC vs.
Revision 1590 by gezelter, Mon Jul 11 01:39:49 2011 UTC

# Line 341 | Line 341 | namespace OpenMD {
341  
342      // Now we find the maximum group cutoff value present in the simulation
343  
344 <    RealType groupMax = *max_element(gTypeCutoffs.begin(), gTypeCutoffs.end());
344 >    RealType groupMax = *max_element(gTypeCutoffs.begin(),
345 >                                     gTypeCutoffs.end());
346  
347   #ifdef IS_MPI
348 <    MPI::COMM_WORLD.Allreduce(&groupMax, &groupMax, 1, MPI::REALTYPE, MPI::MAX);
348 >    MPI::COMM_WORLD.Allreduce(&groupMax, &groupMax, 1, MPI::REALTYPE,
349 >                              MPI::MAX);
350   #endif
351      
352      RealType tradRcut = groupMax;
# Line 440 | Line 442 | namespace OpenMD {
442           Vector<RealType, N_INTERACTION_FAMILIES> (0.0));  
443  
444      if (storageLayout_ & DataStorage::dslParticlePot) {    
445 <      fill(atomRowData.particlePot.begin(), atomRowData.particlePot.end(), 0.0);
446 <      fill(atomColData.particlePot.begin(), atomColData.particlePot.end(), 0.0);
445 >      fill(atomRowData.particlePot.begin(), atomRowData.particlePot.end(),
446 >           0.0);
447 >      fill(atomColData.particlePot.begin(), atomColData.particlePot.end(),
448 >           0.0);
449      }
450  
451      if (storageLayout_ & DataStorage::dslDensity) {      
# Line 450 | Line 454 | namespace OpenMD {
454      }
455  
456      if (storageLayout_ & DataStorage::dslFunctional) {  
457 <      fill(atomRowData.functional.begin(), atomRowData.functional.end(), 0.0);
458 <      fill(atomColData.functional.begin(), atomColData.functional.end(), 0.0);
457 >      fill(atomRowData.functional.begin(), atomRowData.functional.end(),
458 >           0.0);
459 >      fill(atomColData.functional.begin(), atomColData.functional.end(),
460 >           0.0);
461      }
462  
463      if (storageLayout_ & DataStorage::dslFunctionalDerivative) {      
# Line 468 | Line 474 | namespace OpenMD {
474             atomColData.skippedCharge.end(), 0.0);
475      }
476  
477 < #else
478 <    
477 > #endif
478 >    // even in parallel, we need to zero out the local arrays:
479 >
480      if (storageLayout_ & DataStorage::dslParticlePot) {      
481        fill(snap_->atomData.particlePot.begin(),
482             snap_->atomData.particlePot.end(), 0.0);
# Line 491 | Line 498 | namespace OpenMD {
498        fill(snap_->atomData.skippedCharge.begin(),
499             snap_->atomData.skippedCharge.end(), 0.0);
500      }
494 #endif
501      
502    }
503  
# Line 528 | Line 534 | namespace OpenMD {
534        AtomCommMatrixColumn->gather(snap_->atomData.electroFrame,
535                                     atomColData.electroFrame);
536      }
537 +
538   #endif      
539    }
540    
# Line 594 | Line 601 | namespace OpenMD {
601      AtomCommVectorColumn->scatter(atomColData.force, frc_tmp);
602      for (int i = 0; i < n; i++)
603        snap_->atomData.force[i] += frc_tmp[i];
604 <    
598 <    
604 >        
605      if (storageLayout_ & DataStorage::dslTorque) {
606  
607        int nt = snap_->atomData.torque.size();
# Line 619 | Line 625 | namespace OpenMD {
625  
626        AtomCommRealRow->scatter(atomRowData.skippedCharge, skch_tmp);
627        for (int i = 0; i < ns; i++) {
628 <        snap_->atomData.skippedCharge[i] = skch_tmp[i];
628 >        snap_->atomData.skippedCharge[i] += skch_tmp[i];
629          skch_tmp[i] = 0.0;
630        }
631        

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines