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 1588 by gezelter, Sat Jul 9 15:05:59 2011 UTC vs.
Revision 1589 by gezelter, Sun Jul 10 16:05:34 2011 UTC

# Line 136 | Line 136 | namespace OpenMD{
136          
137        int nCommProcs = myComm.Get_size();
138  
139 <      counts.reserve(nCommProcs);
140 <      displacements.reserve(nCommProcs);
139 >      counts.resize(nCommProcs, 0);
140 >      displacements.resize(nCommProcs, 0);
141  
142        planSize_ = MPITraits<T>::Length() * nObjects;
143  
# Line 156 | Line 156 | namespace OpenMD{
156  
157      
158      void gather(vector<T>& v1, vector<T>& v2) {
159 +
160 +      // an assert would be helpful here to make sure the vectors are the
161 +      // correct geometry
162 +      
163        myComm.Allgatherv(&v1[0],
164                          planSize_,
165                          MPITraits<T>::Type(),
# Line 168 | Line 172 | namespace OpenMD{
172      
173      
174      void scatter(vector<T>& v1, vector<T>& v2) {
175 +      // an assert would be helpful here to make sure the vectors are the
176 +      // correct geometry
177        
178        myComm.Reduce_scatter(&v1[0], &v2[0], &counts[0],
179                              MPITraits<T>::Type(), MPI::SUM);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines