soupy.collectives

soupy.collectives.collective

class soupy.collectives.collective.MultipleSamePartitioningPDEsCollective(comm, is_serial_check=False)[source]

Bases: object

Parallel reduction utilities when several serial systems of PDEs (one per process) are solved concurrently.

Constructor: :param comm: MPI communicator :type comm : mpi4py.MPI.Comm

allReduce(v, op)[source]

Case handled: - v is a scalar (float, int); - v is a numpy array (NOTE: v will be overwritten) - v is a dolfin.Vector (NOTE: v will be overwritten) Operation: op = "Sum" or “Avg” (case insentive).

bcast(v, root=0)[source]

Case handled: - v is a scalar (float, int); - v is a numpy array (NOTE: v will be overwritten) - v is a dolfin.Vector (NOTE: v will be overwritten) - root refers to the process rank within the communicator for which the data to be broadcasted lives.

rank()[source]
size()[source]
soupy.collectives.collective.MultipleSerialPDEsCollective(comm)[source]
class soupy.collectives.collective.NullCollective[source]

Bases: object

No-overhead “Parallel” reduction utilities when a serial system of PDEs is solved on 1 process.

allReduce(v, op)[source]
bcast(v, root=0)[source]
rank()[source]
size()[source]

soupy.collectives.mpiUtils

soupy.collectives.mpiUtils.allocate_process_sample_sizes(sample_size, comm_sampler)[source]

Compute the number of samples needed in each process Return result as a list

Parameters:
  • sample_size (int) – Total number of samples

  • comm_sampler (mpi4py.MPI.Comm) – MPI communicator for sample allocation