ComputeResources

class openff.evaluator.backends.ComputeResources(number_of_threads=1, number_of_gpus=0, preferred_gpu_toolkit=GPUToolkit.auto, preferred_gpu_precision=GPUPrecision.mixed)[source]

An object which stores how many of each type of computational resource (threads or gpu’s) is available to a calculation worker.

__init__(number_of_threads=1, number_of_gpus=0, preferred_gpu_toolkit=GPUToolkit.auto, preferred_gpu_precision=GPUPrecision.mixed)[source]

Constructs a new ComputeResources object.

Parameters
  • number_of_threads (int) – The number of threads available to a calculation worker.

  • number_of_gpus (int) – The number of GPUs available to a calculation worker.

  • preferred_gpu_toolkit (GPUToolkit, optional) – The preferred toolkit to use when running on GPUs.

  • preferred_gpu_precision (GPUPrecision, optional) – The preferred precision level to use when runnin on GPUs.

Methods

__init__([number_of_threads, ...])

Constructs a new ComputeResources object.

Attributes

gpu_device_indices

The indices of the GPUs to run on.

number_of_gpus

The number of GPUs available to a calculation worker.

number_of_threads

The number of threads available to a calculation worker.

preferred_gpu_precision

The preferred precision level to use when running on GPUs.

preferred_gpu_toolkit

The preferred toolkit to use when running on GPUs.

class GPUToolkit(value)[source]

An enumeration of the different GPU toolkits to make available to different calculations.

class GPUPrecision(value)[source]

An enumeration of the different precision for GPU calculations.

property number_of_threads

The number of threads available to a calculation worker.

Type

int

property number_of_gpus

The number of GPUs available to a calculation worker.

Type

int

property preferred_gpu_toolkit

The preferred toolkit to use when running on GPUs.

Type

GPUToolkit

property preferred_gpu_precision

The preferred precision level to use when running on GPUs.

Type

GPUPrecision

property gpu_device_indices

The indices of the GPUs to run on. This is purely an internal implementation detail and should not be relied upon externally.

Type

str