Table Of Contents

Previous topic

Command-line tools

Next topic

API Reference

This Page

synergia_workflow module

The synergia_workflow module provides support for parameterizing simulations, interacting with batch systems and keeping track of simulation runs.

Python-only Classes

class synergia_workflow.Options(name)

Define a set of command-line options. Hierarchical sets of option may be created with add_suboptions.

Parameters:name – The name for this set of options to appear in the --help output

The value of each option is available as a data member. The following example prints the (integer) value 4:

from synergia_workflow import Options
opts = Options("foo")
opts.add("bar", 4, "bar parameter")
add(option, default_value, doc_string, val_type=None, valid_values=None)

Add a new option definition

  • option – the name of the option. Must be a legal Python identifier.
  • default_value – the default value for the option. If None, val_type is required.
  • val_type – optionally specify the value type. Necessary if default value is None.
  • valid_values – an optional list of valid values. If specified, invalid values will raise an exception.

Add a set of suboptions.

Parameters:suboptions – An Options object

Get the name of this set of options


Returns true if option present.

Parameters:option – Name of option.

Returns a list of options.

Parameters:include_suboptions – whether to include suboptions

Parse command-line arguments from argv


Print usage message to stdout as a ReST table


Print usage message to stdout

class synergia_workflow.Job_manager(script, opts, extra_files=None, extra_dirs=None, argv=None, extra_opt_files=None, extra_opt_dirs=['lattice_cache'], standalone=False, subjob=False, subjob_index=0)

The main Synergia workflow class.

  • script – the name of the Synergia Python script or executable.
  • opts – an Options object containing the job options. The internally-defined job manager options will be added as a suboption to opts.
  • extra_files – a list of additional files required to run the job.
  • extra_dirs – a list of additional directories whose contents are required to run the job.
  • argv – the command-line arguments. Use sys.argv if None.
  • extra_opt_files – for internal use.
  • extra_opt_dirs – for internal use.
  • standalone – for internal use.
  • subjob – for internal use.
  • subjob_index – for internal use.
class synergia_workflow.Override

The Override class provides a way to override default options in an Options object. Data members of an Override instance named override will override default values in the built-in options.

Built-in Job_manager options

name type default description
account str None Batch system account, default=None
createjob bool False Whether to create new job directory, default=False
jobdir str run Job directory, default=run
multitemplate str multijob Base filename for multijob templates to look for in search path, default=multijob
multitemplatepath str None Full path to the base name for multijob templates, default=None
numproc int 1 Number of processes, default=1
overwrite bool False Whether to overwrite existing job directory, default=False
procspernode int 1 Number of processes per node, default=1
queue str None Batch system queue, default=None
resumemultitemplate str resumemultijob Base filename for resume multijob templates to look for in search path, default=resumemultijob
resumemultitemplatepath str None Full path to the base name for resume multijob templates, default=None
resumetemplate str resumejob Filename for resume job template to look for in search path, default=resumejob
resumetemplatepath str None Full path to a resume job template, default=None
run bool False Whether to immediately run job, default=False
setupsh str /usr/local/share/synergia/ Path to Synergia2 file, default=/usr/local/share/synergia/
submit bool False Whether to immediately submit job, default=False
synergia_executable str synergia Name or path of synergia executable, default=synergia
synergia_resume_executable str synergia-pyresume Name or path of synergia resume executable, default=synergia-pyresume
template str job Filename for job template to look for in search path, default=job
templatepath str None Full path to a job template, default=None
walltime str None Limit job to given wall time, default=None