Difference between revisions of "Batch Jobs Moab"

From bwHPC Wiki
Jump to: navigation, search
m (E-Mail notification of mjobctl -c)
m (R Barthel moved page Batch Jobs to Batch Jobs Moab)
(29 intermediate revisions by 8 users not shown)
Line 90: Line 90:
 
* [[Batch_Jobs_-_bwUniCluster_Features#msub Command|bwUniCluster msub options]]
 
* [[Batch_Jobs_-_bwUniCluster_Features#msub Command|bwUniCluster msub options]]
 
* [[Batch_Jobs_-_bwForCluster_Chemistry_Features|bwForCluster Chemistry msub options]]
 
* [[Batch_Jobs_-_bwForCluster_Chemistry_Features|bwForCluster Chemistry msub options]]
  +
* [[BwForCluster_MLS&WISO_Production_Batch_Jobs|bwForCluster MLS&WISO (Production) msub options]]
 
==== msub -l ''resource_list'' ====
 
==== msub -l ''resource_list'' ====
 
The '''-l''' option is one of the most important msub options. It is used to specify a number of resource requirements for your job. Multiple resource strings are separated by commas.
 
The '''-l''' option is one of the most important msub options. It is used to specify a number of resource requirements for your job. Multiple resource strings are separated by commas.
Line 135: Line 136:
 
Queue classes define maximum resources such as walltime, nodes and processes per node and partition of the compute system. Note that queue settings of the bwHPC cluster are not '''identical''', but differ due to their different prerequisites, such as HPC performance, scalability and throughput levels. Details can be found here:
 
Queue classes define maximum resources such as walltime, nodes and processes per node and partition of the compute system. Note that queue settings of the bwHPC cluster are not '''identical''', but differ due to their different prerequisites, such as HPC performance, scalability and throughput levels. Details can be found here:
 
* [[Batch_Jobs_-_bwUniCluster_Features#msub_-q_queues|bwUniCluster queue settings]]
 
* [[Batch_Jobs_-_bwUniCluster_Features#msub_-q_queues|bwUniCluster queue settings]]
* [[Batch_Jobs_-_ForHLR_Features#msub_-q_queues|ForHLR queue settings]]
+
* [[BwForCluster_NEMO_Specific_Batch_Features#msub_-q_queues|bwForCluster NEMO queue settings]]
  +
 
=== msub Examples ===
 
=== msub Examples ===
  +
<font color=green>
  +
'''WARNING: many of these examples use queue names like 'singlenode', 'multinode', 'fat' and 'develop' which are specific to the bwUniCluster only! Please refer to the other cluster queue definitions for correct usage.
  +
'''</font>
  +
 
''Hint for JUSTUS users:'' in the following examples instead of '''singlenode''' and '''fat''' use '''short''' and '''long''', respectively!
 
''Hint for JUSTUS users:'' in the following examples instead of '''singlenode''' and '''fat''' use '''short''' and '''long''', respectively!
 
==== Serial Programs ====
 
==== Serial Programs ====
Line 243: Line 249:
 
#MSUB -l pmem=6000mb
 
#MSUB -l pmem=6000mb
 
#MSUB -v MPI_MODULE=mpi/ompi
 
#MSUB -v MPI_MODULE=mpi/ompi
#MSUB -v OMP_NUM_THREADS=5
 
 
#MSUB -v OMP_NUM_THREADS=5
 
#MSUB -v OMP_NUM_THREADS=5
 
#MSUB -v MPIRUN_OPTIONS="--bind-to core --map-by socket:PE=5 -report-bindings"
 
#MSUB -v MPIRUN_OPTIONS="--bind-to core --map-by socket:PE=5 -report-bindings"
 
#MSUB -v EXECUTABLE=./ompi_omp_program
 
#MSUB -v EXECUTABLE=./ompi_omp_program
 
#MSUB -N test_ompi_omp
 
#MSUB -N test_ompi_omp
  +
<br>
 
 
module load ${MPI_MODULE}
 
module load ${MPI_MODULE}
 
TASK_COUNT=$((${MOAB_PROCCOUNT}/${OMP_NUM_THREADS}))
 
TASK_COUNT=$((${MOAB_PROCCOUNT}/${OMP_NUM_THREADS}))
Line 267: Line 272:
 
* The mpirun-options '''--bind-to core''', '''--map-by socket|...|node:PE=<value>''' should always be used when running a multithreaded MPI program. (OpenMPI version 1.6.x: The mpirun-options ''-bind-to-core''', '''-bysocket|-bynode''' and '''-cpus-per-proc <value>''' should always be used when running a multithreaded MPI program.)
 
* The mpirun-options '''--bind-to core''', '''--map-by socket|...|node:PE=<value>''' should always be used when running a multithreaded MPI program. (OpenMPI version 1.6.x: The mpirun-options ''-bind-to-core''', '''-bysocket|-bynode''' and '''-cpus-per-proc <value>''' should always be used when running a multithreaded MPI program.)
 
* The policy on batch jobs with Intel MPI + Multithreading on bwUniCluster can be found here: <br>[[Batch_Jobs_-_bwUniCluster_Features#Intel_MPI_with_Multithreading|bwUniCluster: Intel MPI Parallel Programs with Multithreading]]
 
* The policy on batch jobs with Intel MPI + Multithreading on bwUniCluster can be found here: <br>[[Batch_Jobs_-_bwUniCluster_Features#Intel_MPI_with_Multithreading|bwUniCluster: Intel MPI Parallel Programs with Multithreading]]
  +
 
==== Chain jobs ====
 
==== Chain jobs ====
A job chain is a sequence of jobs where each job automatically starts its successor. Chain Job handling differs on the bwHPC Clusters. See the cluster-specific pages
+
A job chain is a sequence of jobs where each job automatically starts its successor. Chain Job handling differs on the bwHPC Clusters. See the cluster-specific pages:
 
* [[Batch Jobs - bwUniCluster Features]]
 
* [[Batch Jobs - bwUniCluster Features]]
 
* [[Batch Jobs - bwForCluster Chemistry Features]]
 
* [[Batch Jobs - bwForCluster Chemistry Features]]
  +
<!--* [[Batch Jobs - ForHLR Features]]-->
 
 
==== Interactive Jobs ====
 
==== Interactive Jobs ====
 
Policies of interactive batch jobs are cluster specific and can be found here:
 
Policies of interactive batch jobs are cluster specific and can be found here:
 
* [[Batch_Jobs_-_bwUniCluster_Features#Interactive_Jobs|bwUniCluster interactive jobs]]
 
* [[Batch_Jobs_-_bwUniCluster_Features#Interactive_Jobs|bwUniCluster interactive jobs]]
  +
* [[Batch_Jobs_-_ForHLR_Phase_I_Features#Interactive_Jobs|ForHLR interactive jobs]]
 
 
=== Handling job script options and arguments ===
 
=== Handling job script options and arguments ===
 
Job script options and arguments as followed:
 
Job script options and arguments as followed:
Line 313: Line 319:
 
$ msub -q singlenode -v SCRIPT_FLAGS='-n 10' job.sh
 
$ msub -q singlenode -v SCRIPT_FLAGS='-n 10' job.sh
 
</pre>
 
</pre>
  +
=== ForHLR Batch-Jobs ===
 
  +
* [[Batch_Jobs_-_ForHLR_Features|Additive ForHLR batch jobs information]]
 
  +
 
=== Moab Environment Variables ===
 
=== Moab Environment Variables ===
 
Once an eligible compute jobs starts on the compute system, MOAB adds the following variables to the job's environment:
 
Once an eligible compute jobs starts on the compute system, MOAB adds the following variables to the job's environment:
Line 353: Line 360:
 
* [[Batch_Jobs_-_bwUniCluster_Features#Additional_Moab_Environments|Additional Moab Environments for bwUniCluster]]
 
* [[Batch_Jobs_-_bwUniCluster_Features#Additional_Moab_Environments|Additional Moab Environments for bwUniCluster]]
 
* [[Batch_Jobs_-_bwForCluster_Chemistry_Features#Environment_Variables_for_Batch_Jobs|Additional Moab Environments for bwForCluster Justus]]
 
* [[Batch_Jobs_-_bwForCluster_Chemistry_Features#Environment_Variables_for_Batch_Jobs|Additional Moab Environments for bwForCluster Justus]]
  +
  +
<!--
 
<font color=red size=+2>Attention!</font>
 
<font color=red size=+2>Attention!</font>
 
<br>
 
<br>
Line 363: Line 372:
 
<br>
 
<br>
 
<br>
 
<br>
  +
 
<u>recapitulating</u>
 
<u>recapitulating</u>
 
* The MOAB environment variables are for your own convenience only!
 
* The MOAB environment variables are for your own convenience only!
Line 368: Line 378:
 
* Do not use them in your job scripts!
 
* Do not use them in your job scripts!
 
* '''Hence use the [[#TORQUE Resource Manager|TORQUE]] or [[#Slurm Resource Manager|Slurm]] environments instead.'''
 
* '''Hence use the [[#TORQUE Resource Manager|TORQUE]] or [[#Slurm Resource Manager|Slurm]] environments instead.'''
  +
-->
  +
 
=== Interpreting PBS exit codes ===
 
=== Interpreting PBS exit codes ===
 
* The PBS Server logs and accounting logs record the ‘exit status’ of jobs.
 
* The PBS Server logs and accounting logs record the ‘exit status’ of jobs.
Line 382: Line 394:
 
* Each signal has a corresponding value which is indicated in the job exit code.
 
* Each signal has a corresponding value which is indicated in the job exit code.
 
==== Job termination signals ====
 
==== Job termination signals ====
  +
* [http://support.ersa.edu.au/hpc/pbs-exit-codes.html For a complete and detailed list of Job termination signals click this external link].
 
  +
Specific job exit codes are also supplied by the underlying resource manager of the cluster's batch system which is either TORQUE or Slurm. More detailed information can be found in the corresponding documentation:
* See also TORQUE exit codes
 
  +
  +
* [http://docs.adaptivecomputing.com/torque/6-1-2/adminGuide/torque.htm#topics/torque/2-jobs/jobExitStatus.htm TORQUE exit codes]
  +
* [https://slurm.schedmd.com/job_exit_code.html Slurm exit codes]
  +
 
==== Submitting Termination Signal ====
 
==== Submitting Termination Signal ====
 
Here is an example, how to 'save' a ''msub'' termination signal in a typical bwHPC-submit script.
 
Here is an example, how to 'save' a ''msub'' termination signal in a typical bwHPC-submit script.
Line 391: Line 407:
 
echo "### Calling YOUR_PROGRAM command ..."
 
echo "### Calling YOUR_PROGRAM command ..."
 
mpirun -np 'NUMBER_OF_CORES' $YOUR_PROGRAM_BIN_DIR/runproc ... (options) 2>&1
 
mpirun -np 'NUMBER_OF_CORES' $YOUR_PROGRAM_BIN_DIR/runproc ... (options) 2>&1
[ "$exit_code" -eq 0 ] && echo "all clean..." || echo "Executable ${YOUR_PROGRAM_BIN_DIR}/runproc finished with exit code ${$exit_code}"
+
[ "$exit_code" -eq 0 ] && echo "all clean..." || \
  +
echo "Executable ${YOUR_PROGRAM_BIN_DIR}/runproc finished with exit code ${$exit_code}"
 
[...]
 
[...]
 
</source>
 
</source>
 
* Do not use ''''time'''' mpirun! The exit code will be the one submitted by the first (time) program and not the msub exit code.
 
* Do not use ''''time'''' mpirun! The exit code will be the one submitted by the first (time) program and not the msub exit code.
 
* You do not need an '''exit $exit_code''' in the scripts.
 
* You do not need an '''exit $exit_code''' in the scripts.
<!-- --------------------------------------------------------------------------------------------------------------- -->
 
   
 
== Start time of job or resources : showstart ==
 
== Start time of job or resources : showstart ==
Line 496: Line 512:
 
These are examples as shown on the Adaptive Homepage <small>(external links)</small>.
 
These are examples as shown on the Adaptive Homepage <small>(external links)</small>.
 
* [http://docs.adaptivecomputing.com/maui/commands/showq.php#defaultexample Default Report]
 
* [http://docs.adaptivecomputing.com/maui/commands/showq.php#defaultexample Default Report]
* [http://docs.adaptivecomputing.com/maui/commands/showq.php#activeexample Detailed Acive/Running Job Report]
+
* [http://docs.adaptivecomputing.com/maui/commands/showq.php#activeexample Detailed Active/Running Job Report]
 
* [http://docs.adaptivecomputing.com/maui/commands/showq.php#idleexample Detailed Eligible/Idle Job Report]
 
* [http://docs.adaptivecomputing.com/maui/commands/showq.php#idleexample Detailed Eligible/Idle Job Report]
 
* [http://docs.adaptivecomputing.com/maui/commands/showq.php#completedexample Detailed Completed Job Report]
 
* [http://docs.adaptivecomputing.com/maui/commands/showq.php#completedexample Detailed Completed Job Report]
Line 502: Line 518:
 
Showq example on the bwUniCluster for one specific user only <small>(Name and Pop-ID is fiction. Run as MOAB-Admin.)</small>.
 
Showq example on the bwUniCluster for one specific user only <small>(Name and Pop-ID is fiction. Run as MOAB-Admin.)</small>.
 
<pre>
 
<pre>
  +
$ # use UID for option in showq --->
$ kn_jobs # See jobs of all users from Konstanz (example)
 
Name : Hans-Peter Hubndubl (1)
 
Login-Id : kn_pop123456
 
Fachbereich : Chemie [Theoretische und Computergestützte Chemie : Christine Peter]
 
Home : /home/kn/kn_kn/kn_pop123456
 
Status : angemeldet
 
[...]
 
Name : Andreas Meisenkeiser (50)
 
Login-Id : kn_pop332211
 
Fachbereich : Biologie [Evolutionary Biology : Axel Meyer]
 
Home : /home/kn/kn_kn/kn_pop332211
 
Status : angemeldet
 
[...]
 
$ # use UID for option in showq
 
 
$ showq -u kn_pop332211
 
$ showq -u kn_pop332211
 
active jobs------------------------
 
active jobs------------------------
Line 544: Line 547:
 
* Use showq -u $USER for your own jobs.
 
* Use showq -u $USER for your own jobs.
 
* For further options of ''showq'' read the manpage of ''showq''.
 
* For further options of ''showq'' read the manpage of ''showq''.
  +
 
== Shows free resources : showbf ==
 
== Shows free resources : showbf ==
 
The showbf command can be used by any user to find out how many processors are available for immediate use on the system. It is anticipated that users will use this information to submit jobs that meet these criteria and thus obtain quick job turnaround times. This command incorporates down time, reservations, and node state information in determining the available backfill window.
 
The showbf command can be used by any user to find out how many processors are available for immediate use on the system. It is anticipated that users will use this information to submit jobs that meet these criteria and thus obtain quick job turnaround times. This command incorporates down time, reservations, and node state information in determining the available backfill window.
Line 565: Line 569:
 
| -D
 
| -D
 
| Display current and future resource availability notation
 
| Display current and future resource availability notation
  +
|-
  +
| -f
  +
| Show resource availability information only for specified feature
 
|-
 
|-
 
| -g
 
| -g
Line 590: Line 597:
 
| Show resource availability information only for specified user
 
| Show resource availability information only for specified user
 
|}
 
|}
  +
 
=== Parameters ===
 
=== Parameters ===
 
{| width=750px class="wikitable"
 
{| width=750px class="wikitable"
Line 644: Line 652:
 
* This request for 64 nodes returned nothing, meaning it could not be fulfilled immedately.
 
* This request for 64 nodes returned nothing, meaning it could not be fulfilled immedately.
 
<pre>
 
<pre>
$ showbf -n 64-d 2:00:00
+
$ showbf -n 64 -d 2:00:00
 
Partition Tasks Nodes Duration StartOffset StartDate
 
Partition Tasks Nodes Duration StartOffset StartDate
 
--------- ----- ----- ------------ ------------ --------------
 
--------- ----- ----- ------------ ------------ --------------
Line 1,160: Line 1,168:
 
<br><br>
 
<br><br>
 
The canceljob <JobId> command is used to selectively cancel the specified job(s) (active, idle, or non-queued) from the queue.
 
The canceljob <JobId> command is used to selectively cancel the specified job(s) (active, idle, or non-queued) from the queue.
<br>
+
<br><br>
 
<font color=red>Note that only '''own jobs''' can be cancelled.</font>
 
<font color=red>Note that only '''own jobs''' can be cancelled.</font>
  +
<br>
 
=== Access ===
 
=== Access ===
 
This command can be run by any Moab Administrator and '''by the owner of the job'''.
 
This command can be run by any Moab Administrator and '''by the owner of the job'''.
Line 1,210: Line 1,219:
 
</pre>
 
</pre>
 
* See: [[#E-Mail notification of mjobctl -c|E-Mail notification after a job was cancelled/removed]]
 
* See: [[#E-Mail notification of mjobctl -c|E-Mail notification after a job was cancelled/removed]]
  +
 
== Moab Job Control : mjobctl ==
 
== Moab Job Control : mjobctl ==
 
The mjobctl command controls various aspects of jobs. It is used to submit, cancel, execute, and checkpoint jobs. It can also display diagnostic information about your own jobs.
 
The mjobctl command controls various aspects of jobs. It is used to submit, cancel, execute, and checkpoint jobs. It can also display diagnostic information about your own jobs.
Line 1,284: Line 1,294:
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   
= Resource Managers =
 
== TORQUE Resource Manager ==
 
The '''T'''erascale '''O'''pen-source '''R'''esource and '''QUE'''ue Manager ([http://www.adaptivecomputing.com/products/open-source/torque/ TORQUE]) is a distributed resource manager providing control over batch jobs and distributed compute nodes. TORQUE can integrate with the [[#Moab® HPC Workload Manager|Moab Workload Manager]] to improve overall utilization, scheduling and administration on a HPC-C4 cluster.
 
<br>
 
=== Batch Job (PBS) Variables : bwForCluster ===
 
At the time a job is launched into execution, TORQUE defines multiple environment variables, which can be used from within the submission script to define the correct workflow of the job.
 
<br>
 
Since the work load manager TORQUE on [[BwForCluster_Chemistry]] uses the resource manager TORQUE, the following environment variables of TORQUE are added to your environment once your job has started
 
<small>(excerpt of the most important ones)</small>.
 
{| width=750px class="wikitable"
 
! Environment !! Brief explanation
 
|-
 
| PBS_O_WORKDIR || Directory where the qsub command is issued <small>(Job's submission directory)</small>
 
|-
 
| PBS_O_SHELL || Script shell
 
|-
 
| PBS_O_PATH || Path variable used to locate executables within job script
 
|-
 
| PBS_O_HOST || Host on which job script is currently running
 
|-
 
| PBS_O_HOME || Home directory of submitting user
 
|-
 
| PBS_O_LOGNAME || Name of submitting user
 
|-
 
| PBS_NODEFILE || File that lists the hosts (compute nodes) on which the job is run. <small>Line delimited.</small>
 
|-
 
| PBS_JOBNAME || User specified jobname
 
|-
 
| PBS_NODENUM || Node offset number
 
|-
 
| PBS_NUM_NODES || Number of nodes allocated to the job
 
|-
 
| PBS_QUEUE || Job queue
 
|-
 
| PBS_NP || Number of execution slots (cores) for the job
 
|-
 
| PBS_NUM_PPN || Number of procs per node allocated to the job
 
|-
 
| PBS_JOBID || Unique number PBS assigns to a job
 
|-
 
| PBS_TASKNUM || Number of tasks requested
 
|-
 
| TMPDIR || Directory on the scratch (local and fast) disk space that is unique to a job
 
|}
 
* PBS_O_WORKDIR is typically used at the beginning of a script to go to the directory where the qsub command was issued, which is frequently also the directory containing the input data for the job, etc. The typical use is <pre>cd $PBS_O_WORKDIR</pre> inside a submission script.
 
 
* PBS_NODEFILE is typically used to define the environment for the parallel run, for mpirun in particular. Normally, this usage is hidden from users inside a script (e.g. enable_arcus_mpi.sh), which defines the environment for the user.
 
 
* PBS_JOBID is useful to tag job specific files and directories, typically output files or run directories. For instance, the submission script line <pre>myApp > $PBS_JOBID.out</pre> runs the application myApp and redirects the standard output to a file whose name is given by the job id. (NB: the job id is a number assigned by Torque and differs from the character string name given to the job in the submission script by the user.)
 
 
* TMPDIR is the name of a scratch disk directory unique to the job. The scratch disk space typically has faster access than the disk space where the user home and data areas reside and benefits applications that have a sustained and large amount of I/O. Such a job normally involves copying the input files to the scratch space, running the application on scratch and copying the results to the submission directory.
 
 
See also:
 
* [[Batch_Jobs_-_bwForCluster_Chemistry_Features|Additional bwForCluster Justus Configurations]]
 
 
=== Job Exit Status ===
 
Once a job under TORQUE has completed, the '''exit_status''' attribute will contain the result code returned by the job script. This attribute can be seen by submitting a '''qstat -f''' command to show the entire set of information associated with a job. The exit_status field is found near the bottom of the set of output lines.
 
<pre>
 
$ msub bwforcluster-quantum-example.moab
 
760236
 
$ qstat
 
Job ID Name User Time Use S Queue
 
------------------------- ---------------- --------------- -------- - -----
 
760236.adm01 ...-example.moab kn_l_pop235844 00:00:00 C short
 
$
 
$ qstat -f 760236
 
Job Id: 760236.adm01
 
Job_Name = bwforcluster-quantum-example.moab
 
Job_Owner = kn_l_pop235844@adm01
 
resources_used.cput = 00:00:00
 
resources_used.mem = 0kb
 
resources_used.vmem = 0kb
 
resources_used.walltime = 00:00:11
 
job_state = C
 
queue = short
 
server = adm01
 
Checkpoint = u
 
ctime = Fri Jan 15 10:10:23 2016
 
Error_Path = adm01:/nfs/home1/kn/kn_kn/kn_l_pop235844/src/chem/quantum_esp
 
resso/4.0.3_epw/bwhpc-examples/bwforcluster-quantum-example.moab.76023
 
6
 
exec_host = n0301/0
 
exec_port = 15003
 
group_list = kn_kn
 
Hold_Types = n
 
Join_Path = oe
 
Keep_Files = n
 
Mail_Points = a
 
mtime = Fri Jan 15 10:10:44 2016
 
Output_Path = adm01:/nfs/home1/kn/kn_kn/kn_l_pop235844/src/chem/quantum_es
 
presso/4.0.3_epw/bwhpc-examples/bwforcluster-quantum-example.moab.7602
 
36
 
Priority = 0
 
qtime = Fri Jan 15 10:10:23 2016
 
Rerunable = False
 
Resource_List.mem = 4000mb
 
Resource_List.nodect = 1
 
Resource_List.nodes = 1:ppn=1
 
Resource_List.walltime = 48:00:00
 
session_id = 1349
 
Variable_List = MOAB_BATCH=,MOAB_CLASS=short,MOAB_GROUP=kn_kn,
 
MOAB_JOBID=760236,MOAB_JOBNAME=bwforcluster-quantum-example.moab,
 
MOAB_MACHINE=torque,MOAB_NODECOUNT=1,MOAB_NODELIST=n0301,
 
MOAB_PARTITION=Moab,MOAB_PROCCOUNT=1,MOAB_TASKMAP=n0301:1,
 
MOAB_USER=kn_l_pop235844,PBS_O_QUEUE=short,PBS_O_HOME=/,
 
PBS_O_PATH=/sbin:/usr/sbin:/bin:/usr/bin,
 
PBS_O_WORKDIR=/nfs/home1/kn/kn_kn/kn_l_pop235844/src/chem/quantum_esp
 
resso/4.0.3_epw/bwhpc-examples,PBS_O_HOST=adm01,PBS_O_SERVER=adm01,
 
MOAB_SUBMITDIR=/home/kn/kn_kn/kn_l_pop235844/src/chem/quantum_espress
 
o/4.0.3_epw/bwhpc-examples,PATH=/sbin:/usr/sbin:/bin:/usr/bin
 
euser = kn_l_pop235844
 
egroup = kn_kn
 
queue_type = E
 
etime = Fri Jan 15 10:10:23 2016
 
 
--> exit_status = 0
 
 
start_time = Fri Jan 15 10:10:33 2016
 
start_count = 1
 
fault_tolerant = False
 
comp_time = Fri Jan 15 10:10:45 2016
 
job_radix = 0
 
total_runtime = 14.439113
 
proxy_user = kn_l_pop235844
 
submit_host = adm01
 
job_id = 760236
 
x = ENVREQUESTED:TRUE;SID:Moab;SJID:760236;SRMJID:760236
 
</pre>
 
This code can be useful in diagnosing problems with jobs that may have unexpectedly terminated.
 
<br>
 
If TORQUE was unable to start the job, this field will contain a negative number produced by the pbs_mom.
 
<br>
 
Otherwise, if the job script was successfully started, the value in this field will be the return value of the script.
 
==== TORQUE Supplied Exit Codes ====
 
{| width=750px class="wikitable"
 
! Name !! Value !! Description
 
|- style="vertical-align:top;"
 
| JOB_EXEC_OK
 
| 0
 
| job exec successful
 
|- style="vertical-align:top;"
 
| JOB_EXEC_FAIL1
 
| -1
 
| job exec failed, before files, no retry
 
|- style="vertical-align:top;"
 
| JOB_EXEC_FAIL2
 
| -2
 
| job exec failed, after files, no retry
 
|- style="vertical-align:top;"
 
| JOB_EXEC_RETRY
 
| -3
 
| job execution failed, do retry
 
|- style="vertical-align:top;"
 
| JOB_EXEC_INITABT
 
| -4
 
| job aborted on MOM initialization
 
|- style="vertical-align:top;"
 
| JOB_EXEC_INITRST
 
| -5
 
| job aborted on MOM init, chkpt, no migrate
 
|- style="vertical-align:top;"
 
| JOB_EXEC_INITRMG
 
| -6
 
| job aborted on MOM init, chkpt, ok migrate
 
|- style="vertical-align:top;"
 
| JOB_EXEC_BADRESRT
 
| -7
 
| job restart failed
 
|- style="vertical-align:top;"
 
| JOB_EXEC_CMDFAIL
 
| -8
 
| exec() of user command failed
 
|}
 
<!--
 
=== Example of submission script for Torque (PBS) ===
 
This is an example of the TORQUE related part (header) of a submit-script.
 
<pre>
 
.... soon ...
 
</pre>
 
-->
 
== Slurm Resource Manager ==
 
The Slurm Resource and Workload Manager (formerly known as '''S'''imple '''L'''inux '''U'''tility for '''R'''esource '''M'''anagement (see: [http://slurm.net/about/ SLURM])) is a free and open-source job scheduler.
 
<br>
 
=== Batch Job (Slurm) Variables : bwUniCluster ===
 
Since the work load manager MOAB on [[bwUniCluster]] uses the resource manager Slurm, the following environment variables of Slurm are added to your environment once your job has started
 
<small>(only an excerpt of the most important ones)</small>.
 
{| width=750px class="wikitable"
 
! Environment !! Brief explanation
 
|-
 
| SLURM_JOB_CPUS_PER_NODE
 
| Number of processes per node dedicated to the job
 
|-
 
| SLURM_JOB_NODELIST
 
| List of nodes dedicated to the job
 
|-
 
| SLURM_JOB_NUM_NODES
 
| Number of nodes dedicated to the job
 
|-
 
| SLURM_MEM_PER_NODE
 
| Memory per node dedicated to the job
 
|-
 
| SLURM_NPROCS
 
| Total number of processes dedicated to the job
 
|-
 
| SLURM_CLUSTER_NAME
 
| Name of the cluster executing the job
 
|-
 
| SLURM_CPUS_PER_TASK
 
| Number of CPUs requested per task
 
|-
 
| SLURM_JOB_ACCOUNT
 
| Account name
 
|-
 
| SLURM_JOB_ID
 
| Job ID
 
|-
 
| SLURM_JOB_NAME
 
| Job Name
 
|-
 
| SLURM_JOB_PARTITION
 
| Partition/queue running the job
 
|-
 
| SLURM_JOB_UID
 
| User ID of the job's owner
 
|-
 
| SLURM_JOB_USER
 
| User name of the job's owner
 
|-
 
| SLURM_RESTART_COUNT
 
| Number of times job has restarted
 
|-
 
| SLURM_PROCID
 
| Task ID (MPI rank)
 
|-
 
| SLURM_STEP_ID
 
| Job step ID
 
|-
 
| SLURM_STEP_NUM_TASKS
 
| Task count (number of PI ranks)
 
|}
 
See also:
 
* [[Batch_Jobs_-_bwUniCluster_Features|Additional bwUniCluster Configurations]]
 
* [[Batch_Jobs_-_bwUniCluster_Features#Additional_Slurm_Environments|Additional bwUniCluster Slrum Environments]]
 
=== Job Exit Codes ===
 
A job's exit code (aka exit status, return code and completion code) is captured by SLURM and saved as part of the job record.
 
<br>
 
Any non-zero exit code will be assumed to be a job failure and will result in a Job State of FAILED with a reason of "NonZeroExitCode".
 
<br>
 
The exit code is an 8 bit unsigned number ranging between 0 and 255. While it is possible for a job to return a negative exit code, SLURM will display it as an unsigned value in the 0 - 255 range.
 
==== Displaying Exit Codes and Signals ====
 
SLURM displays a job's exit code in the output of the '''scontrol show job''' and the sview utility. SLURM displays job step exit codes in the output of the '''scontrol show step''' and the sview utility.
 
<br>
 
When a signal was responsible for a job or step's termination, the signal number will be displayed after the exit code, delineated by a colon(:).
 
<br>
 
<br>
 
 
----
 
----
[[Category:bwUniCluster|Batch Jobs - General Features]][[Category:ForHLR Phase I|Batch Jobs - General Features]][[Category:BwForCluster Chemistry|Batch Jobs - General Features]]
+
[[Category:bwUniCluster|Batch Jobs - General Features]]
  +
[[Category:BwForCluster Chemistry|Batch Jobs - General Features]]
  +
[[Category:BwForCluster_MLS%26WISO_Production|Batch Jobs - General Features]]
  +
[[Category:BwForCluster NEMO|Batch Jobs - General Features]]
  +
[[Category:BwForCluster_BinAC]]

Revision as of 15:50, 22 February 2021

1 Moab® HPC Workload Manager

1.1 Specification

The Moab Cluster Suite is a cluster workload management package, available from Adaptive Computing, Inc., that integrates the scheduling, managing, monitoring and reporting of cluster workloads. Moab Cluster Suite simplifies and unifies management across one or multiple hardware, operating system, storage, network, license and resource manager environments.

Any kind of calculation on the compute nodes of a bwHPC cluster of tier 2 or 3 requires the user to define calculations as a sequence of commands or single command together with required run time, number of CPU cores and main memory and submit all, i.e., the batch job, to a resource and workload managing software. All bwHPC cluster of tier 2 and 3, including have installed the workload managing software MOAB. Therefore any job submission by the user is to be executed by commands of the MOAB software. MOAB queues and runs user jobs based on fair sharing policies.

1.2 Moab Commands (excerpt)

Some of the most used Moab commands for non-administrators working on a HPC-C5 cluster.

MOAB commands Brief explanation
msub Submits a job and queues it in an input queue [msub]
checkjob Displays detailed job state information [checkjob]
showq Displays information about active, eligible, blocked, and/or recently completed jobs [showq]
showbf Shows what resources are available for immediate use [showbf]
showstart Returns start time of submitted job or requested resources [showstart]
canceljob Cancels a job (opsoleted!) [canceljob]
mjobctl Cancel a job and more job control options [mjobctl]

1.3 Job Submission : msub

Batch jobs are submitted by using the command msub. The main purpose of the msub command is to specify the resources that are needed to run the job. msub will then queue the batch job. However, starting of batch job depends on availability of the requested resources and the fair sharing value.

1.3.1 msub Command Parameters

The syntax and use of msub can be displayed via:

$ man msub

msub options can be used from the command line or in your job script.

msub Options
Command line Script Purpose
-l resources #MSUB -l resources Defines the resources that are required by the job.

See the description below for this important flag.

-N name #MSUB -N name Gives a user specified name to the job.
-o filename #MSUB -o filename Defines the file-name to be used for the standard output stream of the

batch job. By default the file with defined file name is placed under your
job submit directory. To place under a different location, expand
file name by the relative or absolute path of destination.

-q queue #MSUB -q queue Defines the queue class
-v variable=arg #MSUB -v variable=arg Expands the list of environment variables that are exported to the job
-S Shell #MSUB -S Shell Declares the shell (state path+name, e.g. /bin/bash) that interpret

the job script

-m bea #MSUB -m bea Send email when job begins (b), ends (e) or aborts (a).
-M name@uni.de #MSUB -M name@uni.de Send email to the specified email address "name@uni.de".

For cluster specific msub options, read:

1.3.1.1 msub -l resource_list

The -l option is one of the most important msub options. It is used to specify a number of resource requirements for your job. Multiple resource strings are separated by commas.

msub -l resource_list
resource Purpose
-l nodes=2:ppn=16 Number of nodes and number of processes per node
-l walltime=600
-l walltime=01:30:00
Wall-clock time. Default units are seconds.

HH:MM:SS format is also accepted.

-l pmem=1000mb Maximum amount of physical memory used by any single process of the job.

Allowed units are kb, mb, gb. Be aware that processes are either MPI tasks

memory for all MPI tasks or all threads of the job.
-l advres=res_name Specifies the reservation "res_name" required to run the job.
-l naccesspolicy=policy Specifies how node resources should be accessed, e.g. -l naccesspolicy=singlejob

reserves all requested nodes for the job exclusively.
Attention, if you request nodes=1:ppn=4 together with singlejob you will be
charged for the maximum cores of the node.

Note that all compute nodes do not have SWAP space, thus DO NOT specify '-l vmem' or '-l pvmem' or your jobs will not start.

1.3.1.2 msub -q queues

Queue classes define maximum resources such as walltime, nodes and processes per node and partition of the compute system. Note that queue settings of the bwHPC cluster are not identical, but differ due to their different prerequisites, such as HPC performance, scalability and throughput levels. Details can be found here:

1.3.2 msub Examples

WARNING: many of these examples use queue names like 'singlenode', 'multinode', 'fat' and 'develop' which are specific to the bwUniCluster only! Please refer to the other cluster queue definitions for correct usage.

Hint for JUSTUS users: in the following examples instead of singlenode and fat use short and long, respectively!

1.3.2.1 Serial Programs

To submit a serial job that runs the script job.sh and that requires 5000 MB of main memory and 3 hours of wall clock time

a) execute:

$ msub -q singlenode -N test -l nodes=1:ppn=1,walltime=3:00:00,pmem=5000mb   job.sh

or b) add after the initial line of your script job.sh the lines (here with a high memory request):

#MSUB -l nodes=1:ppn=1
#MSUB -l walltime=3:00:00
#MSUB -l pmem=200000mb
#MSUB -N test

and execute the modified script with the command line option -q fat (with -q singlenode maximum pmem=64000mb is possible):

$ msub -q fat job.sh

Note, that msub command line options overrule script options.

1.3.2.2 Multithreaded Programs

Multithreaded programs operate faster than serial programs on CPUs with multiple cores.
Moreover, multiple threads of one process share resources such as memory.
For multithreaded programs based on Open Multi-Processing (OpenMP) number of threads are defined by the environment variable OMP_NUM_THREADS. By default this variable is set to 1 (OMP_NUM_THREADS=1).
To submit a batch job called OpenMP_Test that runs a fourfold threaded program omp_executable which requires 6000 MByte of total physical memory and total wall clock time of 3 hours:

  • generate the script job_omp.sh containing the following lines:
#!/bin/bash
#MSUB -l nodes=1:ppn=4
#MSUB -l walltime=3:00:00
#MSUB -l mem=6000mb
#MSUB -v EXECUTABLE=./omp_executable
#MSUB -v MODULE=<placeholder>
#MSUB -N OpenMP_Test

#Usually you should set
export KMP_AFFINITY=compact,1,0
#export KMP_AFFINITY=verbose,compact,1,0 prints messages concerning the supported affinity
#KMP_AFFINITY Description: https://software.intel.com/en-us/node/524790#KMP_AFFINITY_ENVIRONMENT_VARIABLE

module load ${MODULE}
export OMP_NUM_THREADS=${MOAB_PROCCOUNT}
echo "Executable ${EXECUTABLE} running on ${MOAB_PROCCOUNT} cores with ${OMP_NUM_THREADS} threads"
startexe=${EXECUTABLE}
echo $startexe
exec $startexe

Using Intel compiler the environment variable KMP_AFFINITY switches on binding of threads to specific cores and, if necessary, replace <placeholder> with the required modulefile to enable the OpenMP environment and execute the script job_omp.sh adding the queue class singlenode as msub option:

$ msub -q singlenode job_omp.sh

Note, that msub command line options overrule script options, e.g.,

$ msub -l mem=2000mb -q singlenode job_omp.sh

overwrites the script setting of 6000 MByte with 2000 MByte.

1.3.2.3 MPI Parallel Programs

MPI parallel programs run faster than serial programs on multi CPU and multi core systems. N-fold spawned processes of the MPI program, i.e., MPI tasks, run simultaneously and communicate via the Message Passing Interface (MPI) paradigm. MPI tasks do not share memory but can be spawned over different nodes.
Multiple MPI tasks can not be launched by the MPI parallel program itself but via mpirun, e.g. 4 MPI tasks of my_par_program:

$ mpirun -n 4 my_par_program

However, this given command can not be directly included in your msub command for submitting as a batch job to the compute cluster, see above.

Generate a wrapper script job_ompi.sh for OpenMPI containing the following lines:

#!/bin/bash
module load mpi/openmpi/<placeholder_for_version>
# Use when loading OpenMPI in version 1.8.x
mpirun --bind-to core --map-by core -report-bindings my_par_program
# Use when loading OpenMPI in an old version 1.6.x
mpirun -bind-to-core -bycore -report-bindings my_par_program

Attention: Do NOT add mpirun options -n <number_of_processes> or any other option defining processes or nodes, since MOAB instructs mpirun about number of processes and node hostnames. Use ALWAYS the MPI options --bind-to core and --map-by core|socket|node (OpenMPI version 1.8.x). Please type mpirun --help for an explanation of the meaning of the different options of mpirun option --map-by.
Considering 4 OpenMPI tasks on a single node, each requiring 1000 MByte, and running for 1 hour, execute:

$ msub -q singlenode -l nodes=1:ppn=4,pmem=1000mb,walltime=01:00:00 job_ompi.sh

The policy on batch jobs with Intel MPI on bwUniCluster can be found here:

1.3.2.4 Multithreaded + MPI parallel Programs

Multithreaded + MPI parallel programs operate faster than serial programs on multi CPUs with multiple cores. All threads of one process share resources such as memory. On the contrary MPI tasks do not share memory but can be spawned over different nodes.
Multiple MPI tasks using OpenMPI must be launched by the MPI parallel program mpirun. For multithreaded programs based on Open Multi-Processing (OpenMP) number of threads are defined by the environment variable OMP_NUM_THREADS. By default this variable is set to 1 (OMP_NUM_THREADS=1).
For OpenMPI a job-script to submit a batch job called job_ompi_omp.sh that runs a MPI program with 4 tasks and an fivefold threaded program ompi_omp_program requiring 6000 MByte of physical memory per process/thread (using 5 threads per MPI task you will get 5*6000 MByte = 30000 MByte per MPI task) and total wall clock time of 3 hours looks like:

#!/bin/bash
#MSUB -l nodes=2:ppn=10
#MSUB -l walltime=03:00:00
#MSUB -l pmem=6000mb
#MSUB -v MPI_MODULE=mpi/ompi
#MSUB -v OMP_NUM_THREADS=5
#MSUB -v MPIRUN_OPTIONS="--bind-to core --map-by socket:PE=5 -report-bindings"
#MSUB -v EXECUTABLE=./ompi_omp_program
#MSUB -N test_ompi_omp

module load ${MPI_MODULE}
TASK_COUNT=$((${MOAB_PROCCOUNT}/${OMP_NUM_THREADS}))
echo "${EXECUTABLE} running on ${MOAB_PROCCOUNT} cores with ${TASK_COUNT} MPI-tasks and ${OMP_NUM_THREADS} threads"
startexe="mpirun -n ${TASK_COUNT} ${MPIRUN_OPTIONS} ${EXECUTABLE}"
echo $startexe
exec $startexe

Execute the script job_ompi_omp.sh adding the queue class multinode to your msub command:

$ msub -q multinode job_ompi_omp.sh
  • With the mpirun option --bind-to core MPI tasks and OpenMP threads are bound to physical cores.
  • With the option --map-by socket:PE=<value> (neighbored) MPI tasks will be attached to different sockets and each MPI task is bound to the (in <value>) specified number of cpus. <value> must be set to ${OMP_NUM_THREADS}.
  • Old OpenMPI version 1.6.x: With the mpirun option -bind-to-core MPI tasks and OpenMP threads are bound to physical cores.
  • With the option -bysocket (neighbored) MPI tasks will be attached to different sockets and the option -cpus-per-proc <value> binds each MPI task to the (in <value>) specified number of cpus. <value> must be set to ${OMP_NUM_THREADS}.
  • The option -report-bindings shows the bindings between MPI tasks and physical cores.
  • The mpirun-options --bind-to core', --map-by socket|...|node:PE=<value> should always be used when running a multithreaded MPI program. (OpenMPI version 1.6.x: The mpirun-options -bind-to-core, -bysocket|-bynode and -cpus-per-proc <value> should always be used when running a multithreaded MPI program.)
  • The policy on batch jobs with Intel MPI + Multithreading on bwUniCluster can be found here:
    bwUniCluster: Intel MPI Parallel Programs with Multithreading

1.3.2.5 Chain jobs

A job chain is a sequence of jobs where each job automatically starts its successor. Chain Job handling differs on the bwHPC Clusters. See the cluster-specific pages:

1.3.2.6 Interactive Jobs

Policies of interactive batch jobs are cluster specific and can be found here:

1.3.3 Handling job script options and arguments

Job script options and arguments as followed:

$ ./job.sh -n 10

can not be passed while using msub command since those will be interpreted as command line options of job.sh (like $1 = -n, $2 = 10).

Solution A:

Submit a wrapper script, e.g. wrapper.sh:

$ msub -q singlenode wrapper.sh

which simply contains all options and arguments of job.sh. The script wrapper.sh would at least contain the following lines:

#!/bin/bash
./job.sh -n 10

Solution B:

Add after the header of your BASH script job.sh the following lines:

## check if $SCRIPT_FLAGS is "set"
if [ -n "${SCRIPT_FLAGS}" ] ; then
   ## but if positional parameters are already present
   ## we are going to ignore $SCRIPT_FLAGS
   if [ -z "${*}"  ] ; then
      set -- ${SCRIPT_FLAGS}
   fi
fi

These lines modify your BASH script to read options and arguments from the environment variable $SCRIPT_FLAGS. Now submit your script job.sh as followed:

$ msub -q singlenode -v SCRIPT_FLAGS='-n 10' job.sh


1.3.4 Moab Environment Variables

Once an eligible compute jobs starts on the compute system, MOAB adds the following variables to the job's environment:

MOAB variables
Environment variables Description
MOAB_CLASS Class name
MOAB_GROUP Group name
MOAB_JOBID Job ID
MOAB_JOBNAME Job name
MOAB_NODECOUNT Number of nodes allocated to job
MOAB_PARTITION Partition name the job is running in
MOAB_PROCCOUNT Number of processors allocated to job
MOAB_SUBMITDIR Directory of job submission
MOAB_USER User name

See also:


1.3.5 Interpreting PBS exit codes

  • The PBS Server logs and accounting logs record the ‘exit status’ of jobs.
  • Zero or positive exit status is the status of the top-level shell.
  • Certain negative exit statuses are used internally and will never be reported to the user.
  • The positive exit status values indicate which signal killed the job.
  • Depending on the system, values greater than 128 (or on some systems 256, see wait(2) or waitpid(2) for more information) are the value of the signal that killed the job.
  • To interpret (or ‘decode’) the signal contained in the exit status value, subtract the base value from the exit status.
    For example, if a job had an exit status of 143, that indicates the jobs was killed via a SIGTERM (e.g. 143 - 128 = 15, signal 15 is SIGTERM).

1.3.5.1 Job termination

  • The exit code from a batch job is a standard Unix termination signal.
  • Typically, exit code 0 means successful completion.
  • Codes 1-127 are generated from the job calling exit() with a non-zero value to indicate an error.
  • Exit codes 129-255 represent jobs terminated by Unix signals.
  • Each signal has a corresponding value which is indicated in the job exit code.

1.3.5.2 Job termination signals

Specific job exit codes are also supplied by the underlying resource manager of the cluster's batch system which is either TORQUE or Slurm. More detailed information can be found in the corresponding documentation:

1.3.5.3 Submitting Termination Signal

Here is an example, how to 'save' a msub termination signal in a typical bwHPC-submit script.

[...]
exit_code=$?
echo "### Calling YOUR_PROGRAM command ..."
mpirun -np 'NUMBER_OF_CORES' $YOUR_PROGRAM_BIN_DIR/runproc ... (options)  2>&1
[ "$exit_code" -eq 0 ] && echo "all clean..." || \
   echo "Executable ${YOUR_PROGRAM_BIN_DIR}/runproc finished with exit code ${$exit_code}"
[...]
  • Do not use 'time' mpirun! The exit code will be the one submitted by the first (time) program and not the msub exit code.
  • You do not need an exit $exit_code in the scripts.

1.4 Start time of job or resources : showstart

The following command can be used by any user to displays the estimated start time of a job based a number of analysis types based on historical usage, earliest available reservable resources, and priority based backlog.

1.4.1 Access

By default, this command can be run by any user.

1.4.2 Showstart Parameters

Parameter Description
DURATION Duration of pseudo-job to be checked in format [[[DD:]HH:]MM:]SS (default duration is 1 second)
-e Estimate method. By default, Moab will use the reservation based estimation method.
-f Use feedback. If specified, Moab will apply historical accuracy information to improve the quality of the estimate.
-g Grid mode. Obtain showstart information from remote resource managers. If -g is not used and Moab determines that job is already migrated, Moab obtains showstart information form the remote Moab where the job was migrated to. All resource managers can be queried by using the keyword "all" which returns all information in a table.
$ showstart -g all head.1
Estimated Start Times
[ Remote RM ] [ Reservation ] [ Priority ] [ Historical ]
[ c1 ] [ 00:15:35 ] [ ] [ ]
[ c2 ] [ 3:15:38 ] [ ] [ ]
-l qos=<QOS> Specifies what QOS the job must start under, using the same syntax as the msub command. Currently, no other resource manager extensions are supported. This flag only applies to hypothetical jobs by using the proccount[@duration] syntax.
JOBID Job to be checked
PROCCOUNT Number of processors in pseudo-job to be checked
S3JOBSPEC XML describing the job according to the Dept. of Energy Scalable Systems Software/S3 job specification.

Note: You cannot specify job flags when running showstart, and since a job by default can only run on one partition. Showstart fails when querying for a job requiring more nodes than the largest partition available.

1.4.3 Showstart Examples

  • To show estimated start time of job <job_ID> enter
$ showstart -e all <job_ID>
  • Furthermore start time of resource demands, e.g. 16 processes @ 12 h, can be displayed
$ showstart -e all 16@12:00:00
  • For a list of all options of showstart read the manpage of showstart

1.5 List of your submitted jobs : showq

Displays information about active, eligible, blocked, and/or recently completed jobs. Since the resource manager is not actually scheduling jobs, the job ordering it displays is not valid. The showq command displays the actual job ordering under the Moab Workload Manager. When used without flags, this command displays all jobs in active, idle, and non-queued states.

1.5.1 Access

By default, this command can be run by any user.
However, the -c, -i, and -r flags can only be used by Moab administrators.

1.5.2 Flags

Flag Description
-b display blocked jobs only
-c display details about recently completed jobs (see example, JOBCPURGETIME)
-g display grid job and system id's for all jobs
-i display extended details about idle jobs
-l display local/remote view. For use in a Grid environment, displays job usage of both local and remote compute resources.
-p display only jobs assigned to the specified partition
-r display extended details about active (running) jobs
-R display only jobs which overlap the specified reservation
-v Display local and full resource manager job IDs as well as partitions. If specified with the '-i' option, will display job reservation time.
-w display only jobs associated with the specified constraint. Valid constraints include user, group, acct, class, and qos.

1.5.3 Examples

These are examples as shown on the Adaptive Homepage (external links).

Showq example on the bwUniCluster for one specific user only (Name and Pop-ID is fiction. Run as MOAB-Admin.).

$ # use UID for option in showq --->
$ showq -u kn_pop332211
active jobs------------------------
JOBID              USERNAME      STATE PROCS   REMAINING            STARTTIME

8370992            kn_pop33    Running     1  2:05:09:17  Wed Jan 13 15:59:01
8370991            kn_pop33    Running     1  2:05:09:17  Wed Jan 13 15:59:01
8370993            kn_pop33    Running     1  2:05:10:20  Wed Jan 13 16:00:04
[...]
8371040            kn_pop33    Running     1  2:05:11:41  Wed Jan 13 16:01:25

50 active jobs          50 of 7072 processors in use by local jobs (0.71%)
                        434 of 434 nodes active      (100.00%)

eligible jobs----------------------
JOBID              USERNAME      STATE PROCS     WCLIMIT            QUEUETIME

0 eligible jobs   

blocked jobs-----------------------
JOBID              USERNAME      STATE PROCS     WCLIMIT            QUEUETIME

0 blocked jobs   

Total jobs:  50
  • The summary of your active jobs shows how many jobs of yours are running, how many processors are in use by your jobs and how many nodes are in use by all active jobs.
  • Use showq -u $USER for your own jobs.
  • For further options of showq read the manpage of showq.

1.6 Shows free resources : showbf

The showbf command can be used by any user to find out how many processors are available for immediate use on the system. It is anticipated that users will use this information to submit jobs that meet these criteria and thus obtain quick job turnaround times. This command incorporates down time, reservations, and node state information in determining the available backfill window.
Note If specific information is not specified, showbf will return information for the user and group running but with global access for other credentials.

1.6.1 Access

By default, this command can be used by any user or administrator.

1.6.2 Flags

-A Show resource availability information for all users, groups, and accounts. By default, showbf uses the default user, group, and account ID of the user issuing the command.
Flag Description
-a Show resource availability information only for specified account
-d Show resource availability information for specified duration
-D Display current and future resource availability notation
-f Show resource availability information only for specified feature
-g Show resource availability information only for specified group
-h Help for this command
-L Enforce Hard limits when showing available resources
-m Allows user to specify the memory requirements for the backfill nodes of interest. It is important to note that if the optional MEMCMP and MEMORY parameters are used, they MUST be enclosed in single ticks (') to avoid interpretation by the shell. For example, enter showbf -m '==256' to request nodes with 256 MB memory.
-n Show resource availability information for a specified number of nodes. That is, this flag can be used to force showbf to display only blocks of resources with at least this many nodes available.
-p Show resource availability information for the specified partition
-q Show information for the specified QOS
-u Show resource availability information only for specified user

1.6.3 Parameters

Parameter Description
ACCOUNT Account name
CLASS Class/queue required
DURATION Time duration specified as the number of seconds or in [DD:]HH:MM:SS notation
FEATURELIST Colon separated list of node features required
GROUP Specify particular group
MEMCMP Memory comparison used with the -m flag. Valid signs are >, >=, ==, <=, and <.
MEMORY Specifies the amount of required real memory configured on the node, (in MB), used with the -m flag.
NODECOUNT Specify number of nodes for inquiry with -n flag
PARTITION Specify partition to check with -p flag
QOS Specify QOS to check with -q flag
USER Specify particular user to check with -u flag

1.6.4 Examples

  • The following command displays what resources are available for immediate use for the whole partition.
$ showbf
Partition     Tasks  Nodes      Duration   StartOffset       StartDate
---------     -----  -----  ------------  ------------  -------------- 
ALL             371    129      INFINITY      00:00:00  11:30:26_01/14
  • The request for 16 nodes can be run immediately on all partitions.
$ showbf -n 16 -d 2:00:00
Partition     Tasks  Nodes      Duration   StartOffset       StartDate
---------     -----  -----  ------------  ------------  --------------
ALL             392    132      INFINITY      00:00:00  11:35:01_01/14
  • This request for 64 nodes returned nothing, meaning it could not be fulfilled immedately.
$ showbf -n 64 -d 2:00:00
Partition     Tasks  Nodes      Duration   StartOffset       StartDate
---------     -----  -----  ------------  ------------  --------------
  • The last example request displays an error message. Too much nodes requested!
$ showbf -n 256 -d 2:00:00
resources not available
  • For further options of showbf read the manpage of showbf.

1.7 Detailed job information : checkjob

Checkjob displays detailed job state information and diagnostic output for a specified job. Detailed information is available for queued, blocked, active, and recently completed jobs.

1.7.1 Access

  • End users can use checkjob to view the status of their own jobs only.
  • JobArrays and Reservations are not available on all clusters. See specific informations depending the single bwUniCluster and bwForClusters for a list of capabilities.

1.7.2 Output

Attribute Value Description
Account <STRING> Name of account associated with job
Actual Run Time [[[DD:]HH:]MM:]SS Length of time job actually ran. This info is only displayed in simulation mode.
Allocated Nodes Square bracket delimited list of node and processor ids List of nodes and processors allocated to job
Applied Nodeset** <STRING> Nodeset used for job's node allocation
Arch <STRING> Node architecture required by job
Attr Square bracket delimited list of job attributes Job Attributes (i.e. [BACKFILL][PREEMPTEE])
Available Memory** <INTEGER> The available memory requested by job. Moab displays the relative or exact value by returning a comparison symbol (>, <, >=, <=, or ==) with the value (i.e. Available Memory <= 2048).
Available Swap** <INTEGER> The available swap requested by job. Moab displays the relative or exact value by returning a comparison symbol (>, <, >=, <=, or ==) with the value (i.e. Available Swap >= 1024).
Average Utilized Procs* <FLOAT> Average load balance for a job
Avg Util Resources Per Task* <FLOAT>
BecameEligible <TIMESTAMP> The date and time when the job moved from Blocked to Eligible.
Bypass <INTEGER> Number of times a lower priority job with a later submit time ran before the job
CheckpointStartTime** [[[DD:]HH:]MM:]SS The time the job was first checkpointed
Class [<CLASS NAME> <CLASS COUNT>] Name of class/queue required by job and number of class initiators required per task.
Dedicated Resources Per Task* Space-delimited list of <STRING>:<INTEGER> Resources dedicated to a job on a per-task basis
Disk <INTEGER> Amount of local disk required by job (in MB)
Estimated Walltime [[[DD:]HH:]MM:]SS The scheduler's estimated walltime. In simulation mode, it is the actual walltime.
EnvVariables** Comma-delimited list of <STRING> List of environment variables assigned to job
Exec Size* <INTEGER> Size of job executable (in MB)
Executable <STRING> Name of command to run
Features Square bracket delimited list of <STRING>s Node features required by job
Flags
Group <STRING> Name of UNIX group associated with job
Holds Zero or more of User, System, and Batch Types of job holds currently applied to job
Image Size <INTEGER> Size of job data (in MB)
IWD (Initial Working Directory) <DIR> Directory to run the executable in
Job Messages** <STRING> Messages attached to a job
Job Submission** <STRING> Job script submitted to RM
Memory <INTEGER> Amount of real memory required per node (in MB)
Max Util Resources Per Task* <FLOAT>
NodeAccess*
Nodecount <INTEGER> Number of nodes required by job
Opsys <STRING> Node operating system required by job
Partition Mask ALL or colon delimited list of partitions List of partitions the job has access to
PE <FLOAT> Number of processor-equivalents requested by job
Per Partition Priority** Tabular Table showing job template priority for each partition
Priority Analysis** Tabular Table showing how job's priority was calculated:
Job PRIORITY* Cred( User:Group:Class) Serv(QTime)
QOS <STRING> Quality of Service associated with job
Reservation <RSVID ( <TIME1 - <TIME2> Duration: <TIME3>) RESID specifies the reservation id, TIME1 is the relative start time, TIME2 the relative end time
TIME3 The duration of the reservation
Req [<INTEGER>] TaskCount: <INTEGER> Partition: <partition> A job requirement for a single type of resource followed by the number of tasks instances required and the appropriate partition
StartCount <INTEGER> Number of times job has been started by Moab
StartPriority <INTEGER> Start priority of job
StartTime Time job was started by the resource management system
State One of Idle, Starting, Running, etc Current Job State
SubmitTime Time job was submitted to resource management system
Swap <INTEGER> Amount of swap disk required by job (in MB)
Task Distribution* Square bracket delimited list of nodes
Time Queued
Total Requested Nodes** <INTEGER> Number of nodes the job requested
Total Requested Tasks <INTEGER> Number of tasks requested by job
User <STRING> Name of user submitting job
Utilized Resources Per Task* <FLOAT>
WallTime [[[DD:]HH:]MM:]SS of [[[DD:]HH:]MM:]SS Length of time job has been running out of the specified limit

In the above table, fields marked with an asterisk (*) are only displayed when set or when the -v flag is specified. Fields marked with two asterisks (**) are only displayed when set or when the -v -v flag is specified.

1.7.3 Arguments

Argument Format Default Description Example
--flags --flags=future (none) Evaluates future eligibility of job (ignore current resource state and usage limitations)
$ checkjob -v --flags=future 8370992
Display reasons why idle job is blocked ignoring node state and current node utilization constraints.
-l (Policy level) <POLICYLEVEL> HARD, SOFT, or OFF (none) Reports job start eligibility subject to specified throttling policy level.
$ checkjob -l SOFT 8370992
$ checkjob -l HARD 8370992
-n (NodeID) <NODEID> (none) Checks job access to specified node and preemption status with regards to jobs located on that node.
checkjob -n uc1n320 8370992
-r (Reservation) <RSVID> (none) Checks job access to specified reservation <RSVID>.
checkjob -r rainer_kn_resa.1 8370992
-v (Verbose) (n/a) Sets verbose mode. If the job is part of an array, the -v option shows pertinent array information before the job-specific information. Specifying the double verbose ("-v -v") displays additional information about the job. See more infos here!
checkjob -v 8370992

8370992 = JobId (see examples above)

1.7.4 Parameters

Parameters, descriptions (a lot!) and examples can be found in Adaptive documentation page.

  • For further options of checkjob see the manual page of checkjob
    $ man checkjob

1.7.5 Checkjob Examples

Here is an example from the bwUniCluster.

showq -u $USER   # show my own jobs
active jobs------------------------
JOBID              USERNAME      STATE PROCS   REMAINING            STARTTIME
8370992            kn_popnn    Running     1  2:03:56:50  Wed Jan 13 15:59:01
8370991            kn_popnn    Running     1  2:03:56:50  Wed Jan 13 15:59:01
[...]
8371040            kn_popnn    Running     1  2:03:59:14  Wed Jan 13 16:01:25

49 active jobs          49 of 7072 processors in use by local jobs (0.69%)
                        434 of 434 nodes active      (100.00%)
eligible jobs----------------------
JOBID              USERNAME      STATE PROCS     WCLIMIT            QUEUETIME
0 eligible jobs   

blocked jobs-----------------------
JOBID              USERNAME      STATE PROCS     WCLIMIT            QUEUETIME
0 blocked jobs   

Total jobs:  49
$
$ # now, see what's up with the first job in my queue
$ 
$ checkjob 8370992
job 8370992

AName: Nic_cit_09_Apo_zal_07_cl2_07_cl3_07_cl5_07_2.moab
State: Running 
Creds:  user:kn_pop'nnnnn'  group:kn_kn  account:konstanz  class:singlenode
WallTime:   20:04:28 of 3:00:00:00
BecameEligible: Wed Jan 13 15:58:11
SubmitTime: Wed Jan 13 15:57:58
  (Time Queued  Total: 00:01:03  Eligible: 00:00:58)

StartTime: Wed Jan 13 15:59:01
TemplateSets:  DEFAULT
NodeMatchPolicy: EXACTNODE
Total Requested Tasks: 1

Req[0]  TaskCount: 1  Partition: uc1
Memory >= 4000M  Disk >= 0  Swap >= 0
Dedicated Resources Per Task: PROCS: 1  MEM: 4000M
NodeSet=ONEOF:FEATURE:[NONE]

Allocated Nodes:
[uc1n320:1]

SystemID:   uc1
SystemJID:  8370992

IWD:            /pfs/data2/home/kn/kn_kn/kn_pop139522/fastsimcoal25/Midas_RAD_anchored/Nic_cit_09_Apo_zal_07_cl2_07_cl3_07_cl5_07/1col_DIV-resize_admix_zal1st_starlike_cl2-base_CL-growths_GL-bottlegrowth_onlyintramig/new_est/run_2
SubmitDir:      /pfs/data2/home/kn/kn_kn/kn_pop139522/fastsimcoal25/Midas_RAD_anchored/Nic_cit_09_Apo_zal_07_cl2_07_cl3_07_cl5_07/1col_DIV-resize_admix_zal1st_starlike_cl2-base_CL-growths_GL-bottlegrowth_onlyintramig/new_est/run_2
Executable:     /opt/moab/spool/moab.job.voNyde

StartCount:     1
BypassCount:    1
Partition List: uc1
Flags:          BACKFILL,FSVIOLATION,GLOBALQUEUE
Attr:           BACKFILL,FSVIOLATION
StartPriority:  -3692
PE:             1.00
Reservation '8370992' (-20:04:34 -> 2:03:55:26  Duration: 3:00:00:00)
[...]

You can use standard Linux pipe commands to filter the very detailed checkjob output.

  • Is the job still running?
$ checkjob 8370992 | grep ^State
State: Running 
  • Write your own checkjob wrapper to modify the checkjob output to have it all one's own way. Here's an example (cut/paste it if you'd like to use this one):
#!/bin/bash
# cj Display Moab-Jobstatus (checkjob wrapper)
# 'rainer.rutka@uni-konstanz.de "2015-09-21 ~1.1
# $1 = Moab Job-Nummer, $2 = Sleep-Time in seconds
shopt -s extglob        # "+"-Zeichen/Integerpruefung

rev=$(tput rev)
res=$(tput sgr0)
resc=$(tput setf 0)
gruen=$(tput setf 2)
rot=$(tput setf 4)

[ "$1" == "-h" ] && { echo "usage: $(basename "$0") (int)Moab-Job-Number [(int)Intervall/Sekunden(Default:30s)]"; exit 0; }
[ "$1" ] || { echo "Moab-Jobnummer fehlt..."; exit 1; } && { jobid="$1"; }
[ ! -z "${jobid##+([0-9])}" ] && { echo "<${jobid}> ist keine Zahl!"; exit 1; }
[ "$2" ] && { let schlaf="$2"; } || { let schlaf=30; }
[ ! -z "${2##+([0-9])}" ] && { echo "<${2}> ist keine Zahl!"; exit 1; }

let sekunden=0
let von=1
let bis=73
let rechts=1
pos () { tput cup ${1} ${2}; }

dauer () {
   pos 0 90
   let gesamt=$[$sekunden*$schlaf]
   pos 0 38
    echo 'Wartezeit:'
   [ "$gesamt" -lt 60 ] && { pos 0 49; echo "${gruen}${gesamt}s${resc}"; }
   [ "$gesamt" -ge 60 ] && { pos 0 49; echo "${gruen}$[$gesamt / 60]m$[$gesamt % 60]s ${resc}"; 
   [ "$gesamt" -ge 3600 ] && { pos 0 49; echo "${gruen}$[$gesamt / 3600]h$[$gesamt % 3600 / 60]m$[$gesamt % 60]s ${resc}"; }
}

checkit () {
   tput clear
   pos 0 1
   echo "${resc}Job: ${gruen}${jobid}${resc} Status: "
   pos 0 60
   echo "Intervall: ${schlaf}s"

   pos 1 1
   echo '>'

   while true
   do
      status=$(checkjob ${jobid} | grep ^State:)
      pos 0 22
      echo "<${rot}${status/State:}${resc}>" 
      dauer
      [ "${status/State:}" == "" ] && { let sekunden=0; echo "${rot} ERROR! ${resc}"; exit 1; }
      [ "${status/State:}" == " Completed " ] && { echo "${gruen} Job ${jobid} ist fertig!${resc}"; exit 0; }
      [ "${status/State:}" == " Removed " ] && { echo "${rot} Job ${jobid} wurde gelöscht!${resc}"; exit 1; }
      [ "$rechts" == "$bis" ] && { let rechts="$von"; checkit ${jobid} ${schlaf} ; } || let rechts++
      pos 1 $rechts
      sleep ${schlaf}
      echo -n .
      let sekunden++;
   done
}
checkit ${*}

Using the same Job-ID as above the output of the script (named 'cj'):

$ cj -h
usage: cj (int)Moab-Job-Number [(int)Intervall/Sekunden(Default:30s)]
$ cj 8370992 10 # update every 10 seconds
 Job: 8370992 Status: < Running >     Wartezeit: 30m50s     Intervall: 10s
 >.........................................

1.8 Blocked job information : checkjob -v

This command allows to check the detailed status and resource requirements of your active, queued, or recently completed job. Additionally, this command performs numerous diagnostic checks and determines if and where the job could potentially run. Diagnostic checks include policy violations, reservation constraints, preemption status, and job to resource mapping. If a job cannot run, a text reason is provided along with a summary of how many nodes are and are not available. If the -v flag is specified, a node by node summary of resource availability will be displayed for idle jobs.

If your job is blocked do not delete it!

1.8.1 Job Eligibility

If a job cannot run, a text reason is provided along with a summary of how many nodes are and are not available. If the -v flag is specified, a node by node summary of resource availability will be displayed for idle jobs. For job level eligibility issues, one of the following reasons will be given:

Reason Description
job has hold in place one or more job holds are currently in place
insufficient idle procs there are currently not adequate processor resources available to start the job
idle procs do not meet requirements adequate idle processors are available but these do not meet job requirements
start date not reached job has specified a minimum start date which is still in the future
expected state is not idle job is in an unexpected state
state is not idle job is not in the idle state
dependency is not met job depends on another job reaching a certain state
rejected by policy job start is prevented by a throttling policy

If a job cannot run on a particular node, one of the following 'per node' reasons will be given:

Description Reason
Class Node does not allow required job class/queue
CPU Node does not possess required processors
Disk Node does not possess required local disk
Features Node does not possess required node features
Memory Node does not possess required real memory
Network Node does not possess required network interface
State Node is not Idle or Running

1.8.2 Example

A blocked job has hit a limit and will become idle if resource get free. The "-v (verbose)" mode of 'checkjob' also shows a message "BLOCK MSG:" for more details.

checkjob -v 8370992
[...]

 BLOCK MSG: job <jobID> violates active SOFT MAXPROC limit of 750 for acct mannheim
  partition ALL (Req: 160  InUse: 742) (recorded at last scheduling iteration)

In this case the job has reached the account limit of mannheim while requesting 160 core when 742 were already in use.
The most common cause of blocked jobs is a violation of MAXPROC or MAXPS limits, indicating that your group has scheduled too many outstanding processor seconds at the same time.

1.8.3 The Limits imposed by the Scheduler

This refers to limits on the number of jobs in the queue which are enforced by the scheduler. The largest factors in determining limits in numbers of jobs are the Maximum Processor Seconds (MAXPS) and the Maximum Processors (MAXPROC) for each account. The MAXPS is the total number of processor core seconds (ps) allocated for each (group) account. It is based on fairshare values in dependency of the configured values for your <OE> (Konstanz, Ulm, etc. ...) .
Users can submit as many jobs but they cannot be scheduled to run if their groups MAXPROC or MAXPS value is exceeded. They instead enter into a "HOLD" state. If the limits of the group is not reached but the resources are not available, the jobs enter into "IDLE" state and will run once the requested resources become available.

1.9 Canceling own jobs : canceljob

Caution: This command is deprecated. Use mjobctl -c instead!

The canceljob <JobId> command is used to selectively cancel the specified job(s) (active, idle, or non-queued) from the queue.

Note that only own jobs can be cancelled.

1.9.1 Access

This command can be run by any Moab Administrator and by the owner of the job.

Flag Name Format Default Description Example
-h HELP n./a. Display usage information
$ canceljob -h
JOB ID <STRING> (none) a jobid, a job expression, or the keyword 'ALL' see: example use of canceljob

1.9.2 Example Use of Canceljob

Example use of canceljob run on the bwUniCluster

[...calc_repo-0]$ msub bwhpc-fasta-example.moab
8374356              # this is the JobId
$
$ checkjob 8374356
job 8374356
AName: fasta36_job
State: Idle 
Creds:  user:kn_pop235844  group:kn_kn  account:konstanz  class:multinode
WallTime:   00:00:00 of 00:10:00
BecameEligible: Fri Jan 15 12:10:53
SubmitTime: Fri Jan 15 12:10:43
  (Time Queued  Total: 00:00:10  Eligible: 00:00:08)
[...]

$ checkjob 8374356 | grep ^State:
State: Idle              # state is 'Idle'

$ # now cancel the job
$ canceljob 8374356
job '8374356' cancelled

$ checkjob 8374356 | grep ^State:
State: Removed      # state turned into 'Removed'

1.10 Moab Job Control : mjobctl

The mjobctl command controls various aspects of jobs. It is used to submit, cancel, execute, and checkpoint jobs. It can also display diagnostic information about your own jobs.

1.10.1 Canceling own jobs : mjobctl -c

If you want to cancel a job that has been submitted, please do not use the PBS/Torque qdel (n./a.) or the deprecated canceljob commands.
Instead, use mjobctl -c <jobid>.

Flag Format Default Description Example
-cl JobId (none) Cancel a job. see: example use of mjobctl -c

1.10.1.1 Example Use of mjobctl -c

Canceling a job on the bwUniCluster

[...-calc_repo-0]$ msub bwhpc-fasta-example.moab
8374426

$ checkjob 8374426 | grep ^State
State: Idle                # job is 'Idle'

$ mjobctl -c 8374426
job '8374426' cancelled    # job is cancelled

checkjob 8374426 | grep ^State
State: Removed             # now, job is removed

$ # my own checkjob wrapper
cj 8374426
 Job: 8374426 Status: < Removed >     Wartezeit: 1m30s         Intervall: 30s
 Job 8374426 wurde gelöscht!
$ 

1.10.1.2 E-Mail notification of mjobctl -c

You will receive an e-mail notification like this (example with Slurm)

From: slurm@uc1-sv1.scc.kit.edu
Subject: SLURM Job_id= 8374426 Name=fasta36_job Ended, Run time 00:01:30, CANCELLED, ExitCode 0

from the resource manager shortly after the job was removed from the queue.

You need to add these MOAB environments into your submit script or command line parameters for the msub command:

#MSUB -m ae
#MSUB -M e-mail@FQDN (e-mail address like: name@domain.de)
msub -m option(s)
Option Description
-m option(s) Defines the set of conditions (a=abort | b=begin | e=end) when the server will send a mail message about the job to the user.
-N name Gives a user specified name to the job. Note that job names do not appear in all MOAB job info displays, and do not determine how your jobs stdout/stderr files are named.

1.10.2 Other Mjobctl-Options

See also:


Not all of the listed options are available for 'normal' users. Some are for MOAB-admins only.