2
0
mirror of https://github.com/boostorg/mpi.git synced 2026-02-26 04:42:23 +00:00

Create a separate graph_communicator type to handle graph topologies

[SVN r37898]
This commit is contained in:
Douglas Gregor
2007-06-05 00:54:56 +00:00
parent 1730870210
commit 1082c372b5
9 changed files with 271 additions and 141 deletions

View File

@@ -6,6 +6,7 @@
#include <boost/mpi/communicator.hpp>
#include <boost/mpi/group.hpp>
#include <boost/mpi/intercommunicator.hpp>
#include <boost/mpi/graph_communicator.hpp>
#include <boost/mpi/skeleton_and_content.hpp>
#include <boost/mpi/detail/point_to_point.hpp>
@@ -160,6 +161,16 @@ optional<intercommunicator> communicator::as_intercommunicator() const
return optional<intercommunicator>();
}
optional<graph_communicator> communicator::as_graph_communicator() const
{
int status;
BOOST_MPI_CHECK_RESULT(MPI_Topo_test, ((MPI_Comm)*this, &status));
if (status == MPI_GRAPH)
return graph_communicator(comm_ptr);
else
return optional<graph_communicator>();
}
bool communicator::has_cartesian_topology() const
{
int status;
@@ -168,14 +179,6 @@ bool communicator::has_cartesian_topology() const
return status == MPI_CART;
}
bool communicator::has_graph_topology() const
{
int status;
BOOST_MPI_CHECK_RESULT(MPI_Topo_test, ((MPI_Comm)*this, &status));
return status == MPI_GRAPH;
}
void communicator::abort(int errcode) const
{
BOOST_MPI_CHECK_RESULT(MPI_Abort, (MPI_Comm(*this), errcode));