romtools.hpc.dispatchers.local_dispatcher#

Classes

LocalDispatcher([campaign_directory, ...])

Runs ROM workflows on the machine this process runs on.

class romtools.hpc.dispatchers.local_dispatcher.LocalDispatcher(campaign_directory='hpctools', logger=None, config=None)[source]#

Bases: BaseDispatcher

Runs ROM workflows on the machine this process runs on.

Paths address the local filesystem and commands run in a local bash shell rather than over SSH. That machine may itself be a cluster node, in which case submit_job() reaches the scheduler directly and results need no transferring; upload() copies the configured files into the run directory rather than sending them anywhere.

Parameters:
  • campaign_directory (str) – The directory jobs run in when given no run_directory

  • logger (Logger) – An instance of the Logger class for logging

  • config – A YAML path or a Configuration. Defaults to reading the command line.

run(cmd, run_directory=None)[source]#

Run a command on the local machine, from run_directory if given and the current working directory otherwise.

Returns a Result object (with stdout, stderr, exit_code, ok)

Parameters:
  • cmd (str)

  • run_directory (str)

Return type:

Result