]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/graph_parallel/test/process_group_serialization.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / graph_parallel / test / process_group_serialization.cpp
CommitLineData
7c673cae
FG
1// Copyright (C) 2006 The Trustees of Indiana University.
2
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)
6
7// Authors: Douglas Gregor
8// Andrew Lumsdaine
9
10// FIXME: Including because of a missing header in the serialization library.
11// Patch sent to list...
12#include <cassert>
13
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>
1e59de90 19#include <boost/core/lightweight_test.hpp>
7c673cae
FG
20
21#ifdef BOOST_NO_EXCEPTIONS
22void
23boost::throw_exception(std::exception const& ex)
24{
25 std::cout << ex.what() << std::endl;
26 abort();
27}
28#endif
29
30using boost::graph::distributed::mpi_process_group;
31
1e59de90 32int main(int argc, char** argv)
7c673cae
FG
33{
34 boost::mpi::environment env(argc, argv);
35
36 mpi_process_group pg;
37
38 int seventeen = 17;
39 std::list<int> seventeens(17, 17);
40
41 if (process_id(pg) == 0) {
42 send(pg, 1, 0, seventeen);
43 send(pg, 1, 1, seventeens);
44 }
45 synchronize(pg);
46
47 if (process_id(pg) == 1) {
48 int value;
49 receive(pg, 0, 0, value);
1e59de90 50 BOOST_TEST(seventeen == value);
7c673cae
FG
51
52 std::list<int> values;
53 receive(pg, 0, 1, values);
1e59de90 54 BOOST_TEST(seventeens == values);
7c673cae
FG
55 }
56
1e59de90 57 return boost::report_errors();
7c673cae 58}