bamboost.mpi.utilities
Attributes
- _CT=
TypeVar('_CT', bound=Callable)
Functions
(instance) -> Generator[None, None, None]Context manager to temporarily change the communicator to MPI.COMM_SELF.
This context manager allows collective operations (which normally require execution across all ranks to prevent deadlocks) to be called from a single rank only, as MPI.COMM_SELF represents a single-rank communicator.
Arguments:
- instance:
HasCommAn instance of a class that has a _comm attribute (MPI communicator).
Classes
RootProcessMeta
A metaclass that makes classes MPI-safe by ensuring methods are only executed on
the root process. The class implementing this metaclass must have a _comm attribute
that is an MPI communicator.
This metaclass modifies class methods to either use broadcast communication (if decorated with @bcast) or to only execute on the root process (rank 0).
Attributes:
- __exclude__=
{'__init__', '__new__'}
(mcs, name, bases, attrs)Create a new class with MPI-safe methods.
Arguments:
- mcs
- name:
strThe name of the class being created.
- bases:
tupleThe base classes of the class being created.
- attrs:
dictThe attributes of the class being created.
Returns
(func) -> _CTDecorator that ensures a method is only executed on the root process (rank 0).
Arguments:
- func:
callableThe method to be decorated.
Returns
_CTThe wrapped method that only executes on the root process.(func)Arguments:
- func
Bamboost