backend#

class Backend(cfg: dict[str, Any] | None = None)#

Bases: ABC

type: str#
abstractmethod classmethod default_config() dict[str, Any]#

Return a complete default configuration for this backend.

abstract property resource_specs: list[dict]#
abstract property valid_launchers: set[str]#
classmethod matches(arg: str) bool#
property name: str#
abstractmethod submission_manager() HPCSubmissionManager#
abstractmethod launcher() HPCLauncher#
configure(cfg: dict[str, Any] | None = None) dict[str, Any]#
describe() str#
supports_subscheduling() bool#
supports_dependencies() bool#
validate() None#
property resource_index: dict[str, list[tuple[dict, str | None]]]#
make_resource_index() dict[str, list[tuple[dict, str | None]]]#

Map resource type -> list of (resource_spec, parent_type)

resource_types() list[str]#

Return the types of resources available

count_per_node(rtype: str, default: int | None = None) int#
count_per_socket(rtype: str, default: int | None = None) int#
property node_count: int#
property sockets_per_node: int#
nodes_required(**rtypes: int) int#

Nodes required to run tasks tasks. A task can be thought of as a single MPI rank

canonical_type_name(rtype: str) str#
resource_view(*, ranks: int | None = None, ranks_per_socket: int | None = None) dict[str, int]#

Return basic information about how to allocate resources on this machine for a job requiring ranks ranks.

Parameters#

ranksint

The number of ranks to use for a job

ranks_per_socketint

Number of ranks per socket, for performance use

Returns#

view:

view[‘np’] view[‘ranks’] view[‘nodes’] view[‘sockets’] view[‘ranks_per_socket’]

walk_resources(rspec: dict, *, parent_type: str | None = None) Generator[tuple[dict, str | None], None, None]#