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

Class JobSpecificationArgsBuilder

object --+
         |
        JobSpecificationArgsBuilder

A helper class to create a JobSpecification from a specific (i.e. non-generic) set of command-line arguments.

Instance Methods [hide private]
 
__init__(self, args, use_schrodinger_run=True, schrodinger_product=None, use_jobname_log=False)
See TaskSpecificationBuilder.setCommandLine for argument descriptions.
 
_getTaskSpec(self)
 
_getRuntimeParams(self)
 
getJobSpec(self)
 
setJobname(self, jobname)
str or None
getJobname(self)
Get the job name set from runtime parameters if there is one
 
setProgramName(self, program_name)
 
_updateCommandLineArgs(self, task_spec, key, filename)
 
setInputFile(self, filename, key=None, jobname_source=False, runtime_path=None)
Indicate an argument as an input file.
 
setStderr(self, runtime_path, stream=False)
 
setStdout(self, runtime_path, stream=False)
 
setOutputFile(self, runtime_path, key=None, stream=False, incorporate=False)
 
addLicense(self, license_string, license_tokens)
 
setDriverReservesCores(self, reserved)
If passed True, the driver will allocate N slots matching -HOST hostname: N processes.
 
setJobUsesTPP(self, uses_tpp)
If uses_tpp is True, this job will reserve the number of cores specified from -TPP (Threads Per Process) on the command line.

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, args, use_schrodinger_run=True, schrodinger_product=None, use_jobname_log=False)
(Constructor)

 

See TaskSpecificationBuilder.setCommandLine for argument descriptions.

Parameters:
  • use_jobname_log - If True, set the STDOUT, STDERR as <JOBNAME>.log and stream it. Default is False.
  • schrodinger_run (bool)
Overrides: object.__init__

getJobname(self)

 

Get the job name set from runtime parameters if there is one

This will return any jobname set via command line or the setJobname function. It will not return any jobname set using jobname_source=True when setting an input/output file.

Returns: str or None
The current set job name, or None if no name is set

setInputFile(self, filename, key=None, jobname_source=False, runtime_path=None)

 

Indicate an argument as an input file.

Parameters:
  • key (str) - Use the provided key for the input file in the command-line arguments template. If not specified, will default to INPUT_<N>.
  • jobname_source (bool) - If True, use this file's root as the jobname.
  • 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).

setOutputFile(self, runtime_path, key=None, 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.
  • incoporate - If True, mark this file for incorporation in maestro. NOTE: Only one file can be declared incorporatable. Defaults to False. Optional.
  • incorporate (bool)

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 uses_tpp is True, this job will reserve the number of cores specified from -TPP (Threads Per Process) on the command line.

Currently we use -TPP N to mean two different things: 1) Reserve N processors for the job being launched. 2) Reserve N processors for each subjob of the job being launched.

Case 1 is the case that needs uses_tpp=True.