pynbody.array.shared

pynbody.array.shared#

Support for numpy arrays in shared memory.

See also

There is information about using shared arrays to create parallel workflows in Writing your own parallel code.

Functions

delete_dangling_shared_memory()

Ensures that all shared memory has been cleaned up.

get_num_shared_arrays_owned()

Returns the number of shared arrays currently owned by this process.

make_shared_array(dims, dtype[, zeros, ...])

Create or reconstruct an array of dimensions dims with the given numpy dtype, backed on shared memory.

pack(array[, transfer_ownership])

Turn an array backed onto shared memory into something that can be passed between processes

remote_map(pool, fn, *iterables)

Equivalent to pool.map, but turns any shared memory arrays into a reference that can be passed between processes.

shared_array_remote(fn)

A decorator for functions that are expected to run on a 'remote' process, accepting shared memory inputs.

unpack(array_description)

Reconstruct an array backed onto shared memory from a deconstructed array (returned by pack()).

Classes

SharedMemorySimArray(data[, units, sim])

A simulation array that is backed onto shared memory.

Exceptions

RemoteKeyboardInterrupt

SharedArrayNotFound

Modules

posix_detail

POSIX-specific shared memory implementation.