Package schrodinger :: Package job :: Module launchapi
[hide private]
[frames] | no frames]

Module launchapi


Provide an API that allows a definition of a job.

A job is composed of two pieces:

  1) A task specification that defines a generic command-line invocation
     and defines what input files are needed and what output files are
     produced.
  2) Runtime parameters that include specific input and output filenames.

To launch a job, you must also provide a set of launch parameters, which
specify things like the job host, number of threads per process, etc.

There are two main ways to construct a JobSpecification from python.

The first way is to use the JobSpecificationBuilder. This requires the
creation of a TaskSpecification via the TaskSpecificationBuilder. In this
case, the command-line provided to the TaskSpecificationBuilder is in a
sense "abstract". It is a list of strings with variables in the form <KEY>
that can be plugged in with specific files at a later time by the
JobSpecificationArgsBuilder.

The second way is to use the JobSpecificationArgsBuilder. This allows the
creation of a JobSpecification from a "concrete" list of command-line
arguments. You must indicate the specific input and output files in the
command-line arguments so they can be transferred and retrieved.

The JobSpecificationBuilder is more work, but is preferred because it gives
more flexibility in JobSpecification use. For example, a function can be
created that allows a JobSpecification to be created from a list of
filenames. This gives the caller the advantage that they don't need
to construct the command-line arguments themselves. Use of a function like
this facilitates easy plugin to AppFramework2 guis.

Classes [hide private]
  TaskSpecificationError
  RuntimeParametersError
  SpecificationKeyError
An error thrown when a key is missing from a serialized specification.
  TaskSpecificationKeyError
  RuntimeParametersKeyError
  JobSpecificationKeyError
  TaskSpecification
A class that holds the information necessary to run a task on a compute resource.
  TaskSpecificationBuilder
A class for building up a TaskSpecification from a specific list of command-line arguments.
  _RuntimeParameters
A class to hold job-specific input and output filenames.
  _RuntimeParametersBuilder
  JobSpecification
This class provides a serializable job definiton and consists of a task specification along with runtime parameters.
  JobSpecificationBuilder
A helper class to create a JobSpecification from an existing TaskSpecification.
  JobSpecificationArgsBuilder
A helper class to create a JobSpecification from a specific (i.e.
Functions [hide private]
 
check_valid_key(key)
Make sure the provided key is valid.
 
var(string)
Format the provided string to be used as a variable in the TaskSpecification command-line template.
 
_filename_uses_jobname(filename)
Check whether the file depends on the JOBNAME key.
Variables [hide private]
  mmshare_exec = '/scr/buildbot/savedbuilds/NB/2016-4/build-126/...
  _KEY_RE = re.compile(r'[a-zA-Z][a-zA-Z_0-9]+')
  _VAR_RE = re.compile(r'<([a-zA-Z][a-zA-Z_0-9]+)>')
  _JOBNAME_KEY = 'JOBNAME'
  _STDOUT_KEY = 'STDOUT'
  _STDERR_KEY = 'STDERR'
  _RESERVED_KEYS = set(['JOBNAME', 'STDERR', 'STDOUT'])
  _DEFAULT_STDERR = 'stderr'
  _DEFAULT_STDOUT = 'stdout'
  _RESERVED_OUTPUT_FILENAMES = ('stderr', 'stdout')
  _COMMAND_LINE_ARGUMENTS = 'command_line_arguments'
  _FILENAME_SOURCE = 'filename_source'
  _HOST = 'host'
  _INCORPORATE = 'incorporate'
  _INPUT = 'input'
  _INPUT_FILE = 'input_file'
  _INPUT_FILENAME = 'input_filename'
  _JOB_USES_TPP = 'job_uses_tpp'
  _JOBNAME = 'jobname'
  _LICENSES = 'licenses'
  _OUTPUT = 'output'
  _OUTPUT_FILE = 'output_file'
  _OUTPUT_FILENAME = 'output_filename'
  _DRIVER_RESERVES_CORES = 'processes_consumed_by_driver'
  _PRODUCT = 'product'
  _PROGRAM_NAME = 'progname'
  _RUNTIME_PARAMETERS = 'runtime_parameters'
  _RUNTIME_PATH = 'runtime_path'
  _SCHRODINGER = 'schrodinger'
  _SOURCE = 'source'
  _STREAM = 'stream'
  _TASK_SPECIFICATION = 'task_specification'
  _TYPE = 'type'
  _USE_RUN = 'use_run'
  _VALUE = 'value'
  _TASK_INPUT_TYPES = set(['input_filename', 'output_filename'])
  _RUNTIME_INPUT_TYPES = set(['input_file', 'output_filename'])
  __package__ = 'schrodinger.job'
Function Details [hide private]

check_valid_key(key)

 

Make sure the provided key is valid. Raise a RuntimeError if it's not.


Variables Details [hide private]

mmshare_exec

Value:
'/scr/buildbot/savedbuilds/NB/2016-4/build-126/mmshare-v3.6/bin/Linux-\
x86_64'