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.

Modification of the job dependency is also communicated to the resource manager
in the case of SLURM and PBS/Torque.

Adding --flags=warnifcompleted causes a warning message to print
when a job completes.

To define values for awduration, eeduration, minstarttime,
reqawduration, and wclimit, use the time spec format.

A non-active job's partition list can be modified by adding or subtracting
partitions. Note, though, that when adding or subtracting multiple partitions,
each partition must have its own -m partition{+= | = | -=}name on the
command line. (See example for adding multiple partitions.)

Example:

> mjobctl -m reqawduration+=600 1664

Add 10 minutes to the job walltime.

> mjobctl -m eeduration=-1 1664

Reset job's effective queue time, to when the job was submitted.

> mjobctl -m var=Flag1=TRUE 1664

Set the job variable Flag1 to TRUE.

> mjobctl -m notificationaddress="name@server.com"

Sets the notification e-mail address associated with a job to
name@server.com.

Priority is the job priority plus the system priority. Each format affects the job and system priorities differently. Using the format '<VAL> <JOBID>' or '+<VAL> <JOBID>'
will set the system priority to the maximum system priority plus the specified value. Using '+=<VAL> <JOBID>' or '<VAL> <JOBID>
--flags=relative' will relatively increase the
job's priority and set the system priority. Using the format '-=<VAL>
<JOBID>' sets the system priority to 0, and does not change priority based on
<VAL> (it will not decrease priority by that number).

For the following example, job1045 has a priority of 10, which is composed of a job priority of 10 and a system priority of 0.

> mjobctl -p +1000 job1045

The system priority changes to the max system priority plus 1000 points, ensuring that this job will be higher priority than all normal jobs. In this case, the job priority of 10 is not added, so the priority of job1045 is now 1000001000.

> mjobctl -p -=1 job1045

The system priority of job1045 resets to 0. The job priority is still 10, so the overall priority becomes 10.

> mjobctl -p 3 job1045 --flags=relative

Adds 3 points to the relative system priority. The priority for job1045 changes from 10 to 13.

-q - Query

Format:

[ diag( ALL ( --orange))| hostlist |
starttime| template] <JOBEXP>

Default:

---

Description:

Query a job.

Example:

> mjobctl -q diag job1045

Query job job1045.

> mjobctl -q diag ALL --format=xml --orange=105001-110000

Query all jobs in range 105001-110000 and return the output in machine-readable XML.

> mjobctl -q starttime job1045

Query starttime of job job1045.

> mjobctl -q template <job>

Query job templates. If the <job> is set to ALL or empty, it will return information for all job templates.

> mjobctl -q wiki <jobName>

Query a job with the output displayed in a WIKI string. The job's name
may be replaced with ALL.

Add a where constraint clause to the current
command. As it pertains to CompletionTime |
StartTime, the where constraint only works for
completed jobs. CompletionTime filters according to the completed jobs'
completion times; StartTime filters according to the completed jobs' start times.

Execute a job. The -w option allows flags to be set
for the job. Allowable flags are, ignorepolicies, ignorenodestate,
and ignorersv.

Example:

> mjobctl -x job1045

Execute job job1045.

> mjobctl -x -w flags=ignorepolicies job1046

Execute job job1046 and ignore policies, such as MaxJobPerUser.

Parameters

JOB
EXPRESSION

Format:

<STRING>

Default:

---

Description:

The name of a job or a regular expression for several jobs. The flags that support job expressions can use node expression syntax as described in Node Selection. Using "x:" indicates the following string is to be interpreted as a regular expression, and using "r:" indicates the following string is to be interpreted as a range.
Job expressions do not work for array sub-jobs.

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, use x: or in the Moab
configuration file (moab.cfg), set the parameter USEJOBREGEX to
TRUE (and take note of the following caution).

If you set USEJOBREGEX to TRUE,
Moab treats all mjobctl job expressions as regular expressions
regardless of whether wildcards are specified. This should be used with
extreme caution since there is high potential for unintended
consequences. For example, specifying canceljob m.1 will not
only cancel m.1, but also
m.11,m.12,m13, and so on.

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 -h x:17.*
# This puts a hold on any job that has a 17 that is followed by an unlimited amount of any
# character and includes jobs 1701, 17mjk10, and 17DjN_JW-07
> mjobctl -h r:1-17
# This puts a hold on jobs 1 through 17.

XML Output

mjobctl information can be reported as XML as well. This is done with
the command "mjobctl -q diag <JOB_ID>".

XML Attributes

Name

Description

Account

the account assigned to the job

AllocNodeList

the nodes allocated to the job

Args

the job's executable arguments

AWDuration

the active wall time consumed

BlockReason

the block message index for the reason the job is not
eligible

Bypass

Number of times the job has been bypassed by other
jobs

Calendar

the job's timeframe constraint calendar

Class

the class assigned to the job

CmdFile

the command file path

CompletionCode

the return code of the job as extracted from the RM

CompletionTime

the time of the job's completion

Cost

the cost of executing the job relative to an allocation
manager

CPULimit

the CPU limit for the job

Depend

any dependencies on the status of other jobs

DRM

the master destination RM

DRMJID

the master destination RM job ID

EEDuration

the duration of time the job has been eligible for
scheduling

EFile

the stderr file

Env

the job's environment variables set for execution

EnvOverride

the job's overriding environment variables set for
execution

EState

the expected state of the job

EstHistStartTime

the estimated historical start time

EstPrioStartTime

the estimated priority start time

EstRsvStartTime

the estimated reservation start time

EstWCTime

the estimated walltime the job will execute

ExcHList

the excluded host list

Flags

Command delimited list of Moab flags on the jo

GAttr

the requested generic attributes

GJID

the global job ID

Group

the group assigned to the job

Hold

the hold list

Holdtime

the time the job was put on hold

HopCount

the hop count between the job's peers

HostList

the requested host list

IFlags

the internal flags for the job

IsInteractive

if set, the job is interactive

IsRestartable

if set, the job is restartable

IsSuspendable

if set, the job is suspendable

IWD

the directory where the job is executed

JobID

the job's batch ID.

JobName

the user-specifed name for the job

JobGroup

the job ID relative to its group

LogLevel

the individual log level for the job

MasterHost

the specified host to run primary tasks on

Messages

any messages reported by Moab regarding the job

MinPreemptTime

the minimum amount of time the job must run before being
eligible for preemption

Notification

any events generated to notify the job's user

OFile

the stdout file

OldMessages

any messages reported by Moab in the old message style
regarding the job