Note: this is documentation for an old release. View the latest documentation at docs.fenicsproject.org/v0.3.0/v0.9.0/cpp
DOLFINx  0.3.0
DOLFINx C++ interface
Classes | Functions
dolfinx::MPI Namespace Reference

MPI support functionality. More...

Classes

class  Comm
 A duplicate MPI communicator and manage lifetime of the communicator. More...
 
struct  dependent_false
 

Functions

int rank (MPI_Comm comm)
 Return process rank for the communicator.
 
int size (MPI_Comm comm)
 Return size of the group (number of processes) associated with the communicator.
 
template<typename T >
graph::AdjacencyList< T > all_to_all (MPI_Comm comm, const graph::AdjacencyList< T > &send_data)
 Send in_values[p0] to process p0 and receive values from process p1 in out_values[p1].
 
std::vector< int > compute_graph_edges (MPI_Comm comm, const std::set< int > &edges)
 
template<typename T >
graph::AdjacencyList< T > neighbor_all_to_all (MPI_Comm neighbor_comm, const graph::AdjacencyList< T > &send_data)
 Neighborhood all-to-all. Send data to neighbors. Send in_values[n0] to neighbor process n0 and receive values from neighbor process n1 in out_values[n1].
 
std::tuple< std::vector< int >, std::vector< int > > neighbors (MPI_Comm neighbor_comm)
 
constexpr std::array< std::int64_t, 2 > local_range (int rank, std::int64_t N, int size)
 Return local range for given process, splitting [0, N - 1] into size() portions of almost equal size. More...
 
constexpr int index_owner (int size, std::size_t index, std::size_t N)
 Return which process owns index (inverse of local_range) More...
 
template<typename T >
constexpr MPI_Datatype mpi_type ()
 MPI Type.
 

Detailed Description

MPI support functionality.

Function Documentation

◆ compute_graph_edges()

std::vector< int > dolfinx::MPI::compute_graph_edges ( MPI_Comm  comm,
const std::set< int > &  edges 
)
Todo:
Experimental. Maybe be moved or removed.

Compute communication graph edges. The caller provides edges that it can define, and will receive edges to it that are defined by other ranks.

Note
This function involves global communication
Parameters
[in]commThe MPI communicator
[in]edgesCommunication edges between the caller and the ranks in edges.
Returns
Ranks that have defined edges from them to this rank

◆ index_owner()

constexpr int dolfinx::MPI::index_owner ( int  size,
std::size_t  index,
std::size_t  N 
)
constexpr

Return which process owns index (inverse of local_range)

Parameters
[in]sizeNumber of MPI ranks
[in]indexThe index to determine owning rank
[in]NTotal number of indices
Returns
The rank of the owning process

◆ local_range()

constexpr std::array<std::int64_t, 2> dolfinx::MPI::local_range ( int  rank,
std::int64_t  N,
int  size 
)
constexpr

Return local range for given process, splitting [0, N - 1] into size() portions of almost equal size.

Parameters
[in]rankMPI rank of the caller
[in]NThe value to partition
[in]sizeThe number of MPI ranks across which to partition N

◆ neighbors()

std::tuple< std::vector< int >, std::vector< int > > dolfinx::MPI::neighbors ( MPI_Comm  neighbor_comm)
Todo:
Clarify directions

Return list of neighbors for a neighborhood communicator

Parameters
[in]neighbor_commNeighborhood communicator
Returns
source ranks, destination ranks