DOLFIN-X
DOLFIN-X C++ interface
Classes | Static Public Member Functions | List of all members
dolfinx::MPI Class Reference

This class provides utility functions for easy communication with MPI and handles cases when DOLFINX is not configured with MPI. More...

#include <MPI.h>

Classes

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

Static Public Member Functions

static int rank (MPI_Comm comm)
 Return process rank for the communicator.
 
static int size (MPI_Comm comm)
 Return size of the group (number of processes) associated with the communicator.
 
template<typename T >
static 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].
 
template<typename T >
static graph::AdjacencyList< T > neighbor_all_to_all (MPI_Comm neighbor_comm, const std::vector< int > &send_offsets, const std::vector< T > &send_data)
 Neighbourhood all-to-all. Send data to neighbours using offsets into contiguous data array. Offset array should contain (num_neighbours + 1) entries, starting from zero.
 
static std::vector< int > neighbors (MPI_Comm neighbor_comm)
 Return list of neighbours for a neighbourhood communicator. More...
 
static std::size_t global_offset (MPI_Comm comm, std::size_t range, bool exclusive)
 Find global offset (index) (wrapper for MPI_(Ex)Scan with MPI_SUM as reduction op)
 
static std::array< std::int64_t, 2 > local_range (int process, std::int64_t N, int size)
 Return local range for given process, splitting [0, N - 1] into size() portions of almost equal size.
 
static 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 >
static MPI_Datatype mpi_type ()
 MPI Type.
 

Detailed Description

This class provides utility functions for easy communication with MPI and handles cases when DOLFINX is not configured with MPI.

Member Function Documentation

◆ index_owner()

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

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

◆ neighbors()

std::vector< int > dolfinx::MPI::neighbors ( MPI_Comm  neighbor_comm)
static

Return list of neighbours for a neighbourhood communicator.

Parameters
[in]neighbor_commNeighborhood communicator

The documentation for this class was generated from the following files: