lib.utils.ScatteredBaseClass

class lib.utils.ScatteredBaseClass(**attrs)

Bases: pypescript.utils.ScatteredBaseClass

Methods

copy

Return shallow copy of self.

deepcopy

from_state

Instantiate and initalize class with state dictionary.

is_mpi_broadcast

is_mpi_gathered

is_mpi_root

is_mpi_scattered

load

Load class in numpy binary format from disk.

log_critical

log_debug

log_error

log_info

log_warning

mpi_broadcast

mpi_collect

Return new instance corresponding to self on larger mpicomm.

mpi_distribute

Return new instance corresponding to self on smaller mpicomm.

mpi_gather

mpi_recv

mpi_scatter

mpi_send

mpi_to_state

Return instance, changing current MPI state to mpistate.

save

Save class to disk.

Attributes

logger

mpiattrs

MPI attributes

mpistate

copy()

Return shallow copy of self.

classmethod from_state(state, mpistate=1, mpiroot=0, mpicomm=None)

Instantiate and initalize class with state dictionary.

classmethod load(filename, mpiroot=0, mpistate=1, mpicomm=None)

Load class in numpy binary format from disk. If the loaded state contains __class__ and that exists in cls._registry, return instance of cls._registry[__class__] (instead of cls).

classmethod mpi_collect(self=None, sources=None, mpicomm=None)

Return new instance corresponding to self on larger mpicomm.

Parameters
  • self (object, None) – Instance to spread on mpicomm.

  • sources (list, None) – Ranks of processes of mpicomm where self lives. If None, takes the ranks of processes where self is not None.

  • mpicomm (MPI communicator) – New mpi communicator.

Returns

new

Return type

object

mpi_distribute(dests, mpicomm=None)

Return new instance corresponding to self on smaller mpicomm.

Parameters
  • self (object, None) – Instance to concentrate on mpicomm.

  • dests (list, None) – Ranks of processes of mpicomm where to send self lives. If None, takes the ranks of processes where self is not None.

  • mpicomm (MPI communicator) – New mpi communicator.

Returns

new

Return type

object, None

mpi_to_state(mpistate)

Return instance, changing current MPI state to mpistate.

property mpiattrs

MPI attributes

save(filename)

Save class to disk.