matflow.ElementResources#

class matflow.ElementResources(scratch: 'Optional[str]' = None, parallel_mode: 'Optional[ParallelMode]' = None, num_cores: 'Optional[int]' = None, num_cores_per_node: 'Optional[int]' = None, num_threads: 'Optional[int]' = None, num_nodes: 'Optional[int]' = None, scheduler: 'Optional[str]' = None, shell: 'Optional[str]' = None, use_job_array: 'Optional[bool]' = None, max_array_items: 'Optional[int]' = None, time_limit: 'Optional[str]' = None, scheduler_args: 'Optional[Dict]' = None, shell_args: 'Optional[Dict]' = None, os_name: 'Optional[str]' = None, environments: 'Optional[Dict]' = None, SGE_parallel_env: 'str' = None, SLURM_partition: 'str' = None, SLURM_num_tasks: 'str' = None, SLURM_num_tasks_per_node: 'str' = None, SLURM_num_nodes: 'str' = None, SLURM_num_cpus_per_task: 'str' = None)#

Bases: ElementResources

Methods

from_json_like

get_default_os_name

get_default_scheduler

get_default_shell

get_env_instance_filterable_attributes

Get a tuple of resource attributes that are used to filter environment executable instances at submit- and run-time.

get_jobscript_hash

Get hash from all arguments that distinguish jobscripts.

set_defaults

to_dict

to_json_like

validate_against_machine

Validate the values for os_name, shell and scheduler against those supported on this machine (as specified by the app configuration).

Attributes

SGE_parallel_env

SLURM_is_parallel

Returns True if any SLURM-specific arguments indicate a parallel job.

SLURM_num_cpus_per_task

SLURM_num_nodes

SLURM_num_tasks

SLURM_num_tasks_per_node

SLURM_partition

app

environments

is_parallel

Returns True if any scheduler-agnostic arguments indicate a parallel job.

max_array_items

num_cores

num_cores_per_node

num_nodes

num_threads

os_name

parallel_mode

scheduler

scheduler_args

scratch

shell

shell_args

time_limit

use_job_array

Parameters:
  • scratch (str | None) –

  • parallel_mode (ParallelMode | None) –

  • num_cores (int | None) –

  • num_cores_per_node (int | None) –

  • num_threads (int | None) –

  • num_nodes (int | None) –

  • scheduler (str | None) –

  • shell (str | None) –

  • use_job_array (bool | None) –

  • max_array_items (int | None) –

  • time_limit (str | None) –

  • scheduler_args (Dict | None) –

  • shell_args (Dict | None) –

  • os_name (str | None) –

  • environments (Dict | None) –

  • SGE_parallel_env (str) –

  • SLURM_partition (str) –

  • SLURM_num_tasks (str) –

  • SLURM_num_tasks_per_node (str) –

  • SLURM_num_nodes (str) –

  • SLURM_num_cpus_per_task (str) –

SGE_parallel_env: str = None#
property SLURM_is_parallel: bool#

Returns True if any SLURM-specific arguments indicate a parallel job.

SLURM_num_cpus_per_task: str = None#
SLURM_num_nodes: str = None#
SLURM_num_tasks: str = None#
SLURM_num_tasks_per_node: str = None#
SLURM_partition: str = None#
app = App(name='MatFlow', version='0.3.0a129')#
environments: Dict | None = None#
classmethod from_json_like(json_like, shared_data=None)#
Parameters:
  • json_like (Union[Dict, List]) –

  • shared_data (Optional[Dict[str, ObjectList]]) –

static get_default_os_name()#
classmethod get_default_scheduler(os_name, shell_name)#
classmethod get_default_shell()#
static get_env_instance_filterable_attributes()#

Get a tuple of resource attributes that are used to filter environment executable instances at submit- and run-time.

Return type:

Tuple[str]

get_jobscript_hash()#

Get hash from all arguments that distinguish jobscripts.

property is_parallel: bool#

Returns True if any scheduler-agnostic arguments indicate a parallel job.

max_array_items: int | None = None#
num_cores: int | None = None#
num_cores_per_node: int | None = None#
num_nodes: int | None = None#
num_threads: int | None = None#
os_name: str | None = None#
parallel_mode: ParallelMode | None = None#
scheduler: str | None = None#
scheduler_args: Dict | None = None#
scratch: str | None = None#
set_defaults()#
shell: str | None = None#
shell_args: Dict | None = None#
time_limit: str | None = None#
to_dict()#
to_json_like(dct=None, shared_data=None, exclude=None, path=None)#
use_job_array: bool | None = None#
validate_against_machine()#

Validate the values for os_name, shell and scheduler against those supported on this machine (as specified by the app configuration).