LibraryHandle#

class cuquantum.pauliprop.experimental.LibraryHandle(
device_id: int | None = None,
logger: Logger | None = None,
)[source]#

Methods

__init__(
device_id: int | None = None,
logger: Logger | None = None,
)[source]#
get_communicator()[source]#

Return the communicator previously passed to set_communicator().

get_num_ranks() int[source]#

Return the number of distributed processes for this handle.

get_proc_rank() int[source]#

Return this process’s rank in the distributed configuration.

set_communicator(
comm: mpi4py.MPI.Comm | NcclCommunicator | DistributedContext | tuple[int, int] | int | None = None,
provider: Literal['MPI', 'NCCL'] | DistributedProvider | None = None,
) None[source]#

Register a communicator with this library handle.

provider is inferred from mpi4py.MPI.Comm, nccl.core.Communicator, and nvmath.distributed.DistributedContext (which supplies its NCCL communicator and therefore requires initialization with the "nccl" backend). Raw int / (ptr, size) inputs require an explicit provider. Before replacing or clearing a communicator, destroy all objects created from this handle.

Parameters:
  • comm – Communicator object, nvmath.distributed context, raw pointer, (ptr, size) pair, or None.

  • provider"MPI" or "NCCL" (uppercase), or a DistributedProvider. Optional when inferable. Pass no arguments, or pass comm=None, to restore single-process execution.

Attributes

device_id#