]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/mpi/test/version_test.cpp
1 // Copyright (C) 2013 Alain Miniussi <alain.miniussi@oca.eu>
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)
9 #include <boost/mpi/environment.hpp>
10 #include <boost/mpi/communicator.hpp>
13 #define BOOST_TEST_MODULE mpi_version
14 #include <boost/test/included/unit_test.hpp>
16 namespace mpi
= boost::mpi
;
19 test_version(mpi::communicator
const& comm
) {
20 #if defined(MPI_VERSION)
21 int mpi_version
= MPI_VERSION
;
22 int mpi_subversion
= MPI_SUBVERSION
;
25 int mpi_subversion
= 0;
28 std::pair
<int,int> version
= mpi::environment::version();
29 if (comm
.rank() == 0) {
30 std::cout
<< "MPI Version: " << version
.first
<< ',' << version
.second
<< '\n';
32 BOOST_CHECK(version
.first
== mpi_version
);
33 BOOST_CHECK(version
.second
== mpi_subversion
);
38 return b
? std::string("yes") : std::string("no");
42 report_features(mpi::communicator
const& comm
) {
43 if (comm
.rank() == 0) {
44 std::cout
<< "Assuming working MPI_Improbe:" <<
45 #if defined(BOOST_MPI_USE_IMPROBE)
53 BOOST_AUTO_TEST_CASE(version
)
56 mpi::communicator world
;
59 report_features(world
);