pygsti.tools.mpitools.sum_arrays

Contents

pygsti.tools.mpitools.sum_arrays#

sum_arrays(local_array, owners, comm)#

Sums arrays across all “owner” processors.

Parameters:
  • local_array (numpy.ndarray) – The array contributed by this processor. This array will be zeroed out on processors whose ranks are not in owners.

  • owners (list or set) – The ranks whose contributions should be summed. These are the ranks of the processors that “own” the responsibility to communicate their local array to the rest of the processors.

  • comm (mpi4py.MPI.Comm) – MPI communicator

Returns:

The summed local arrays.

Return type:

numpy.ndarray