]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/mpi/src/intercommunicator.cpp
1 // Copyright (C) 2007 Trustees of Indiana University
3 // Authors: Douglas Gregor
6 // Use, modification and distribution is subject to the Boost Software
7 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
9 #include <boost/mpi/intercommunicator.hpp>
10 #include <boost/mpi/environment.hpp>
11 #include <boost/mpi/group.hpp>
13 namespace boost
{ namespace mpi
{
15 intercommunicator::intercommunicator(const communicator
& local
,
17 const communicator
& peer
,
21 BOOST_MPI_CHECK_RESULT(MPI_Intercomm_create
,
22 ((MPI_Comm
)local
, local_leader
,
23 (MPI_Comm
)peer
, remote_leader
,
24 environment::collectives_tag(), &comm
));
25 comm_ptr
.reset(new MPI_Comm(comm
), comm_free());
28 boost::mpi::group
intercommunicator::local_group() const
33 int intercommunicator::remote_size() const
36 BOOST_MPI_CHECK_RESULT(MPI_Comm_remote_size
, ((MPI_Comm
)*this, &size
));
40 boost::mpi::group
intercommunicator::remote_group() const
43 BOOST_MPI_CHECK_RESULT(MPI_Comm_remote_group
, ((MPI_Comm
)*this, &gr
));
44 return boost::mpi::group(gr
, /*adopt=*/true);
47 communicator
intercommunicator::merge(bool high
) const
50 BOOST_MPI_CHECK_RESULT(MPI_Intercomm_merge
, ((MPI_Comm
)*this, high
, &comm
));
51 return communicator(comm
, comm_take_ownership
);
54 } } // end namespace boost::mpi