Core job control for python.
There are currently four major sections of this module - "Job
database," "Job launching," "Job backend," and
"Job hosts." The job database section deals with getting info
about existing Jobs, the job launching section deals with starting up a
subjob, and the job backend section provides utilities for a python
script running as a job.
The philosophy of this module is to reinvent as little as possible
(i.e. use the mmjob C libs where we can) and keep things fairly simple.
If we need more complicated features of job control, we can hopefully add
them as we go along.
Copyright Schrodinger, LLC. All rights reserved.
|
get_maestro()
Can't do this at import, as jobcontrol.py is imported very early in
maestro startup, and this will fail. |
|
|
|
|
|
read(file_)
Create and return a Job object from a jobcontrol file. |
|
|
|
get_jobs(username='
' ,
query=' all ' )
Return a list of Jobs in the database. |
|
|
|
get_job_selection(username='
' )
Return a list of jobs from the current mmjob query selection. |
|
|
|
launch_job(cmd,
print_output=False,
expandvars=True)
Run a process under job control and return a Job object. |
|
|
|
_fix_cmd(cmd,
expandvars=True)
A function to clean up the command passed to launch_job. |
|
|
|
_fix_launch_cmd(cmd)
Split the string command into program and arguments, then fix the
program path if necessary. |
|
|
|
_fix_program_path(prog)
If the program executable doesn't exist as a file and isn't an
absolute path, prepend the SCHRODINGER directory if it exists there. |
|
|
|
get_backend()
A convenience function to see if we're running under job control. |
|
|
|
get_runtime_path(pathname)
Return the runtime path for the input file 'pathname'. |
|
|
|
under_job_control()
Returns True if this process is running under job control; False
otherwise. |
|
|
|
|
|
get_hosts()
Return a list of all Hosts in the schrodinger.hosts file. |
|
|
|
get_host(name)
Return a Host object for the named host. |
|
|
|
_get_host(name)
Return a Host object for 'name', with all attributes read in from the
corresponding entry in schrodinger.hosts file. |
|
|
|
host_str_to_list(hosts_str)
Convert a hosts string (Ex: "galina:1 monica:4") to a list
of tuples. |
|
|
|
host_list_to_str(host_list)
Converts a hosts list (Ev: [ ('host1',1), ('host2', 10) ] ) to a
string. |
|
|
|
get_command_line_host_list()
Return a list of (host, ncpu) tuples corresponding to the host list
that is specified on the command line. |
|
|
|
get_backend_host_list()
Return a list of (host, ncpu) tuples corresponding to the host list
as determined from the SCHRODINGER_NODEFILE. |
|
|
|
calculate_njobs(host_list=None)
Derive the number of jobs from the specified host list. |
|
|
|
__doc__ = "...
|
|
_version = ' $Revision: 1.105 $ '
|
|
logger = logging.getLogger("schrodinger.jobcontrol")
|
|
profiling = 0
hash(x)
|
|
jobid_re = re.compile(r'(?im) ^JobId:\s+ ( \S+ ) ')
|
|
timestamp_format = ' %Y-%m-%d-%H:%M:%S '
|
|
entry_fields = [ ' name ' , ' base ' , ' host ' , ' schrodinger ' , ' tmpdir ...
|
|
entry_number = { ' accountcodes ' : 21, ' base ' : 1, ' env ' : 5, ' gpgp ...
|
|
_job_manager = _JobManager()
|
|
_backend_singleton = None
hash(x)
|
|
_backend_hosts = [ ]
|
|
__package__ = ' schrodinger.job '
|
|
k = ' accountcodes '
|
|
v = 21
|