coffee.mpi package¶
Submodules¶
coffee.mpi.mpiinterfaces module¶
Contains classes that abstract the MPI C API.
Classes in this module model the MPI node network and manage the relationship of the complete domain to each
- class coffee.mpi.mpiinterfaces.EvenCart(domain, boundary_data, *args, **kwds)[source]¶
Bases:
MPIInterface- collect_data(data)[source]¶
A method that collects all computed function values over all sub-grids managed by all MPI nodes and returns the amalgamated data if the rank of this process is 0.
This gives a way to get a single copy of all computed data so far. It does, however, assume that all subsequence processing occurs on a single MPI node. This is a bottle neck.
- Parameters:
data (numpy.ndarray) – The data to be communicated.
- Returns:
The collated data if MPI_Comm_Rank is 0, none otherwise.
- Return type:
None or numpy.ndarray
- communicate(data, b_data)[source]¶
Communicates the given data to appropriate neighbouring nodes.
- Parameters:
data (numpy.ndarray) – An array representing the values of the computed function over the sub-grid managed by the MPI node this code is being computed on.
b_data (grid.ABCBoundary) –
- Returns:
The returned data is a list of tuples. The first element of the tuple describes which grid points the communicated data relates to. The second element is the data received from whichever MPI node manages the sub-grid which looks after the relevant grid points.
- Return type:
list of tuples (list of slices, numpy.ndarray)
- class coffee.mpi.mpiinterfaces.MPIInterface(mpi_comm, *args, **kwds)[source]¶
Bases:
object- abstract communicate(data)[source]¶
Returns a list of tuples. The first element of each tuple is a slice representing the portion of data which corresponds to the second element of the tuple. The second element of the tuple is an array of data which are the communicated values that correspond to the positions described by the slice.