![]() |
Home | Libraries | People | FAQ | More |
boost::mpi::cartesian_communicator — An MPI communicator with a cartesian topology.
// In header: <boost/mpi/cartesian_communicator.hpp> class cartesian_communicator : public { public: // construct/copy/destruct (, ); (communicator &, cartesian_topology &, = ); (cartesian_communicator &, ); // public member functions () ; () ; (, ) ; () ; (cartesian_topology &, ) ; cartesian_topology () ; () ; };
A cartesian_communicator
is a communicator whose topology is expressed as a grid. Cartesian communicators have the same functionality as (intra)communicators, but also allow one to query the relationships among processes and the properties of the grid.
cartesian_communicator
public
construct/copy/destruct( comm, kind);
Build a new Boost.MPI cartesian communicator based on the MPI communicator comm
with cartesian topology.
comm
may be any valid MPI communicator. If comm
is MPI_COMM_NULL, an empty communicator (that cannot be used for communication) is created and the kind
parameter is ignored. Otherwise, the kind
parameter determines how the Boost.MPI communicator will be related to comm:
If kind
is comm_duplicate
, duplicate comm
to create a new communicator. This new communicator will be freed when the Boost.MPI communicator (and all copies of it) is destroyed. This option is only permitted if the underlying MPI implementation supports MPI 2.0; duplication of intercommunicators is not available in MPI 1.x.
If kind
is comm_take_ownership
, take ownership of comm
. It will be freed automatically when all of the Boost.MPI communicators go out of scope.
If kind
is comm_attach
, this Boost.MPI communicator will reference the existing MPI communicator comm
but will not free comm
when the Boost.MPI communicator goes out of scope. This option should only be used when the communicator is managed by the user.
(communicator & comm, cartesian_topology & dims, reorder = );
Create a new communicator whose topology is described by the given cartesian. The indices of the vertices in the cartesian will be assumed to be the ranks of the processes within the communicator. There may be fewer vertices in the cartesian than there are processes in the communicator; in this case, the resulting communicator will be a NULL communicator.
Parameters: |
|
(cartesian_communicator & comm, keep);
Create a new cartesian communicator whose topology is a subset of an existing cartesian cimmunicator.
Parameters: |
|
cartesian_communicator
public member functions() ;
Retrive the number of dimension of the underlying toppology.
( coords) ;
Return the rank of the process at the given coordinates.
Parameters: |
|
( dim, disp) ;
Return the rank of the source and target destination process through a shift.
Parameters: |
|
( rk) ;
Provides the coordinates of the process with the given rank.
Parameters: |
|
||
Returns: |
the coordinates. |
(cartesian_topology & dims, coords) ;
Retrieve the topology and coordinates of this process in the grid.
cartesian_topology () ;
Retrieve the topology of the grid.
() ;Determine the rank of the executing process in a communicator.
This routine is equivalent to MPI_Comm_rank
.
Returns: |
The rank of the process in the communicator, which will be a value in [0, size()) |