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.
|
|
|
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_qapp()
Launch QCoreApplication so mmjob can run async calls under the hood. |
|
|
|
launch_job(cmd,
print_output=False,
expandvars=True,
launch_dir=None)
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. |
|
|
|
list2jmonitorcmdline(cmdlist)
Turn a command in list form to a single string that can be executed
by jmonitor. |
|
|
|
|
|
|
|
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_hostfile()
Return the name of the schrodinger.hosts file last used by
get_hosts(). |
|
|
|
hostfile_is_empty(host_filepath)
Return if the given host_filepath host is empty, meaning it contains
only the localhost entry. |
|
|
|
get_installed_hostfiles(root_dir='
' )
Return the pathname for the schrodinger.hosts file installed in the
most recent previous installation directory we can find. |
|
|
|
get_hosts()
Return a list of all Hosts in the schrodinger.hosts file. |
|
|
|
|
tuple
|
hostfile_is_valid(fname)
Returns:
a (bool, str) tuple indicating whether the host file is valid |
|
|
|
to_hostfile(hosts)
Return a string representation for the given list of Host objects
that would be suitable for use as a hosts file. |
|
|
|
sorted_hosts(hosts)
Return a list of the given Host objects re-ordered to satisfy the
conditions that,
1. |
|
|
|
get_host(name)
Return a Host object for the named host. |
|
|
|
_get_num_hosts()
Returns the number of hosts in the schrodinger.hosts file. |
|
|
|
_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 ' , ' nodelist ' , ' user ' , ' q ...
|
|
field_sortkey = { ' accountcodes ' : 22, ' base ' : 1, ' env ' : 13, ' gp ...
|
|
INSTALL_ROOT = ' /opt/schrodinger '
|
|
HOSTS_FILE = ' schrodinger.hosts '
|
|
qapp = None
hash(x)
|
|
_job_manager = _JobManager()
|
|
_backend_singleton = None
hash(x)
|
|
_backend_hosts = [ ]
|
|
__package__ = ' schrodinger.job '
|
|
k = ' accountcodes '
|
|
v = 22
|