schrodinger.job.launchparams module

class schrodinger.job.launchparams.ProjectDisposition(value)

Bases: enum.Enum

An enumeration.

NONE = 'None'
APPEND = 'append'
APPENDNEW = 'appendnew'
APPEND_FIT = 'append:fit'
IGNORE = 'ignore'
CUSTOM = 'custom'
ADDTOENTRY = 'addtoentry'
APPENDINPLACE = 'appendinplace'
APPENDINPLACE_FIT = 'appendinplace:fit'
APPENDUNGROUPED = 'appendungrouped'
REPLACE = 'replace'
REPLACE_FIT = 'replace:fit'
WORKSPACE = 'workspace'
class schrodinger.job.launchparams.LaunchParameters

Bases: object

These are parameters that can change with each job launch.

__init__()

Initialize self. See help(type(self)) for accurate signature.

setDebugLevel(debug_level)
Parameters

save (bool) – if True, copy back full output directory as zip

getDebugLevel()

Returns debug level (integer)

setDeleteAfterIncorporation(delete)
Parameters

delete (bool) – if True, the directory the job was launched from is deleted after incporation

setSaveAllJobOutput(save)
Parameters

save (bool) – if True, copy back full output directory as zip

setLaunchDirectory(launch_directory)

Sets cwd for job launch. This avoids a chdir command before calling launch potentially allowing for more than one launch from maestro.

getLaunchDirectory()

Sets cwd for job launch. This avoids a chdir command before calling launch potentially allowing for more than one launch from maestro.

setHostname(hostname)

Hostname is the name of the host to run the job on. This name needs to correspond to something in schrodinger.hosts file or DNS-resolveable.

Parameters

hostname (str) – name of host

getHostname()

Returns hostname is the name of the host to run the job on. This name needs to correspond to something in schrodinger.hosts file or DNS-resolveable.

getSubHostName() → Optional[str]

Returns None if -SUBHOST isn’t set and the hostname if -SUBHOST is set.

getJobname()

Return the jobname.

setJobname(jobname)

Jobname is a non mandatory variable that can be used to indicate name of job in job record.

Parameters

jobname (str) – name of job

getMaestroViewname()

Viewname is used by a maestro panel to identify a job as belonging to a panel.

Returns

viewname name of panel

Return type

str

setMaestroViewname(viewname)

Viewname is used by a maestro panel to identify a job as belonging to a panel.

Parameters

viewname (str) – name of panel

getMaestroProjectDisposition()

:returns ProjectDisposition

getMaestroProjectDispositionString()

:returns str matching project disposition, appropriate for cmdline

setMaestroProjectDisposition(disp)

Mark the state of project incorporation.

Parameters

disp (ProjectDisposition) – should we incorporate?

getMaestroProjectName()

Returns associated project for a job, marking which project should do the incorporation of results.

Returns

path to project

Return type

str

setMaestroProjectName(project)

Set associated project for a job, marking which project should do the incorporation of results.

Parameters

project (str) – path to project

setNumberOfProcessorsManyNodes(nprocessors)

Set number of processors to allocate to a job. These may be across multiple nodes. Used by MPI jobs to indicate how many processors the queuing system needs to allocate.

Parameters

nprocessors (int greater than 0) – number of processors requested for this job

setNumberOfSubjobs(nsubjobs)

Set number of subjobs that a job could run. This is used by workflow jobs to indicate that a driver job might run and use subjobs. This value is NOT used by the queueing system, but can be accessed from inside the job.

Parameters

nsubjobs – number of subjobs

getNumberOfProcessorsManyNodes()

Get number of processors to allocate to a job. Used by MPI jobs.

For example 4 processors = 4 nodes allocated by single jobs.

getNumberOfSubjobs()

Get number of subjobs that a job may run. This value is used by product backend (not jobcontrol).

In a workflow job, 4 process = 4 jobs running simultaneously.

setNumberOfProcessorsOneNode(nprocessors)

Set number of processors on one node. Useful for OpenMP-type jobs, indicates to the queueing system to allocate the requisite number of processors on the same node..

Parameters

nprocessors (int greater than 0) – number of processors requested for this job

getNumberOfProcessorsOneNode()

Return number of processors on one node. Useful for OpenMP-type jobs, indicates to the queueing system to allocate the requisite number of processors on the same node.

Returns

number of processors requested for this job

Return type

int greater than 0

getTPP()

Return the TPP option set by toplevel.py only.

setTPP(tpp)

Sets the TPP option on the cmdline. This will not be used by the parent job unless jobUsesTPP is set in the job specification.

setOPLSDir(oplsdir)
getNumberOfQueueSlots()

Return the number of slots we need to request for the queueing system. This value current maps to NPROC. If we don’t know how many, return None.

verify()
constructHostArg()
convertToJLaunchOptions()

Validate state of Launch Parameters (may throw RuntimeError) and return list of cmdline parameters.

Returns

list of str

convertToEnv()

Converts LaunchParameters to environment. Not all parameters are supported. This option should be limited to use by toplevel.py if possible.

consumeCommandLine(cmdline)

This consumes arguments from cmdline. The primary purpose is to consume arguments from toplevel $SCHRODINGER/run.

:returns cmdline with options filtered out.

exception schrodinger.job.launchparams.ArgumentParserError

Bases: Exception

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.