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(comm, value)

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

static barrier(comm)

Set a barrier (synchronization point)

static compute_local_range(process, N, size)

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

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

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(comm, range, exclusive)

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

static index_owner(comm, index, N)

Return which process owns index (inverse of local_range)

static is_broadcaster(comm)

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

static is_receiver(comm)

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

static local_range(*args)

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(*args)

Return global max value

static min(*args)

Return global min value

static rank(comm)

Return process rank for the communicator

static size(comm)

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

static sum(*args)

Sum values and return sum

thisown

The membership flag