lib.utils.ScatteredBaseClass¶
- class lib.utils.ScatteredBaseClass(**attrs)¶
Bases:
pypescript.utils.ScatteredBaseClassMethods
Return shallow copy of
self.deepcopyInstantiate and initalize class with state dictionary.
is_mpi_broadcastis_mpi_gatheredis_mpi_rootis_mpi_scatteredLoad class in numpy binary format from disk.
log_criticallog_debuglog_errorlog_infolog_warningmpi_broadcastReturn new instance corresponding to
selfon largermpicomm.Return new instance corresponding to
selfon smallermpicomm.mpi_gathermpi_recvmpi_scattermpi_sendReturn instance, changing current MPI state to
mpistate.Save class to disk.
Attributes
loggerMPI 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 incls._registry, return instance ofcls._registry[__class__](instead ofcls).
- classmethod mpi_collect(self=None, sources=None, mpicomm=None)¶
Return new instance corresponding to
selfon largermpicomm.- Parameters
self (object, None) – Instance to spread on
mpicomm.sources (list, None) – Ranks of processes of
mpicommwhereselflives. IfNone, takes the ranks of processes whereselfis notNone.mpicomm (MPI communicator) – New mpi communicator.
- Returns
new
- Return type
object
- mpi_distribute(dests, mpicomm=None)¶
Return new instance corresponding to
selfon smallermpicomm.- Parameters
self (object, None) – Instance to concentrate on
mpicomm.dests (list, None) – Ranks of processes of
mpicommwhere to sendselflives. IfNone, takes the ranks of processes whereselfis notNone.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.