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:
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