Runner class

Runners are run on systems (desktop/servers) where the atomistic simulations (or other related functions) are to be performed.

Supported Runners :header-rows: 1

Runner name

Runner Type

Description

SlurmRunner

Slurm

A cluster management and job scheduling system

TerminalRunner

Terminal

A terminal based runner for simple tasks

Multiple Runners can be attached to a database, running on their respective machines. The Runners distinguish their rows by the runner key_value_pairs of the database row.

The BaseRunner class defines basic functions for each kind of runner.

class runner.runner.BaseRunner(name, database='database.db', interpreter='#!/bin/bash', pre_runner_data=None, max_jobs=50, cycle_time=30, keep_run=False, run_folder='./', multi_fail=0, logfile=None)[source]

Runner runs tasks

Parameters:
  • database (str) – ASE database to connect

  • interpreter (str) – the interpreter for the shell

  • pre_runner_data (RunnerData) – pre-run runnerdata Files, tasks, and scheduler_options can be added to be added to all the runs handled by this runner.

  • max_jobs (int) – maximum number of jobs running at an instance

  • cycle_time (int) – time in seconds

  • keep_run (bool) – keep the folder in which the run was performed

  • run_folder (str) – the folder that needs to be populated

  • multi_fail (int) – The number of re-runs on failure

  • logfile (str) – log file for logging

classmethod from_database(name, database)[source]

Get runner from database

Parameters:
  • name (str) – name of runner

  • database (str) – database

Returns:

returns relevant runner class

Return type:

BaseRunner

get_job_id(input_id)[source]

Returns job id (slurm id, process id etc) depending on workflow manager of a running row.

Parameters:

input_id (int) – Row id

Returns:

job_id of input_id if running, else None

Return type:

int or None

get_status()[source]

Returns ids of each status

Returns:

dictionary of status, ids list

Return type:

dict

spool(_endless=True)[source]

Does the spooling of jobs

to_database(update=False)[source]

attaches runner to database

Parameters:

update (bool) – optional, update runner info if already exists

Status of run

The Runner runs based on a status key_value_pairs in the database. The status is given as:

Status :header-rows: 1

Status

Description

‘submit’

Indicates the Runner to submit the run, using RunnerData.

‘cancel’

Indicates the Runner to cancel the run.

‘running’

Runner indicates that the row function is running.

‘failed’

Runner indicates that the row function has failed.

‘done’

Runner indicates that the row function has completed.

Note

When the status is set to cancel, the Runner changes the status to ‘failed’ after cancelling the run.

Runners

The BaseRunner is inherited by following implemented runners: