--- branches/development/src/parallel/Communicator.hpp 2011/07/09 15:05:59 1588 +++ branches/development/src/parallel/Communicator.hpp 2011/07/10 16:05:34 1589 @@ -136,8 +136,8 @@ namespace OpenMD{ int nCommProcs = myComm.Get_size(); - counts.reserve(nCommProcs); - displacements.reserve(nCommProcs); + counts.resize(nCommProcs, 0); + displacements.resize(nCommProcs, 0); planSize_ = MPITraits::Length() * nObjects; @@ -156,6 +156,10 @@ namespace OpenMD{ void gather(vector& v1, vector& v2) { + + // an assert would be helpful here to make sure the vectors are the + // correct geometry + myComm.Allgatherv(&v1[0], planSize_, MPITraits::Type(), @@ -168,6 +172,8 @@ namespace OpenMD{ void scatter(vector& v1, vector& v2) { + // an assert would be helpful here to make sure the vectors are the + // correct geometry myComm.Reduce_scatter(&v1[0], &v2[0], &counts[0], MPITraits::Type(), MPI::SUM);