I'm currently writing a simulation using boost::mpi on top of openMPI and everything works great. However once I scale up the system and therefore have to send larger std::vectors I get errors.
I've reduced the issue to the following problem:
#include <boost/mpi.hpp>
#include <boost/mpi/environment.hpp>
#include <boost/mpi/communicator.hpp>
#include <boost/serialization/vector.hpp>
#include <iostream>
#include <vector>
namespace mpi = boost::mpi;
int main() {
mpi::environment env;
mpi::communicator world;
std::vector<char> a;
std::vector<char> b;
if (world.rank() == 0) {
for (size_t i = 1; i < 1E10; i *= 2) {
a.resize(i);
std::cout << "a " << a.size();
world.isend(0, 0, a);
world.recv(0, 0, b);
std::cout << "\tB " << b.size() << std::endl;
}
}
return 0;
}
prints out:
a 1 B 1
a 2 B 2
a 4 B 4
....
a 16384 B 16384
a 32768 B 32768
a 65536 B 65536
a 131072 B 0
a 262144 B 0
a 524288 B 0
a 1048576 B 0
a 2097152 B 0
I'm aware that there is a limit to a mpi message size, but 65kB seems a little low to me. Is there a way of sending larger messages?
isend
tosend
? It could be that the non blocking send is causing an issue. – Archducalstatus
that is returned byrecv
? That might point you in a direction. – Archducalisend()
), it must be a bug inboost.mpi
. And yes, it is supposed to block whenisend()
is replaced bysend()
and the message size is above the internal eager limit. – Sentence