2
0
mirror of https://github.com/boostorg/mpi.git synced 2026-01-22 17:32:18 +00:00
Files
mpi/test/progress_on_irecv.cpp
Alain Miniussi a688b1c6e3 Add test from user report https://svn.boost.org/trac10/ticket/12828 (also mentionned in #70).
Also added progress_on_irecv.cpp test which currently hang (not added in the jam file).
It's probably a replicate, but better safe than sorry in testing.
refs #71.
2018-09-13 10:12:51 +02:00

27 lines
576 B
C++

#include <boost/mpi.hpp>
#include <chrono>
#include <vector>
#include <boost/serialization/vector.hpp>
namespace mpi = boost::mpi;
int main()
{
mpi::environment env;
mpi::communicator world;
if (world.rank() == 0) {
// make sure message is large enough so it is not transmitted eagerly
std::vector<int> msg0(100000);
std::vector<int> msg1(1);
world.send(1, 0, msg0);
world.send(1, 1, msg1);
} else {
mpi::request req;
std::vector<int> msgs[2];
req = world.irecv(0, 0, msgs[0]);
world.recv(0, 1, msgs[1]);
req.wait();
}
}