2
0
mirror of https://github.com/boostorg/mpi.git synced 2026-01-19 04:22:10 +00:00

Add test case from

Francesco Parisen Toldin
refs #122
This commit is contained in:
Alain Miniussi
2020-07-01 12:57:36 +02:00
parent 070c3c707d
commit 64d373dbfc
2 changed files with 37 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
# Support for the Message Passing Interface (MPI)
># Support for the Message Passing Interface (MPI)
#
# (C) Copyright 2005, 2006 Trustees of Indiana University
# (C) Copyright 2005 Douglas Gregor
@@ -52,5 +52,6 @@ test-suite mpi
[ mpi-test sendrecv_vector : : : 2 ]
# Intel MPI 2018 and older are axtected to fail:
[ mpi-test non_blocking_any_source : : : 2 17 ]
[ mpi-test buf_size : : : 1 ]
;
}

35
test/buf_size.cpp Normal file
View File

@@ -0,0 +1,35 @@
#include <iostream>
#include <vector>
#include <boost/serialization/vector.hpp>
#include <boost/mpi/collectives.hpp>
struct huge {
std::vector<unsigned char> data;
huge() : data(2ull << 30ull, 0) { }
template <class Archive>
void serialize(Archive& ar, const unsigned int version)
{
ar & data;
}
};
int main()
{
boost::mpi::environment env;
boost::mpi::communicator world;
huge a{};
std::cout << world.rank() << " huge created " << std::endl;
world.barrier();
if (world.rank() == 0) {
std::vector<huge> all;
boost::mpi::gather(world, a, all, 0);
} else {
boost::mpi::gather(world, a, 0);
}
return 0;
}