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

Comparing branches/development/src/parallel/Communicator.hpp (file contents):
Revision 1540 by gezelter, Mon Jan 17 21:34:36 2011 UTC vs.
Revision 1541 by gezelter, Fri Feb 4 20:04:56 2011 UTC

# Line 113 | Line 113 | namespace OpenMD{
113  
114        myComm.Allgather(&planSize_, 1, MPI::INT, &counts[0], 1, MPI::INT);
115  
116 +
117        displacements[0] = 0;
118        for (int i = 1; i < nCommProcs; i++) {
119          displacements[i] = displacements[i-1] + counts[i-1];
120 <      }      
120 >        size_ += count[i-1];
121 >      }
122 >
123 >      size_ = 0;
124 >      for (int i = 0; i < nCommProcs; i++) {
125 >        size_ += counts[i];
126 >      }
127      }
128  
129  
# Line 138 | Line 145 | namespace OpenMD{
145        myComm.Reduce_scatter(&v1[0], &v2[0], &counts[0],
146                              MPITraits<T>::datatype, MPI::SUM);
147      }
148 +
149 +    int getSize() {
150 +      return size_;
151 +    }
152      
153    private:
154      int planSize_;     ///< how many are on local proc
155      int rowIndex_;
156      int columnIndex_;
157 +    int size_;
158      std::vector<int> counts;
159      std::vector<int> displacements;
160      MPI::Intracomm myComm;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines