clusterjob.backends.sge module¶
SGE (Sun Grid Engine) backend
-
class
clusterjob.backends.sge.SgeBackend[source]¶ Bases:
clusterjob.backends.ClusterjobBackendSGE Backend
Attributes: - name (str) – Name of the backend
- extension (str) – Extension for job scripts
- prefix (str) – The prefix for every line in the resource header
- resource_replacements (dict) – mapping of the common clusterjob resource keys to command line options of the qsub command.
- job_vars (dict) – mapping of core environment variables to PBS-specific environment variables.
Note
Nodes and threads are not directly supported on SGE, but must be set up using “parallel environments”. The configuration is set by the administrator so you have to check what they’ve called the parallel environments:
%> qconf -spl pe1 omp
look for one with
$pe_slotsin the config:%> qconf -sp pe1 %> qconf -sp omp
Call
qsubwith that environment and number of cores you want to use:qsub -pe omp 8 -cwd ./myscript
Depending on how the cluster is set up, it may be necessary to pass the shell as e.g.
-S /bin/bash. If this definition is missing, the run can crash with some very unclear error messages-
name= 'sge'¶
-
extension= 'sge'¶
-
prefix= '#$'¶
-
cmd_submit(jobscript)[source]¶ Given a
JobScriptinstance, return aqsubcommand that submits the job to the scheduler, as a list of program arguments.
-
get_job_id(response)[source]¶ Given the stdout from the command returned by
cmd_submit(), return a job ID
-
cmd_status(run, finished=False)[source]¶ Given a
AsyncResultinstance, return aqstatcommand that queries the scheduler for the job status. The same command is used for running and finished jobs.
-
get_status(response, finished=False)[source]¶ Given the stdout from the command returned by
cmd_status(), return one of the status code defined inclusterjob.status, or None if the status cannot be determined
-
cmd_cancel(run)[source]¶ Given a
AsyncResultinstance, return aqdelcommand that cancels the run, as a list of command arguments.