]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/graph_parallel/test/process_group_serialization.cpp
1 // Copyright (C) 2006 The Trustees of Indiana University.
3 // Use, modification and distribution is subject to the Boost Software
4 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
7 // Authors: Douglas Gregor
10 // FIXME: Including because of a missing header in the serialization library.
11 // Patch sent to list...
14 #include <boost/graph/use_mpi.hpp>
15 #include <boost/config.hpp>
16 #include <boost/throw_exception.hpp>
17 #include <boost/serialization/list.hpp>
18 #include <boost/graph/distributed/mpi_process_group.hpp>
19 #include <boost/test/minimal.hpp>
21 #ifdef BOOST_NO_EXCEPTIONS
23 boost::throw_exception(std::exception
const& ex
)
25 std::cout
<< ex
.what() << std::endl
;
30 using boost::graph::distributed::mpi_process_group
;
32 int test_main(int argc
, char** argv
)
34 boost::mpi::environment
env(argc
, argv
);
39 std::list
<int> seventeens(17, 17);
41 if (process_id(pg
) == 0) {
42 send(pg
, 1, 0, seventeen
);
43 send(pg
, 1, 1, seventeens
);
47 if (process_id(pg
) == 1) {
49 receive(pg
, 0, 0, value
);
50 BOOST_CHECK(seventeen
== value
);
52 std::list
<int> values
;
53 receive(pg
, 0, 1, values
);
54 BOOST_CHECK(seventeens
== values
);