multiprocess

configure_max_memory_per_process(max_memory_per_process: int | float | None = 4000)[source]

Configure the maximum memory to use per process in MB.

Parameters:

max_memory_per_process – The maximum memory to use per process in MB.

configure_processes_and_threads(num_processes: int | None = None, num_threads_per_process: int | None = None) tuple[int, int][source]

Configure the number of processes and threads per process and set them in pyscf and numpy.

If the number of threads is not specified, it is defaulted to 1. If the number of processes is not specified, the maximum available number of processes given the number of cpu cores and threads per process is used.

Parameters:
  • num_processes – The number of processes to use.

  • num_threads_per_process – The number of threads per process to use.

get_memory_usage_in_mb()[source]

Get the memory usage of the current process in MB.

set_num_threads(num_threads: int)[source]

Set the number of threads to use in pyscf and numpy and torch.

unpack_args_for_imap(func)[source]

Decorator to unpack a single tuple argument for a function that is called with imap.