Commands - mjobctl
Moab Workload Manager®

mjobctl

(Moab Job Control)

Synopsis

mjobctl -c jobexp
mjobctl -C jobexp
mjobctl -h [User|System|Batch|Defer|All] jobexp
mjobctl -m attr{+=|=|-=}val jobexp
mjobctl -M [<SIGNO>] jobexp
mjobctl -n <JOBNAME>
mjobctl -p <PRIORITY> jobexp
mjobctl -q {diag|starttime} jobexp
mjobctl -r jobexp
mjobctl -R jobexp
mjobctl -s jobexp 
mjobctl -u [User|System|Batch|Defer|All] jobexp
mjobctl -w attr{+=|=|-=}val jobexp
mjobctl -x jobexp

Overview

   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 each job. The mjobctl command enables the Moab administrator to control almost all aspects of job behavior. See 11.0 General Job Administration for more details on jobs and their attributes.

Format

---
Flag Name Format Default Description Example
-c CANCEL JOBID Cancel a job
mjobctl -c
> mjobctl -c job1045

cancel job job1045
-C CHECKPOINT JOBID --- Checkpoint a job
mjobctl -C
> mjobctl -C job1045

checkpoint job job1045
-h HOLD <HOLDTYPE> <JOBEXP>
 
<HOLDTYPE> = { user | batch | system | defer | ALL }
user Set or release a job hold

See Section 11.1, Job Holds for more information
mjobctl -h
> mjobctl -h user job1045
set a user hold on job job1045

mjobctl -h
> mjobctl -u all job1045
unset all holds on job job1045
-m MODIFY <ATTR>{ += | = | -= } <VAL>

  <ATTR>={ account | allocnodelist | awduration | class | deadline | depend | env | flags | group | hold | hostlist | jobname | loglevel | messages | nodes | partition | qos | reqreservation | rmxstring | reqawduration | sysprio | userprio | var | wclimit }
--- Modify a specific job attribute.  NOTE: for priority, use the '-p' flag NOTE: Modification of the job dependency is also communicated to the RM in the case of SLURM and PBS/Torque
mjobctl -m
> mjobctl -m reqawduration+=600 1664
add 10 minutes to the job walltime

mjobctl -m
> mjobctl -m eeduration=-1 1664
reset job's effective queue time

mjobctl -m
> mjobctl -m var=Flag1=TRUE 1664
set the job variable Flag1 to TRUE
-M MESSAGE {<INTEGER>|sig<SIGNAME>} --- send a signal to all jobs matching the job expression
mjobctl -M
> mjobctl -M INT 1664
send an interrupt signal to job 1664

mjobctl -M
> mjobctl -M 47 1664
send signal 47 to job 1664
-n NAME   --- select jobs by job name
-p PRIORITY   --- modify a job's system priority
mjobctl -p
 
> mjobctl -p +1000 job1045
add 1000 priority points to the job's overall priority
-q QUERY [ diag | hostlist | starttime ] <JOBEXP> --- Query a job.
mjobctl -q
> mjobctl -q diag job1045
query job job1045

mjobctl -q
> mjobctl -q starttime job1045
query starttime of job job1045
-r RESUME JOBID --- Resume a job. mjobctl -r job1045
 
(resume job job1045)
-R REQUEUE JOBID --- Requeue a job. mjobctl -R job1045
 
(requeue job job1045)
-s SUSPEND JOBID --- Suspend a job mjobctl -s job1045
 
(suspend job job1045)
-S SUBMIT JOBID --- Submit a job. mjobctl -S job1045
 
(submit job job1045)
-u UNHOLD [<TYPE>[:<TYPE>]] <JOBEXP>
 
<TYPE> = [ user | system | batch | defer | ALL ]
ALL Release a hold on a job

(See Section 11.1, Job Holds for more information)
mjobctl -w
> mjobctl -u user:system scrib.1045
release user and system holds on job
-w WHERE [CompletionTime | StartTime][<= | = | >=]<EPOCH_TIME> --- Add a "Where" constraint clause to the current command. The "Where" constraint only works for completed jobs. CompletionTime will filter according to the completed jobs' completion times. StartTime will filter according to the completed jobs' start times.
mjobctl -w
> mjobctl -q diag ALL --flags=COMPLETED --format=xml 
-w CompletionTime>=1167634800 -w CompletionTime<=1172732400
prints all completed jobs still in memory that completed between Jan. 1, 2007 and Mar. 1, 2007
-x EXECUTE JOBID --- Execute a job.
mjobctl -x
> mjobctl -x job1045
execute job job1045

Parameters

Name Format Default Description Example
JOB EXPRESSION <STRING> --- the name of a job or a regular expression for several jobs

NOTE: Moab uses regular expressions conforming to the POSIX 1003.2 standard.  This standard is somewhat different than the regular expressions commonly used for filename matching in Unix environments. (see 'man 7 regex')  To interpret a job expression as a regular expression, either specify the expression using a designated expression or wildcard character (one of '[]*?^$') or set the parameter USEJOBREGEX to TRUE

NOTE: In most cases, it is necessary to quote the job expression (i.e. "job13[5-9]") to prevent the shell from intercepting and interpreting the special characters.

mjobctl -c "80.*"
> mjobctl -c "80.*"

job '802' cancelled
job '803' cancelled
job '804' cancelled
job '805' cancelled
job '806' cancelled
job '807' cancelled
job '808' cancelled
job '809' cancelled
Cancel all jobs starting with '80'

mjobctl -m "74[3-5]"
> mjobctl -m priority+=200 "74[3-5]" 

job '743' system priority modified
job '744' system priority modified
job '745' system priority modified

Example 1

> mjobctl -q diag ALL --format=xml

<Data><job AWDuration="346" Class="batch" CmdFile="jobsleep.sh" EEDuration="0" 
EState="Running" Flags="RESTARTABLE" Group="test" IWD="/home/test" JobID="11578" QOS="high" 
RMJID="11578.lolo.icluster.org" ReqAWDuration="00:10:00" ReqNodes="1" ReqProcs="1" StartCount="1" 
StartPriority="1" StartTime="1083861225" StatMSUtl="903.570" StatPSDed="364.610" StatPSUtl="364.610" 
State="Running" SubmissionTime="1083861225" SuspendDuration="0" SysPrio="0" SysSMinTime="00:00:00" 
User="test"><req AllocNodeList="hana" AllocPartition="access" ReqNodeFeature="[NONE]" 
ReqPartition="access"></req></job><job AWDuration="346" Class="batch" CmdFile="jobsleep.sh" 
EEDuration="0" EState="Running" Flags="RESTARTABLE" Group="test" IWD="/home/test" JobID="11579" 
QOS="high" RMJID="11579.lolo.icluster.org" ReqAWDuration="00:10:00" ReqNodes="1" ReqProcs="1" 
StartCount="1" StartPriority="1" StartTime="1083861225" StatMSUtl="602.380" StatPSDed="364.610" 
StatPSUtl="364.610" State="Running" SubmissionTime="1083861225" SuspendDuration="0" SysPrio="0" 
SysSMinTime="00:00:00" User="test"><req AllocNodeList="lolo" AllocPartition="access" 
ReqNodeFeature="[NONE]" ReqPartition="access"></req></job></Data>

See Also