ptypy.utils.parallel#

Utility functions and classes to support MPI computing.

This file is part of the PTYPY package.

copyright:

Copyright 2014 by the PTYPY team, see AUTHORS.

license:

see LICENSE for details.

Functions

MPImax(a[, axis])

Compute the maximum over a list of arrays distributed over multiple processes.

MPImin(a[, axis])

Compute the minimum over a list of arrays distributed over multiple processes.

MPInoise2d(sh[, rms, mfs, rms_mod, mfs_mod])

Creates complex-valued statistical noise in the shape of sh consistent across all nodes.

MPIprod(a[, axis])

Compute the product over a list of arrays distributed over multiple processes.

MPIrand_normal([loc, scale, size])

Wrapper for np.random.normal for same random sample across all nodes.

MPIrand_uniform([low, high, size])

Wrapper for np.random.uniform for same random sample across all nodes.

MPIsum(a[, axis])

Compute the sum of list of arrays distributed over multiple processes.

allgather_dict(dct)

Allgather dict in place.

allreduce(a[, op])

Wrapper for comm.Allreduce, always in place.

allreduceC(c)

Performs MPI parallel allreduce with a sum as reduction for all Storage instances held by Container c

barrier()

Wrapper for comm.Barrier.

bcast(data[, source])

Wrapper for comm.bcast and comm.Bcast.

bcast_dict(dct[, keys, source])

Broadcasts or scatters a dict dct from rank==source.

gather_dict(dct[, target])

Gathers broadcasted or scattered dict dct at rank target.

gather_list(lst, length, indices)

gathers list lst of all processes to a list of length length according to order given by indices.

receive([source, tag])

Wrapper for comm.Recv.

send(data[, dest, tag])

Wrapper for comm.Send and comm.send.

useMPI([do])

Toggle using MPI or not.

Classes