MPI

class dolfin.cpp.common.MPI

Bases: object

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

static MPI_AVG()

Return average reduction operation; recognized by all_reduce(MPI_Comm, Table&, MPI_Op)

static avg()

Return average across comm; implemented only for T == Table

static barrier()

Set a barrier (synchronization point)

static compute_local_range()

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

static gather()

Overloaded versions

  • gather(comm, in_values, out_values, receiving_process=0)

    Gather values on one process

  • gather(comm, in_values, out_values, receiving_process=0)

    Gather strings on one process

static global_offset()

Find global offset (index) (wrapper for MPI_(Ex)Scan with MPI_SUM as reduction op)

static index_owner()

Return which process owns index (inverse of local_range)

static is_broadcaster(comm: dolfin.cpp.common.MPI_Comm) → bool

Determine whether we should broadcast (based on current parallel policy)

static is_receiver(comm: dolfin.cpp.common.MPI_Comm) → bool

Determine whether we should receive (based on current parallel policy)

static local_range()

Overloaded versions

  • local_range(comm, N)

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

  • local_range(comm, process, N)

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

static max()

Return global max value

static min()

Return global min value

static rank()

Return process rank for the communicator

static size()

Return size of the group (number of processes) associated with the communicator

static sum()

Sum values and return sum

thisown

The membership flag