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

Comparing trunk/src/constraints/ZconstraintForceManager.cpp (file contents):
Revision 1795 by gezelter, Wed Aug 22 02:28:28 2012 UTC vs.
Revision 1796 by gezelter, Mon Sep 10 18:38:44 2012 UTC

# Line 161 | Line 161 | namespace OpenMD {
161   #ifndef IS_MPI
162      totMassUnconsMols_ = totMassUnconsMols_local;
163   #else
164 <    MPI_Allreduce(&totMassUnconsMols_local, &totMassUnconsMols_, 1, MPI_REALTYPE,
165 <                  MPI_SUM, MPI_COMM_WORLD);  
164 >    MPI::COMM_WORLD.Allreduce(&totMassUnconsMols_local, &totMassUnconsMols_, 1,
165 >                              MPI::REALTYPE, MPI::SUM);
166   #endif
167  
168      // creat zconsWriter  
# Line 326 | Line 326 | namespace OpenMD {
326   #ifndef IS_MPI
327      pzMovingMols = pzMovingMols_local;
328   #else
329 <    MPI_Allreduce(&pzMovingMols_local, &pzMovingMols, 1, MPI_REALTYPE,
330 <                  MPI_SUM, MPI_COMM_WORLD);
329 >    MPI::COMM_WORLD.Allreduce(&pzMovingMols_local, &pzMovingMols, 1,
330 >                              MPI::REALTYPE, MPI::SUM);
331   #endif
332  
333      RealType vzMovingMols = pzMovingMols / (totMassMovingZMols_ + totMassUnconsMols_);
# Line 397 | Line 397 | namespace OpenMD {
397  
398      //calculate total z-constraint force
399   #ifdef IS_MPI
400 <    MPI_Allreduce(&totalFZ_local, &totalFZ, 1, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD);
400 >    MPI::COMM_WORLD.Allreduce(&totalFZ_local, &totalFZ, 1,
401 >                              MPI::REALTYPE, MPI::SUM);
402   #else
403      totalFZ = totalFZ_local;
404   #endif
# Line 480 | Line 481 | namespace OpenMD {
481   #ifndef IS_MPI
482      totalFZ = totalFZ_local;
483   #else
484 <    MPI_Allreduce(&totalFZ_local, &totalFZ, 1, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD);  
484 >    MPI::COMM_WORLD.Allreduce(&totalFZ_local, &totalFZ, 1, MPI::REALTYPE,
485 >                              MPI::SUM);
486   #endif
487  
488      //modify the forces of unconstrained molecules
# Line 552 | Line 554 | namespace OpenMD {
554   #ifndef IS_MPI
555      changed = changed_local;
556   #else
557 <    MPI_Allreduce(&changed_local, &changed, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
557 >    MPI::COMM_WORLD.Allreduce(&changed_local, &changed, 1, MPI::INT, MPI::SUM);
558   #endif
559  
560      return (changed > 0);
# Line 565 | Line 567 | namespace OpenMD {
567   #ifndef IS_MPI
568      havingFixed = havingFixed_local;
569   #else
570 <    MPI_Allreduce(&havingFixed_local, &havingFixed, 1, MPI_INT, MPI_SUM,
571 <                  MPI_COMM_WORLD);
570 >    MPI::COMM_WORLD.Allreduce(&havingFixed_local, &havingFixed, 1,
571 >                              MPI::INT, MPI::SUM);
572   #endif
573  
574      return havingFixed > 0;
# Line 582 | Line 584 | namespace OpenMD {
584   #ifndef IS_MPI
585      havingMoving = havingMoving_local;
586   #else
587 <    MPI_Allreduce(&havingMoving_local, &havingMoving, 1, MPI_INT, MPI_SUM,
588 <                  MPI_COMM_WORLD);
587 >    MPI::COMM_WORLD.Allreduce(&havingMoving_local, &havingMoving, 1,
588 >                              MPI::INT, MPI::SUM);
589   #endif
590  
591      return havingMoving > 0;
# Line 598 | Line 600 | namespace OpenMD {
600      }
601      
602   #ifdef IS_MPI
603 <    MPI_Allreduce(&totMassMovingZMols_local, &totMassMovingZMols_, 1, MPI_REALTYPE,
604 <                  MPI_SUM, MPI_COMM_WORLD);
603 >    MPI::COMM_WORLD.Allreduce(&totMassMovingZMols_local, &totMassMovingZMols_,
604 >                              1, MPI::REALTYPE, MPI::SUM);
605   #else
606      totMassMovingZMols_ = totMassMovingZMols_local;
607   #endif
# Line 646 | Line 648 | namespace OpenMD {
648      zTargetPos = com[whichDirection];
649   #else
650      int whicProc = info_->getMolToProc(index);
651 <    MPI_Bcast(&zTargetPos, 1, MPI_REALTYPE, whicProc, MPI_COMM_WORLD);
651 >    MPI::COMM_WORLD.Bcast(&zTargetPos, 1, MPI::REALTYPE, whicProc);
652   #endif
653      return zTargetPos;
654    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines