qsub(1B)
๐ qsub โ PBS Professional ๐
okay bestie, welcome to qsub(1B) from the PBS Professional manual โ yes, section 1B (she's fancy, she's a "B" section, we love her for it) ๐
This is the page where the queen herself shows up: qsub, the command that gets your job into PBS. Grab a snack, because this synopsis is a buffet and we're gonna walk it like a runway. ๐
โจ NAME โจ
qsub โ submit a job to PBS ๐
Like, that's literally her whole thing. She submits jobs. To PBS. Main character energy from line one, no cap. ๐
๐ฆ SYNOPSIS ๐ฆ
okay so here's the full shape of it โ every bracket here is optional, which means the options are giving "choose your own adventure" and honestly? obsessed. ๐
qsub [-a <date and time>] [-A <account string>] [-c <checkpoint spec>]
[-C <directive prefix>] [-e <path>] [-f] [-h]
[-I [-G [-- <GUI application/script>]] | [-X]] [-j <join>]
[-J <range> [%<max subjobs]] [-k <discard>] [-l <resource list>]
[-m <mail events>] [-M <user list>] [-N <name>] [-o <path>]
[-p <priority>] [-P <project>] [-q <destination>] [-r <y|n>]
[-R <remove options>] [-S <path list>] [-u <user list>]
[-v <variable list>] [-V] [-W <additional attributes>] [-z]
[- | <script> | -- <executable> [<arguments to executable>]]
qsub --version
a few lil things to clock about that, because the synopsis is lowkey telling a story ๐ โจ
- the very last argument slot is a three-way vibe check: you can pipe from standard input with a bare
-, hand over a<script>, or go full-- <executable> [<arguments to executable>]and pass the executable plus its arguments along. choose wisely, babe ๐ซถ - there's also a whole standalone incantation,
qsub --version, sitting on its own line like she doesn't even need the rest of the options. independent icon behavior. ๐ (the details on what she does are coming in the next parts โ eyes peeled ๐) - notice
[-I [-G [-- <GUI application/script>]] | [-X]]โ that's a little nested situation with a|in the middle, so it's-Iworld or-Xworld, and inside the-Iworld there's a-Gworld. inception but make it options. ๐ - and
[-J <range> [%<max subjobs]]is doing that same nested-bracket thing with a%. she's got layers. ๐
just so we're clear, bestie โ the synopsis is the shape of the command, not the full tea. Every single one of those flags has a whole personality (and rules, and defaults, and sometimes chaos) which is all coming up in the sections below. don't go running off with just the synopsis, iykyk ๐ญ
that's the vibe check on qsub's identity and her whole bracket situation โ
โ more parts are coming, don't go anywhere, we're so not done ๐
๐ DESCRIPTION ๐
okay so this is the whole point of qsub: you use it to submit a batch job to PBS. And submitting a PBS job is basically three things at once โ you're specifying a task, you're requesting resources, and you're setting job attributes. All in one go. Slay. โจ
The qsub command can read from a job script, from standard input, or from the command line. Once you've submitted, PBS hands you back the job identifier for that job, and for a regular job it's giving:
<sequence number>.<server name>
For an array job, it's giving:
<sequence number>[].<server name>
During execution, jobs can be interactive or non-interactive. Heads up though, bestie โ interactive jobs are not rerunnable, and if they're blocking, you cannot use their exit status. ๐ญ That's just how it is.
Jobs are run as the user and group who submitted the job. No cap.
๐ Background Process ๐
By default, on the first invocation, qsub spawns a background process to manage communication with the PBS server. Later invocations of qsub attempt to communicate with this background process. Cute, right? ๐
But โ and this is the part where you go ๐ โ under certain circumstances, calls to qsub when it uses the background process can result in communication problems. You can prevent qsub from spawning a background process by using the -f option, although this can degrade performance. So like, pick your poison, iykyk.
๐ Where PBS Puts Job Files ๐
By default, PBS copies the stdout and stderr files from the job back to the current working directory where the qsub command is executed. That's the vibe. ๐
But you can absolutely specify the output paths using the -o and -e options. You can also specify which and whether these files should be kept on the execution host via the -k option, or deleted, using the -R option. See the -k, -o, -e, and -R options. ๐ซถ
๐ Submitting Jobs By Using Scripts ๐
To submit a PBS job by using a script, you specify a job script on the command line:
qsub [<options>] <script name>
For example:
qsub myscript.sh
Job scripts are run as the user and group who submitted the job. And they can be written in Python, Linux shells such as csh and sh, the Windows command batch language, Perl, etc. So many options, we love versatility. ๐
A PBS job script consists of the following:
- Optional shell specification
- Any PBS directives
- The user's tasks: programs, commands, or applications
- Optional comments (Under Windows, comments can contain only ASCII characters.)
๐ Using Shells and Interpreters ๐
By default, PBS uses your login shell to run your script. But you can optionally specify a different shell or interpreter to run your script โ main character energy, honestly:
Via the -S option to qsub:
qsub -S <path to shell> <script name>
For example:
qsub -S /bin/bash myscript.sh
You can specify a different interpreter in the first line of your script. For example:
cat myscript.sh
#!/bin/bash
#PBS -N MyHelloJob
echo "Hello"
๐ Python Job Scripts ๐
You can use the same Python script under Linux or under Windows, if the script is written to be portable. PBS includes a Python package, allowing Python job scripts to run โ you do not need to install Python. Obsessed. ๐
You can include PBS directives in a Python job script as you would in a Linux shell script. Python job scripts can access Win32 APIs, including the following modules:
Win32apiWin32conPywintypes
For example, we have a Python job script that includes PBS directives:
cat myjob.py
#!/usr/bin/python
#PBS -l select=1:ncpus=3:mem=1gb
#PBS -N HelloJob
print "Hello"
So long as the first line of the script is the #!/usr/bin/python line or similar, you don't need to do anything special to run a python script. Periodt.
qsub <script name>
To run a Python job script under Windows, use the path to the pbs_python executable on the execution host:
qsub -S <pbs_python path on execution host> <script name>
For example,
qsub -S %PBS_EXEC%\bin\pbs_python.exe <script name>
If the script pathname contains spaces, it must be quoted, for example:
qsub -S "C:\Program Files\PBS Pro\bin\pbs_python.exe" <script name>
๐ง Linux Shell Job Scripts ๐ง
For example, we have a Linux job script named "weatherscript" for a job named "Weather1" which runs the executable "weathersim" on Linux:
#!/bin/sh
#PBS -N Weather1
#PBS -l walltime=1:00:00
/usr/local/weathersim
To submit the job, the user types:
qsub weatherscript <return>
๐ช Windows Command Job Scripts ๐ช
For example, we have a script named "weather.exe" for a job named "Weather1" which runs under Windows:
#PBS -N Weather1
#PBS -l walltime=1:00:00
weathersim.exe
To submit the job, the user types:
qsub weather.exe <return>
โ ๏ธ In Windows, if you use notepad to create a job script, the last line does not automatically get newline-terminated. Be sure to put one explicitly, otherwise, PBS job will get the following error message:
More?
when the Windows command interpreter tries to execute that last line. ๐ญ Not the More? jumpscare. Please add that newline, bestie.
โจ๏ธ Submitting Jobs From Standard Input โจ๏ธ
To submit a PBS job by typing job specifications at the command line, you type:
qsub [<options>] [-] <return>
then type any directives, then any tasks, followed by:
- Linux: CTRL+D on a line by itself
- Windows: CTRL+Z <return>
to terminate the input.
The qsub command behaves the same both with and without the dash operand. For example, on Linux:
qsub <return>
#PBS -N StdInJob
sleep 100
<CTRL-D>
๐ Submitting Job Directly by Specifying Executable on Command Line ๐
To submit a job directly, you specify the executable on the command line:
qsub [<options>] -- <executable> [<arguments to executable>] <return>
When you run qsub this way, it runs the executable directly. It does not start a shell, so no shell initialization scripts are run, and execution paths and other environment variables are not set. There is not an easy way to run your command in a different directory. You should make sure that environment variables are set correctly, and you will usually have to specify the full path to the command. ๐ซก
For example, to run myprog with the arguments a and b:
qsub -- myprog a b <return>
For example, to run myprog with the arguments a and b, naming the job "JobA":
qsub -N JobA -- myprog a b <return>
On Linux, you need to specify the path to myprog, so the previous example becomes:
qsub -N JobA -- /path/to/myprog a b <return>
๐ง Requesting Resources and Placing Jobs ๐ง
Requesting resources includes setting limits on resource usage and controlling how the job is placed on vnodes. It's giving very organized.
Resources are requested by using the -l option, either in job-wide requests using <resource name>=<value> pairs, or in chunks inside of selection statements.
See the pbs_resources(7B) man page.
Job-wide <resource name>=<value> requests are of the form:
-l <resource name>=<value>[,<resource name>=<value> ...]
The selection statement is of the form:
-l select=[<N>:]<chunk>[+[<N>:]<chunk> ...]
where N specifies how many of that chunk, and a chunk is of the form:
<resource name>=<value>[:<resource name>=<value> ...]
You choose how your chunks are placed using the place statement. The place statement can contain the following elements, in any order:
-l place=[<arrangement>][:<sharing>][:<grouping>]
where:
arrangementโ Whether this chunk is willing to share this vnode or host with other chunks from the same job. One offree|pack|scatter|vscattersharingโ Whether this this chunk is willing to share this vnode or host with other jobs. One ofexcl|shared|exclhostgroupingโ Whether the chunks from this job should be placed on vnodes that all have the same value for a resource. Can have only one instance ofgroup=<resource name>
And here's what those arrangement values actually mean, bestie:
freeโ Place job on any vnode(s).packโ All chunks are taken from one host.scatterโ Only one chunk with any MPI processes is taken from a host. A chunk with no MPI processes may be taken from the same vnode as another chunk.vscatterโ Only one chunk is taken from any vnode. Each chunk must fit on a vnode.exclโ Only this job uses the vnodes chosen.sharedโ This job can share the vnodes chosen.exclhostโ The entire host is allocated to the job.group=<resource name>โ Chunks are grouped according to a resource. All vnodes in the group must have a common value forresource, which can be either the built-in resourcehostor a custom vnode-level resource.resource namemust be a string or a string array.
๐ The place statement cannot begin with a colon. Colons are delimiters; use them only to separate parts of a place statement, unless they are quoted inside resource values.
Note that vnodes can have sharing attributes that override job placement requests. See the pbs_node_attributes.7B man page.
๐ Caveats for Requesting Resources ๐
Do not mix old-style resource or vnode specifications with the new select and place statements. Do not use one in a job script and the other on the command line. Mixing the two will result in an error. You've been warned, bestie. ๐ญ
You cannot submit a job requesting a custom resource which has been created to be invisible or read-only for unprivileged users, regardless of your privilege. A Manager or Operator can use the qalter command to change a job's request for this kind of custom resource. ikyk. ๐
For more on resource requests, usage limits and job placement, see pbs_resources(7B).
๐ Setting attributes ๐
The job submitter sets job attributes by giving options to the qsub command or by using PBS directives. Most qsub options set a job attribute, and have a corresponding PBS directive with the same syntax as the option. Attributes set via command-line options take precedence over those set using PBS directives. See pbs_job_attributes.7B.
๐ธ Changing qsub Behavior ๐ธ
The behavior of the qsub command may be affected by the server's default_qsub_arguments attribute. This attribute can set the default for any job attribute. The default_qsub_arguments server attribute is settable by the administrator, and is overridden by command-line arguments and script directives. See the pbs_server_attributes(1B) man page.
The behavior of the qsub command may also be affected by any site hooks. Site hooks can modify the job's attributes, change its routing, etc. Sneaky but iconic. โจ
โญ Options to qsub โญ
okay bestie, here come the options โ buckle up, there are a lot and they all matter. ๐ซถ
-a <date and time>โ Point in time after which the job is eligible for execution. Given in pairs of digits. Sets job'sExecution_Timeattribute to date and time. Format: datetime, expressed as
[[[[CC]YY]MM]DD]hhmm[.SS]
where CC is the century, YY is the year, MM is the month, DD is the day of the month, hh is the hour, mm is the minute, and SS is the seconds. ๐ฐ๏ธ
Each portion of the date defaults to the current date, as long as the next-smaller portion is in the future. For example, if today is the 3rd of the month and the specified day DD is the 5th, the month MM is set to the current month.
If a specified portion has already passed, the next-larger portion is set to one after the current date. For example, if the day DD is not specified, but the hour hh is specified to be 10:00 a.m. and the current time is 11:00 a.m., the day DD is set to tomorrow. โฐ
Now for the flags themselves โ no skips, no cap: ๐
-A <account string>โ The accounting string associated with the job. Itโs used for labeling accounting data, and it sets the jobโsAccount_Nameattribute to account string. Format:String. ๐ธ-c <checkpoint spec>โ Determines when the job will be checkpointed. It sets the jobโsCheckpointattribute to checkpoint spec. Heads up: an$actionscript is required to checkpoint the job. The checkpoint spec can take one of these values:cโ Checkpoint at intervals, measured in CPU time, set on the jobโs execution queue. If there is no interval set at the queue, the job is not checkpointed.c=<minutes of CPU time>โ Checkpoint at intervals of the specified number of minutes of job CPU time. This value must be greater than zero. If the interval specified is less than that set on the jobโs execution queue, the queueโs interval is used. Format:Integer.wโ Checkpoint at intervals, measured in walltime, set on the jobโs execution queue. If there is no interval set at the queue, the job is not checkpointed.w=<minutes of walltime>โ Checkpoint at intervals of the specified number of minutes of job walltime. This value must be greater than zero. If the interval specified is less than that set on the jobโs execution queue, the queueโs interval is used. Format:Integer.nโ No checkpointing.sโ Checkpoint only when the server is shut down.uโ Unset. Defaults to the behavior when the interval argument is set tos.
Default: u โ Format: String.
-C <directive prefix>โ Defines the prefix identifying a PBS directive. The default prefix is"#PBS". If the directive prefix argument is a null string,qsubdoes not scan the script file for directives. This overrides thePBS_DPREFIXenvironment variable and the default. The string"PBS_DPREFIX"cannot be used as a PBS directive. Length limit:4096characters. ๐-e <path>โ The path used for the jobโs standard error stream. It sets the jobโsError_Pathattribute to path. The path argument is of the form[<hostname>:]<path>. The path is interpreted like this:pathโ If path is relative, it is taken to be relative to the current working directory of theqsubcommand, where it is executing on the current host. If path is absolute, it is taken to be an absolute path on the current host where theqsubcommand is executing.hostname:pathโ If path is relative, it is taken to be relative to the userโs home directory on the host named hostname. If path is absolute, it is an absolute path on the host named hostname.
If path does not include a filename, the default filename has the form <job ID>.ER.
If the -e option is not specified, PBS copies the standard error to the current working directory where the qsub command was executed, and writes standard error to the default filename, which has this form: <job name>.e<sequence number>.
If you use a UNC path for output or error files, the hostname is optional. If you use a non-UNC path, the hostname is required.
This option is overridden by the -k option. ๐ง
-fโ Preventsqsubfrom spawning a background process. By default,qsubspawns a background process to manage communication with the PBS server. When this option is specified, theqsubprocess connects directly to the server and no background process is created.
NOTE: Use of this option degrades performance of the qsub command when calls are made in rapid succession. โ ๏ธ
-G [-- <GUI application>]โ Starts a GUI session. When no application or script is provided, it starts a GUI-enabled interactive shell. When an application or script is provided, it starts the GUI application or script. Use the full path to the application or script unless the path is part of the userโsPATHenvironment variable on the execution host. When submission and execution hosts are different, this uses a remote viewer.
The session is terminated when the remote viewer, GUI application, or interactive shell is terminated, or when the job is deleted.
Can be used only with interactive jobs (the -I option). Available only under Windows. ๐ช
-hโ Applies a User hold to the job. Sets the jobโsHold_Typesattribute to"u". โ-Iโ The job is to be run interactively. Sets the jobโs interactive attribute toTrue. The job is queued and scheduled as any PBS batch job, but when executed, the standard input, output, and error streams of the job are connected to the terminal session in whichqsubis running. If a job script is given, only its directives are processed. When the job begins execution, all input to the job is taken from the terminal session.
Interactive jobs are not rerunnable.
Job arrays cannot be interactive.
When used with -Wblock=true, no exit status is returned. ๐ฅ๏ธ
-j <join>โ Specifies whether and how to join the jobโs standard error and standard output streams. Sets the jobโsJoin_Pathattribute to join. Default:n, not merged. The join argument can take these values:oeโ Standard error and standard output are merged into standard output.eoโ Standard error and standard output are merged into standard error.nโ Standard error and standard output are not merged.
-J <range> [%<max subjobs>]โ Makes this job an array job. Sets the jobโs array attribute toTrue.
Use the range argument to specify the indices of the subjobs of the array. range is specified in the form X-Y[:Z] where X is the first index, Y is the upper bound on the indices, and Z is the stepping factor. For example, 2-7:2 will produce indices of 2, 4, and 6. If Z is not specified, it is taken to be 1. Indices must be greater than or equal to zero.
Use the optional %max subjobs argument to set a limit on the number of subjobs that can be running at one time. This sets the value of the max_run_subjobs job attribute to the specified maximum.
Job arrays are always rerunnable. ๐งฎ
-k <discard>โ Specifies whether and which of the standard output and standard error streams is left behind on the execution host, or written to their final destination. Sets the jobโsKeep_Filesattribute to discard. Overrides default path names for these streams. Overrides-oand-eoptions.
Default: n; neither is retained, and files are not written to their final destinations.
In the case where output and/or error is retained on the execution host in a job-specific staging and execution directory created by PBS, these files are deleted when PBS deletes the directory.
The discard argument can take these values:
eโ The standard error stream is retained on the execution host, in the jobโs staging and execution directory. The filename is<job name>.e<sequence number>.oโ The standard output stream is retained on the execution host, in the jobโs staging and execution directory. The filename is<job name>.o<sequence number>.eo,oeโ Both standard output and standard error streams are retained on the execution host, in the jobโs staging and execution directory.dโ Output and/or error are written directly to their final destination. Overrides action of leaving files on execution host.nโ Neither stream is retained. ๐๏ธ
-l <resource list>โ Allows the user to request resources and specify job placement. Sets the jobโsResource_listattribute to resource list. Requesting a resource places a limit on its usage.
For how to request resources and place jobs, see Requesting Resources and Placing Jobs above. ๐
-m <mail events>โ Specifies the set of conditions under which mail about the job is sent. Sets the jobโsMail_Pointsattribute to mail events. The mail events argument can be one of:- The single character
"n" - Any combination of
"a","b", and"e", with optional"j"
- The single character
The sub-options to -m are:
nโ No mail is sent.aโ Mail is sent when the job is aborted by the batch system.bโ Mail is sent when the job begins execution.eโ Mail is sent when the job terminates.jโ Mail is sent for subjobs. Must be combined with one or more of thea,b, oresub-options.
Format: String โ Syntax: n | [j](one or more of a, b, e) โ Example: -m ja โ Default: a. ๐ฌ
-M <user list>โ List of users to whom mail about the job is sent. Sets the jobโsMail_Usersattribute to user list.
The user list argument has the form: <username>[@<hostname>][,<username>[@<hostname>],...].
Default: Job owner. ๐ค
-N <name>โ Sets the jobโsJob_Nameattribute and name to name.
Format: Job Name. ๐ท๏ธ
-o <path>โ where your job's standard output stream goes. It sets the job'sOutput_Pathattribute to path. The path argument is shaped like this:
[<hostname>:]<path>
and it gets read like this:
- path โ if path is relative, it's relative to the current working directory of the
qsubcommand, where it's executing on the current host. If path is absolute, it's an absolute path on the current host whereqsubis executing. - hostname
:path โ if path is relative, it's relative to your home directory on the host named hostname. If path is absolute, it's an absolute path on the host named hostname.
If path doesn't include a filename, the default filename has the form <job ID>.OU.
If you don't pass -o, PBS copies standard output to the current working directory where the qsub command was executed and writes standard output to the default filename, which looks like <job name>.o<sequence number>.
If you're using a UNC path, the hostname is optional. If you're using a non-UNC path, the hostname is required โ no hostname, no deal.
Heads up bestie: this option gets overridden by the-koption.-kis the main character here,-ois just vibing in its shadow. ๐
-p <priority>โ the job's priority. Sets the job'sPriorityattribute to priority.- Format: host-dependent integer
- Range:
[-1024, +1023]inclusive - Default: Zero
-P <project>โ gives your job a project. Sets the job'sprojectattribute to project.- Format: Project Name
- Default value:
"_pbs_project_default"
-q <destination>โ where the job gets sent when it's submitted. You can name a queue, a server, or a queue at a server. The destination argument can be any of these:<queue name>โ job is submitted to the specified queue at the default server.@<server name>โ job is submitted to the default queue at the specified server.<queue name>@<server name>โ job is submitted to the specified queue at the specified server.
Default: the default queue at the default server. โจ
-r <y|n>โ declares whether the job is rerunnable. Sets the job'sRerunableattribute to the argument value. Ngl, this does not affect how the job is handled in the case where the job was unable to begin execution โ don't get it twisted.- Format: single character,
"y"or"n" yโ job is rerunnable.nโ job is not rerunnable.
- Format: single character,
Default: "y".
Interactive jobs are not rerunnable. Job arrays are automatically marked as rerunnable. See the qrerun.1B man page for the whole lore. ๐
-R <remove options>โ says whether the standard output and/or standard error files get automatically removed (deleted) when the job finishes.
Sets the job's Remove_Files attribute to remove options. Overrides the default path names for these streams. Overrides the -o and -e options.
Fr fr: this attribute cannot be altered once the job has begun execution. Once it's in motion, it's in motion. ๐ญ
Default: Unset โ neither one is removed.
The remove options argument takes these values:
eโ the standard error stream is removed (deleted) upon job completion.oโ the standard output stream is removed (deleted) upon job completion.eo,oeโ both standard output and standard error streams are removed (deleted) upon job completion.unsetโ neither stream is removed.
-S <path list>โ the interpreter or shell path for your job script. Sets the job'sShell_Path_Listattribute to path list.
The path list argument is the full path to the interpreter or shell, including the executable name.
Only one path may be specified without a host name. Only one path may be specified per named host. The path that gets selected is the one whose host name is the host name of the server on which the job resides. Simple as that.
Format:
<path>[@<hostname>][,<path>@<hostname> ...]
Default: your login shell on the execution host.
Example of using bash via a directive:
#PBS -S /bin/bash@mars,/usr/bin/bash@jupiter
Example of running a Python script from the command line on Linux:
qsub -S $PBS_EXEC/bin/pbs_python <script name>
Example of running a Python script from the command line on Windows:
qsub -S %PBS_EXEC%\bin\pbs_python.exe <script name>
-u <user list>โ a list of usernames, and the job runs under a username from this list. Sets the job'sUser_Listattribute to user list.
Only one username may be specified without a hostname. Only one username may be specified per named host. The server on which the job resides will pick first the username whose hostname matches the server name. Failing that, the next pick is the username with no specified hostname. The usernames on the server and execution hosts must be the same. And the job owner has to have authorization to run as the specified user โ no sneaky identity switching. ๐ต๏ธโโ๏ธ
Format of user list:
<username>[@<hostname>][,<username>@<hostname> ...]
Default: the job owner (username on the submission host).
-v <variable list>โ lists environment variables and shell functions to be exported to the job. This is the list of env vars that get added to the ones already automatically exported. These variables exist in your environment from whichqsubis run. The job'sVariable_Listattribute gets appended with the variables in variable list and their values. Peep the ENVIRONMENT section of this man page for more. ๐
Format: comma-separated list of strings shaped like:
<variable>
or
<variable>=<value>
If a <variable>=<value> pair contains any commas, the value has to be enclosed in single or double quotes, and the <variable>=<value> pair has to be enclosed in the kind of quotes you did not use to enclose the value. For example:
qsub -v "var1='A,B,C,D'" job.sh
qsub -v "a=10,var2='A,B',c=20,d='Hello world'" job.sh
Default: no environment variables are added to the job's variable list.
-Vโ every environment variable and shell function in your environment whereqsubis run gets exported to the job. The job'sVariable_Listattribute is appended with all of these environment variables and their values. It's giving "bring the whole group chat." ๐ซถ-W <additional attributes>โ lets you specify some job attributes. Some job attributes must be specified using this option, and those are listed below.
Format:
-W <attribute name>=<value>[,<attribute name>=<value>...]
If white space occurs within the additional attributes argument, or the equal sign "=" occurs within a value string, it must be enclosed with single quotes or double quotes.
These are the attributes you can set using the -W option only:
๐
the -W squad
block=trueโ theqsubcommand waits for the job to terminate, then returns the job's exit value. Sets the job'sblockattribute toTrue. When used with X11 forwarding or interactive jobs, no exit value is returned. See the EXIT STATUS section in this man page.create_resv_from_job=<value>โ when this job starts, it immediately creates and confirms a job-specific start reservation on the same resources as the job (including resources inherited by the job), and places the job in the job-specific reservation queue. Sets the job'screate_resv_from_jobattribute toTrue. Sets the job-specific reservation'sreserve_jobattribute to the ID of the job from which the reservation was created. The new reservation's duration and start time are the same as the job'swalltimeand start time. If the job is peer scheduled, the job-specific reservation is created in the pulling complex.- Format: Boolean
- Example:
qsub myscript.sh -Wcreate_resv_from_job=1
Not the vibe for job arrays or jobs being submitted into a reservation โ can't be used with those. ๐
depend=<dependency list>โ defines dependencies between this job and other jobs. Sets the job'sdependattribute to dependency list. The dependency list has the form:
<type>:<arg list>[,<type>:<arg list> ...]
where, except for the on type, the arg list is one or more PBS job IDs, and has the form:
<job ID>[:<job ID> ...]
The type can be:
after: <arg list>โ this job may be scheduled for execution at any point after all jobs in arg list have started execution.afterok: <arg list>โ this job may be scheduled for execution only after all jobs in arg list have terminated with no errors. See "Warning about exit status with csh" in EXIT STATUS.afternotok: <arg list>โ this job may be scheduled for execution only after all jobs in arg list have terminated with errors. See "Warning about exit status with csh" in EXIT STATUS.afterany: <arg list>โ this job may be scheduled for execution after all jobs in arg list have finished execution, with any exit status (with or without errors). This job will not run if a job in the arg list was deleted without ever having been run. ๐before: <arg list>โ jobs in arg list may begin execution once this job has begun execution. It's uncommon for users to specify abeforecondition. Rather, PBS addsbeforedependencies automatically to the targets ofafterdependencies.
okay so we're still deep in -W territory, bestie, and it's giving "dependency lore" ๐ซ
beforeok: <arg list>โ jobs in arg list may begin execution once this job terminates without errors. Peep "Warning about exit status with csh" in EXIT STATUS, okay?beforenotok: <arg list>โ if this job terminates execution with errors, jobs in arg list may begin. Also see "Warning about exit status with csh" in EXIT STATUS.beforeany: <arg list>โ jobs in arg list may begin execution once this job terminates execution, with or without errors.on: countโ this job may be scheduled for execution aftercountdependencies on other jobs have been satisfied. This type is used in conjunction with one of the before types listed.countis an integer greater than 0.
Job IDs in the arg list of before types must have been submitted with a type of on. โจ
To use the before types, the user must have the authority to alter the jobs in arg list. Otherwise, the dependency is rejected and the new job aborted. That's the rule, no cap.
Error processing of the existence, state, or condition of the job that the newly submitted job depends on is performed after the job is queued. If an error is detected, the new job is deleted by the server. Mail is sent to the job submitter stating the error. ๐ญ
Dependency example: in this example, we save the output (the jobid) from the first qsub into shell variable "jobid" so we can supply it to the depend option on the second job.
jobid=`qsub first_step.sh`
qsub -W depend=afterok:$jobid second_step.sh
group_list=<group list>โ list of group names. The job is run under a group name from this list. Sets the job'sgroup_Listattribute togroup list.- Only one group name may be specified without a hostname. Only one group name may be specified per named host.
- The server on which the job resides will select first the group name whose hostname is the same as the server name. Failing that, the next selection is the group name with no specified hostname.
- The group names on the server and execution hosts must be the same.
- Job submitter's primary group is automatically added to this list.
- Under Windows, the primary group is the first group found for the user by PBS when it queries the accounts database.
- Format of group list:
<group name>[@<hostname>][,<group name>@<hostname> ...] - Default: Login group name of job owner
pwd,pwd='',pwd=""โ these forms prompt the user for a password. A space betweenWandpwdis optional. Spaces between the quotes are optional. Examples:
qsub ... -Wpwd <return>
qsub ... -W pwd='' <return>
qsub ... -W pwd=" " <return>
Available on supported Linux platforms only.
release_nodes_on_stageout=<value>โ when set toTrue, all of the job's vnodes not on the primary execution host are released when stageout begins.- Cannot be used with vnodes tied to Cray X* series systems.
- When
cgroupsis enabled and this is used with some but not all vnodes from oneMoM, resources on those vnodes that are part of acgroupare not released until the entirecgroupis released. - The job's
stageoutattribute must be set for therelease_nodes_on_stageoutattribute to take effect. - Format:
Boolean - Default:
False
run_count=<value>โ sets the number of times the server thinks it has run the job. Sets the value of the job'srun_countattribute tovalue.- Format: Integer greater than or equal to zero
sandbox=<sandbox spec>โ determines which directory PBS uses for the job's staging and execution. Sets job'ssandboxattribute tosandbox spec.- Allowed values for
sandbox spec:PRIVATEโ PBS creates a job-specific directory for staging and execution.HOMEor unset โ PBS uses the user's home directory for staging and execution.
- Format:
String
- Allowed values for
stagein=<path list>,stageout=<path list>โ specifies files or directories to be staged in before execution or staged out after execution is complete. Sets the job'sstageinandstageoutattributes to the specified path lists. On completion of the job, all staged-in and staged-out files and directories are removed from the execution host(s). The path list has the form:
<file spec>[,<file spec>]
where file spec is:
<execution path>@<hostname>:<storage path>
regardless of the direction of the copy. The name execution path is the name of the file or directory on the primary execution host. It can be relative to the staging and execution directory on the execution host, or it can be an absolute path.
The "@" character separates execution path from storage path. ๐ฆ
The name storage_path is the path on <hostname>. The storage_path can be absolute, or it can be relative to the user's home directory on hostname.
If path list has more than one file spec, i.e. it contains commas, it must be enclosed in double quotes.
If you use a UNC path, the hostname is optional. If you use a non-UNC path, the hostname is required.
umask=<mask value>โ the umask with which the job is started. Sets job'sumaskattribute tomask value. Controls umask of job's standard output and standard error.- The following example allows group and world read on the job's output:
-W umask=33 - Format: One to four octal digits; typically two
- Default value:
077
- The following example allows group and world read on the job's output:
-Xโ allows user to receive X output from interactive job.DISPLAYvariable in submission environment must be set to desired display.- Can be used with interactive jobs only: must be used with one of the following:
-I-W interactive=true(deprecated)
- Cannot be used with
-v DISPLAY. - When used with
-Wblock=true, no exit status is returned. - Can be used with
-Voption. - Not available under Windows.
-zโ job identifier is not written to standard output.--versionโ theqsubcommand returns its PBS version information and exits. This option can only be used alone.
๐ซถ OPERANDS ๐ซถ
The qsub command accepts as operands one of the following:
(no operands)โ same as with a dash. Any PBS directives and user tasks are read from the command line.<script>โ path to script. Can be absolute or relative to current directory whereqsubis run. The script must be the last argument toqsub.-โ when you use a dash, any PBS directives and user tasks are read from the command line.-- <executable> [<arguments to executable>]โ a single executable (preceded by two dashes) and its arguments.
The executable, and any arguments to the executable, are given on the qsub command line. The executable is preceded by two dashes, "--". All qsub options must come before the "--".
When you run qsub this way, it runs the executable directly. It does not start a shell, so no shell initialization scripts are run, and execution paths and other environment variables are not set. You should make sure that environment variables are set correctly.
๐ STANDARD OUTPUT ๐
- Job ID for submitted jobs โ if the job is successfully created
- (No output) โ if the
-zoption is set
๐ญ STANDARD ERROR ๐ญ
The qsub command writes a diagnostic message to standard error for each error occurrence.
๐ ENVIRONMENT VARIABLES ๐
The qsub command uses the following environment variables:
PBS_DEFAULTโ name of default server.PBS_DPREFIXโ prefix string which identifies PBS directives.
PBS automatically exports the following environment variables to the job. Environment variables beginning with "PBS_O_" are created by qsub and included in the job's Variable_List. โจ
PBS_ENVIRONMENTโ set toPBS_BATCHfor a batch job. Set toPBS_INTERACTIVEfor an interactive job.PBS_JOBDIRโ pathname of job's staging and execution directory on the primary execution host.PBS_JOBIDโ job identifier given by PBS when the job is submitted.PBS_JOBNAMEโ job name specified by submitter.PBS_NODEFILEโ name of file containing the list of vnodes assigned to the job when the job runs.PBS_O_HOMEโ user's home directory. Value ofHOMEtaken from user's submission environment.PBS_O_HOSTโ name of submit host. Value taken from user's submission environment.PBS_O_LANGโ value ofLANGtaken from user's submission environment.PBS_O_LOGNAMEโ user's login name. Value ofLOGNAMEtaken from user's submission environment.PBS_O_MAILโ value ofMAILtaken from user's submission environment.PBS_O_PATHโ user'sPATH. Value ofPATHtaken from user's submission environment.PBS_O_QUEUEโ name of the queue to which the job was submitted. Value taken from job submission, otherwise default queue.PBS_O_SHELLโ value ofSHELLtaken from user's submission environment.PBS_O_SYSTEMโ operating system, fromuname -s, on submit host. Value taken from user's submission environment.PBS_O_TZโ timezone. Value taken from user's submission environment.PBS_O_WORKDIRโ absolute path to directory whereqsubis run. Value taken from user's submission environment.PBS_QUEUEโ name of the queue from which the job is executed.TMPDIRโ pathname of job's scratch directory. Set when PBS assigns it.
๐ EXIT STATUS ๐
๐ธ For non-blocking jobs ๐ธ
Zeroโ bestie, this is the good one: it means successful processing of input โจGreater than zeroโ okay so this meansqsubfailed ๐ญ no cap
๐ฆ For blocking jobs ๐ฆ
- Exit value of job โ when the job runs successfully, you get the job's exit value ๐
3โ if the job is deleted without being run. Periodt ๐
๐ Warning About Exit Status with csh ๐
๐จ csh besties, listen up: if a job is run incshand a.logoutfile exists in the user's home directory on the host where the job executes, the exit status of the job is that of the.logoutscript, not the job script. This may impact any inter-job dependencies. Likeโฆ literally be aware ๐
โจ SEE ALSO โจ
Go peek at the rest of the friend group, iykyk ๐ฅ
pbs_job_attributes(7B)pbs_server_attributes(7B)pbs_resources(7B)qalter(1B)qhold(1B)qmove(1B)qmsg(1B)qrerun(1B)qrls(1B)qselect(1B)qstat(1B)
That's the whole vibe, bestie ๐ซถ this page's source/version is Local / qsub(1B), and it's dated 25 January 2021 โ iconic, honestly ๐๐
๐ฆ where this page comes from
- nixos 26.05: openpbs 23.06.06-unstable-2026-04-02
- nixpkgs unstable: openpbs 23.06.06-unstable-2026-04-02
- Copyright (C) 1994-2021 Altair Engineering, Inc
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms