qimpy.rc

Run configuration / hardware resources. This includes CPU cores or GPU, and MPI communicators to be used by the current QimPy instance. The import-time configuration selects a single CPU core for each MPI process in mpi4py.MPI.COMM_WORLD.

Call init to select the number of cores or a GPU device, as available and based on environment variables such as SLURM_CPUS_PER_TASK, as well as to initialize torch.distributed communication controlled by BACKEND and its standard environment variables MASTER_ADDR and MASTER_PORT. None of these environment variables are required; init uses MPI to determine a consistent address/port for the backend set-up.

Module Attributes

comm

Global communicator for QimPy

i_proc

Rank within comm

n_procs

Size of comm

is_head

Whether head of comm

cpu

CPU torch device

device

Preferred torch device for calculation (CPU / GPU)

use_accelerator

Whether device is an accelerator (GPU-like)

Functions

init

Initialize overall hardware resources to be used by QimPy.

free

Cleanup any resources initialized in init.

clock

Time in seconds since start of this run.

report_end

Report end time and duration.