soupy.collectives
soupy.collectives.collective
- class soupy.collectives.collective.MultipleSamePartitioningPDEsCollective(comm, is_serial_check=False)[source]
Bases:
objectParallel 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: -
vis a scalar (float,int); -vis a numpy array (NOTE:vwill be overwritten) -vis adolfin.Vector(NOTE:vwill be overwritten) Operation:op = "Sum"or “Avg” (case insentive).
soupy.collectives.mpiUtils
- soupy.collectives.mpiUtils.allgather_vector_as_numpy(v)[source]
All gather a dolfin vector
vsuch that each process has a full copy of the numpy array representing v- Parameters:
v (dl.Vector) – Vector to gather
- Returns:
A numpy vector
v_npwith the full data ofvon every process
- 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