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

Comparing trunk/src/parallel/Communicator.hpp (file contents):
Revision 1969 by gezelter, Wed Feb 26 14:14:50 2014 UTC vs.
Revision 1987 by gezelter, Thu Apr 17 19:07:31 2014 UTC

# Line 129 | Line 129 | namespace OpenMD{
129        switch(D) {
130        case Row :
131          MPI_Comm_split(MPI_COMM_WORLD, rowIndex_, 0, &myComm);
132        //  myComm = MPI::COMM_WORLD.Split(rowIndex_, 0);
132          break;
133        case Column:
134          MPI_Comm_split(MPI_COMM_WORLD, columnIndex_, 0, &myComm);
136        //myComm = MPI::COMM_WORLD.Split(columnIndex_, 0);
135          break;
136        case Global:
137          MPI_Comm_split(MPI_COMM_WORLD, myRank, 0, &myComm);
140        //myComm = MPI::COMM_WORLD.Split(myRank, 0);
138        }
139  
140      }
# Line 159 | Line 156 | namespace OpenMD{
156  
157        int nCommProcs;
158        MPI_Comm_size( myComm, &nCommProcs );
162
163      //int nCommProcs = myComm.Get_size();
159        
160        counts.resize(nCommProcs, 0);
161        displacements.resize(nCommProcs, 0);
# Line 168 | Line 163 | namespace OpenMD{
163        planSize_ = MPITraits<T>::Length() * nObjects;
164        
165        MPI_Allgather(&planSize_, 1, MPI_INT, &counts[0], 1, MPI_INT, myComm);
171      //myComm.Allgather(&planSize_, 1, MPI_INT, &counts[0], 1, MPI_INT);
166        
167        displacements[0] = 0;
168        for (int i = 1; i < nCommProcs; i++) {
# Line 195 | Line 189 | namespace OpenMD{
189                       &displacements[0],
190                       MPITraits<T>::Type(),
191                       myComm);
198      // myComm.Allgatherv(&v1[0],
199      //                   planSize_,
200      //                   MPITraits<T>::Type(),
201      //                   &v2[0],
202      //                   &counts[0],
203      //                   &displacements[0],
204      //                   MPITraits<T>::Type());      
192      }      
193      
194      void scatter(vector<T>& v1, vector<T>& v2) {
# Line 210 | Line 197 | namespace OpenMD{
197              
198        MPI_Reduce_scatter(&v1[0], &v2[0], &counts[0],
199                           MPITraits<T>::Type(), MPI_SUM, myComm);
213
214      // myComm.Reduce_scatter(&v1[0], &v2[0], &counts[0],
215      //                       MPITraits<T>::Type(), MPI::SUM);
200      }
201      
202      int getSize() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines