On 26 Oct 2010, at 15:52, Nick Collier wrote:

I winnowed my own code down to a simple scatter call. I get the error under release mode but not under debug. Here's the code:

namespace mpi  = boost::mpi;
int main(int argc, char **argv) {
mpi::environment env(argc, argv);
mpi::communicator world;

vector<int> out;
vector<vector<int> > in;
if (world.rank() == 0) {
for (int i = 0; i < world.size(); ++i) {
vector<int> vec(10, 12);
in.push_back(vec);
}
}

try {
mpi::scatter(world, in, out, 0);
} catch (std::exception& ex) {
std::cerr << ex.what() << std::endl;
throw ex;
}

cout << world.rank() << " : " << out.size() << endl;
}

And the error is:

ar size: 4293462132
MPI_Send: Invalid count, error stack:
MPI_Send(176): MPI_Send(buf=0x0016F78C, count=-1505164, MPI_PACKED, dest=1, tag=
2147483647, MPI_COMM_WORLD) failed
MPI_Send(101): Negative count, value is -1505164


This seems to happen in line 73 of boost/mpi/collectives/scatter.hpp . To see where exactly this optimization issue arises, could you please add a print statement 

  std::cerr << oa.size() << std::endl;

before line 73 to print the size of the archive there.

Matthias