schrodinger.tasks.jobtasks module

class schrodinger.tasks.jobtasks.AbstractJobTask(*args, **kwargs)

Bases: schrodinger.tasks.tasks.AbstractTask

appendConfigFlags(cmdlist)
fullCmdList()

Returns the full cmd list for the job. This will take into account the run_mode specified in the job_config.

getSchrodingerRun()

Returns the correct version of the $SCHRODINGER/run string. This will depend on whether the intent is to start or to write the job.

getWriteFilename()
isRunning()
job_config
job_configChanged
job_dir
job_dirChanged
job_options
job_optionsChanged
makeCmdList()

Implement this to generate a cmdlist. This cmdlist will be used for write functionality.

makeSchrodingerCmd(*args)

Builds a $SCHRODINGER command string from all the args passed in. The resulting string is suitable for use in a cmdlist and formatted for use in starting or writing the job depending on self.run_mode. In START mode, the $SCHRODINGER environment variable will be expanded. In WRITE mode, it will stay as $SCHRODINGER and the path will be delimited with linux-style forward slashes.

Example: self.makeSchrodingerCmd(‘utilities’, ‘my_utility’) will return “${SCHRODINGER}/utilities/my_utility” in WRITE mode.

start()
updateStatusText()
write()
class schrodinger.tasks.jobtasks.CmdJobTask(*args, **kwargs)

Bases: schrodinger.tasks.jobtasks.AbstractJobTask

makeCmdList()

This is the main method that needs to be implemented to define a specific cmd job runner. It should just return a complete cmd list for the job to be launched. Standard job options should be left off.

class schrodinger.tasks.jobtasks.JobConfig(*args, **kwargs)

Bases: schrodinger.models.parameters.CompoundParam

addDispFlag(cmdlist)
addHostFlag(cmdlist)
addProjFlag(cmdlist)
addResultServerFlag(cmdlist)
addTmpLaunchDirFlag(cmdlist)
addViewnameFlag(cmdlist)
appendFlags(cmdlist)

Takes a cmdlist and appends the standard configuration flags appropriate for the context. This will depend on whether the intent is to start or write the job and whether maestro is available.

Any flag that already exists in the cmdlist will take precedence and that flag will not be automatically appended.

Parameters:cmdlist (list) – the original command list.
applySettings(settings)
cpus
cpusChanged
disp
dispChanged
host
hostChanged
host_text
host_textChanged
job_options
job_optionsChanged
jobname
jobnameChanged
proj
projChanged
summaryText()

Generates the text to display in the status bar via the updateStatusText method.

viewname
viewnameChanged
class schrodinger.tasks.jobtasks.JobOptions(default_value=None, **kwargs)

Bases: schrodinger.models.parameters.CompoundParam

cpus
cpusChanged
create_job_dir
create_job_dirChanged
default_disp
default_dispChanged
host
hostChanged
incorporation
incorporationChanged
class schrodinger.tasks.jobtasks.JobStatusLoop

Bases: PyQt5.QtCore.QObject

monitorJobTask(jobtask)
updateNow()
class schrodinger.tasks.jobtasks.RunMode

Bases: enum.Enum

START = 1
STU = 3
WRITE = 2
schrodinger.tasks.jobtasks.cmdlist_to_cmd(cmdlist)

Converts a command list to a command string. Don’t do this if you can possibly avoid it.

subprocess.list2cmdline() is not sufficient because it won’t quote env vars like $SCHRODINGER (which can expand to “path with spaces”

Parameters:cmdlist (list) – a list of commands
Returns:sh interpolable list
schrodinger.tasks.jobtasks.get_first_hostname(host)

Given a host string, get the corresponding hosts list from jobcontrol and return the first hostname from that list.

Parameters:host (string) –
Hosts string which determine the string value of result server argument. These are values usually from configuration dialog and is of the form “galina” or “galina:1” or “galina,monica” or “galina:2,monica:3” or “galina monica” or “galina:2 monica:3”.
rtype:str
return:Hostname based on the first of the first hosts in the jobcontrol list.
schrodinger.tasks.jobtasks.get_job_status_loop()
schrodinger.tasks.jobtasks.get_project_name()
schrodinger.tasks.jobtasks.job_belongs_to_panel(jobid, viewname)

Return True if jobid belongs to viewname of a panel. Used by incorporation callbacks to determine if the job belongs to us.

Parameters:
  • jobid (str) – jobid for a given job
  • viewname (str) – viewname corresponding to panel
schrodinger.tasks.jobtasks.make_schrodinger_cmd(cmdlist, mode=<RunMode.START: 1>)
schrodinger.tasks.jobtasks.monitor_jobtask(jobtask)
schrodinger.tasks.jobtasks.result_server_option(host)

Return string value of result server argument.

Parameters:host (string) – Hosts string which determine the string value of result server argument. These are values usually from configuration dialog and is of the form “galina” or “galina:1” or “galina,monica” or “galina:2,monica:3” or “galina monica” or “galina:2 monica:3”. And based on ‘serverhost’ field of the first host, the result server argument is returned.
schrodinger.tasks.jobtasks.set_sh_file_flags(filename)
schrodinger.tasks.jobtasks.use_detached_jobs(host)

Returns boolean if we should use detached jobs.

Parameters:host (string) – Hosts string which determine the string value of result server argument. These are values usually from configuration dialog and is of the form “galina” or “galina:1” or “galina,monica” or “galina:2,monica:3” or “galina monica” or “galina:2 monica:3”. And based on ‘serverhost’ field of the first host, return boolean if we should use detached jobs.