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

Class TaskSpecificationBuilder

object --+
         |
        TaskSpecificationBuilder

A class for building up a TaskSpecification from a specific list of command-line arguments.

Instance Methods [hide private]
 
__init__(self, data=None)
x.__init__(...) initializes x; see help(type(x)) for signature
 
getTaskSpec(self)
Return a TaskSpecification from this builder.
 
setCommandLine(self, args, use_schrodinger_run=True, schrodinger_product=None)
Set the command line as provided.
 
setInputFile(self, key, jobname_source=False)
Set an input file for the task specification.
 
addLicense(self, license_name, license_tokens)
 
setOutputFile(self, key, runtime_path, stream=False, incorporate=False)
 
_setStdStreamLocation(self, key, runtime_path, stream=False)
Specify a file for stderr or stdout to be redirected to.
 
setStderr(self, runtime_path, stream=False)
 
setStdout(self, runtime_path, stream=False)
 
setProgramName(self, program_name)
 
setDriverReservesCores(self, reserved)
If passed True, the driver will allocate N slots matching -HOST hostname: N processes.
 
setJobUsesTPP(self, uses_tpp)
If passed True, this job will reserve the number of cores specified from -TPP on the cmdline.
 
_fromData(self, data)
 
_loadCommandLine(self, data)
Verify and load the command-line specification from the JSON data.
 
_loadInputSpec(self, data)
 
_loadJobname(self, data)
Load the optional jobname spec.
 
_loadOutputSpec(self, data)
Load the optional output spec.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, data=None)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

setCommandLine(self, args, use_schrodinger_run=True, schrodinger_product=None)

 

Set the command line as provided. Add a SCHRODINGER/run if requested.

Parameters:
  • args (list of str) - The command-line script and arguments.
  • use_schrodinger_run - If True, run the command under $SCHRODINGER/run.
  • schrodinger_product (str) - A product directory to search for the script/executable. This should be the name of a directory under SCHRODINGER without the trailing version (i.e. the "-v*" part).
  • schrodinger_run (bool)

addLicense(self, license_name, license_tokens)

 
Parameters:
  • license_name (schrodinger.infra.licensing.MMLIC3*) - Name of a license token that is checked out.
  • license_tokens (str) - The number of tokens required by this job type.

setOutputFile(self, key, runtime_path, stream=False, incorporate=False)

 
Parameters:
  • runtime_path (str) - The path of an ouptut file that will be generated. May contain input keys in the form <KEY> or <JOBNAME> (if a jobname source has been specified).
  • key (str) - A key to be used to reference this output file.
  • stream (bool) - If True and if possible, the output file will be streamed back while the job is running. Defaults to False. Optional.

_setStdStreamLocation(self, key, runtime_path, stream=False)

 

Specify a file for stderr or stdout to be redirected to.

Parameters:
  • key (str) - _STDERR_KEY or _STDOUT_KEY
  • runtime_path (str) - A runtime_path with input keys in the form <KEY>.
  • stream (bool) - If True and if possible, the file will be streamed back while the job is running. Defaults to False. Optional.

setStderr(self, runtime_path, stream=False)

 
Parameters:
  • runtime_path (str) - A runtime_path template with input keys in the form <KEY>.
  • stream (bool) - If True and if possible, the file will be streamed back while the job is running. Defaults to False. Optional.

setStdout(self, runtime_path, stream=False)

 
Parameters:
  • runtime_path (str) - A runtime_path template with input keys in the form <KEY>.
  • stream (bool) - If True and if possible, the file will be streamed back while the job is running. Defaults to False. Optional.

setDriverReservesCores(self, reserved)

 

If passed True, the driver will allocate N slots matching -HOST hostname: N processes. This is useful when the driver allocates parallel slots on one node so it can resubmit jobs to localhost. If no N is specified, assume to be 1.

This is an optimization to avoid resubmission back to the queue if we know we are running a set of parallel jobs with the same CPU requirements.

setJobUsesTPP(self, uses_tpp)

 

If passed True, this job will reserve the number of cores specified from -TPP on the cmdline. Unfortunately, we use -TPP N to mean two things

1) this job will reserve N processors on one node directly 2) this job takes -TPP as a cmdline argument, but only to pass along to subjobs

In case 1, the uses_tpp should be set to True.