Package schrodinger :: Package tasks :: Module jobtasks
[hide private]
[frames] | no frames]

Module jobtasks

Classes [hide private]
  RunMode
  JobOptions
  JobConfig
  AbstractJobTask
  CmdJobTask
  JobStatusLoop
Functions [hide private]
 
get_job_status_loop()
 
monitor_jobtask(jobtask)
 
get_project_name()
 
use_detached_jobs(host)
Returns boolean if we should use detached jobs.
 
make_schrodinger_cmd(cmdlist, mode=<RunMode.START: 1>)
 
get_first_hostname(host)
Given a host string, get the corresponding hosts list from jobcontrol and return the first hostname from that list.
 
result_server_option(host)
Return string value of result server argument.
 
job_belongs_to_panel(jobid, viewname)
Return True if jobid belongs to viewname of a panel.
 
cmdlist_to_cmd(cmdlist)
Converts a command list to a command string.
 
set_sh_file_flags(filename)
Variables [hide private]
  maestro = schrodinger.get_maestro()
  SCHRODINGER_VAR = '{$SCHRODINGER}'
  ATTACHED_FLAG = '-ATTACHED'
  DETACHED_FLAG = '-DETACHED'
  HOST_FLAG = '-HOST'
  DISP_FLAG = '-DISP'
  PROJ_FLAG = '-PROJ'
  VIEWNAME_FLAG = '-VIEWNAME'
  TMPLAUNCHDIR_FLAG = '-TMPLAUNCHDIR'
  _job_status_loop = None
hash(x)
  __package__ = 'schrodinger.tasks'
Function Details [hide private]

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.

get_first_hostname(host)

 

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

@type host: string
@param host:
    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.

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.

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

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