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")
print opts.bar
add(option, default_value, doc_string, val_type=None, valid_values=None)

Add a new option definition

Parameters:
  • 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_suboptions(suboptions)

Add a set of suboptions.

Parameters:suboptions – An Options object
get_name()

Get the name of this set of options

has_option(option)

Returns true if option present.

Parameters:option – Name of option.
options(include_suboptions=True)

Returns a list of options.

Parameters:include_suboptions – whether to include suboptions
parse_argv(argv)

Parse command-line arguments from argv

rst_usage()

Print usage message to stdout as a ReST table

usage()

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.

Parameters:
  • 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/setup.sh Path to Synergia2 setup.sh file, default=/usr/local/share/synergia/setup.sh
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