pygsti.tools.mpitools

pygsti.tools.mpitools#

Functions for working with MPI processor distributions

Functions

build_slurm_script(*, job_name, nodes, ...)

Build and return the text of a SLURM batch script.

closest_divisor(a, b)

Returns the divisor of a that is closest to b.

compute_blas_threads(num_ranks, ...)

Return the number of BLAS threads that should be assigned to each MPI rank on the current node, assuming num_ranks in total.

distribute_for_dot(a_shape, b_shape, comm)

Prepares for one or multiple distributed dot products given the dimensions to be dotted.

distribute_indices(indices, comm[, ...])

Partition an array of indices (any type) evenly among comm's processors.

distribute_indices_base(indices, nprocs, rank)

Partition an array of "indices" evenly among a given number of "processors"

distribute_slice(s, comm[, allow_split_comm])

Partition a continuous slice evenly among comm's processors.

gather_indices(indices, index_owners, ...[, ...])

Gathers data within a numpy array, ar_to_fill, according to given indices.

gather_slices(slices, slice_owners, ...[, ...])

Gathers data within a numpy array, ar_to_fill, according to given slices.

gather_slices_by_owner(current_slices, ...)

Gathers data within a numpy array, ar_to_fill, according to given slices.

mpi4py_comm()

Get a comm object

mpidot(a, b, loc_row_slice, loc_col_slice, ...)

Performs a distributed dot product, dot(a,b).

parallel_apply(f, l, comm)

Apply a function, f to every element of a list, l in parallel, using MPI.

processor_group_size(nprocs, number_of_tasks)

Find the number of groups to divide nprocs processors into to tackle number_of_tasks tasks.

resolve_mpiexec(mpiexec)

Return the resolved absolute path to an MPI launcher executable.

slice_up_range(n, num_slices[, start])

Divides up range(start,start+n) into num_slices slices.

slice_up_slice(slc, num_slices)

Divides up slc into num_slices slices.

sum_across_procs(x, comm)

Sum a value across all processors in comm.

sum_arrays(local_array, owners, comm)

Sums arrays across all "owner" processors.

write_mpi_runner_artifacts(protocol_obj, ...)

Serialize a protocol run into a self-contained directory for MPI workers.