qsub(1B)
okay so bestie π welcome to qsub(1B) from the PBS manual β the page whose whole NAME is literally βsubmit pbs job.β This is the group-chat translation, but every flag, value, path, env var, and nerdy little detail stays exactly where it belongs. β¨
π NAME π
qsub β submit pbs job
π SYNOPSIS π
qsub [-a date_time] [-A account_string] [-b secs] [-c
checkpoint_options] [-C directive_prefix] [-d path] [-D path] [-e path]
[-f] [-F] [-h] [-i idle_slot_limit] [-I] [-j join] [-k keep] [-K
kill_delay] [-l resource_list] [-L NUMA_resource_list] [-m mail_options]
[-M user_list] [-n node_exclusive] [-N name] [-o path] [-p priority] [-P
proxy_username[:group]] [-q destination] [-r c] [-S path_list] [-t
array_request] [-T prologue/epilogue script_name] [-u user_list] [-v
variable_list] [-V] [-w path] [-W additional_attributes] [-x] [-X] [-z]
[script]
π DESCRIPTION π
okay so to create a job is to submit an executable script to a batch server. The batch server will be the default server unless the -q option is specified. Peep the discussion of PBS_DEFAULT under Environment Variables below. Typically, the script is a shell script which will be executed by a command shell such as sh or csh.
Options on the qsub command allow the specification of attributes which affect the behavior of the job.
The qsub command will pass certain environment variables in the Variable_List attribute of the job. These variables will be available to the job. The value for the following variables will be taken from the environment of the qsub command: HOME, LANG, LOGNAME, PATH, MAIL, SHELL, and TZ. These values will be assigned to a new name which is the current name prefixed with the string "PBS_O_". For example, the job will have access to an environment variable named PBS_O_HOME which has the value of the variable HOME in the qsub command environment.
In addition to the above, the following environment variables will be available to the batch job. the env-var squad is:
PBS_O_HOSTβ the name of the host upon which theqsubcommand is running.PBS_SERVERβ the hostname of thepbs_serverwhichqsubsubmits the job to.PBS_O_QUEUEβ the name of the original queue to which the job was submitted.PBS_O_WORKDIRβ the absolute path of the current working directory of theqsubcommand.PBS_ARRAYIDβ each member of a job array is assigned a unique identifier (see-t).PBS_ENVIRONMENTβ set toPBS_BATCHto indicate the job is a batch job, or toPBS_INTERACTIVEto indicate the job is a PBS interactive job, see the-Ioption.PBS_JOBIDβ the job identifier assigned to the job by the batch system.PBS_JOBNAMEβ the job name supplied by the user.PBS_NODEFILEβ the name of the file that contains the list of nodes assigned to the job (for parallel and cluster systems).PBS_QUEUEβ the name of the queue from which the job is executed.
β¨ OPTIONS β¨
-a date_timeβ Declares the time after which the job is eligible for execution.
The date_time argument is in the form: [[[[CC]YY]MM]DD]hhmm[.SS]
Where CC is the first two digits of the year (the century), YY is the second two digits of the year, MM is the two digits for the month, DD is the day of the month, hh is the hour, mm is the minute, and the optional SS is the seconds.
If the month, MM, is not specified, it will default to the current month if the specified day DD is in the future. Otherwise, the month will be set to next month. Likewise, if the day, DD, is not specified, it will default to today if the time hhmm is in the future. Otherwise, the day will be set to tomorrow. For example, if you submit a job at 11:15am with a time of -a 1110, the job will be eligible to run at 11:10am tomorrow.
-A account_stringβ Defines the account string associated with the job. Theaccount_stringis an undefined string of characters and is interpreted by the server which executes the job. See section 2.7.1 of the PBS ERS.-b secondsβ Defines the maximum number of secondsqsubwill block attempting to contactpbs_server. Ifpbs_serveris down, or for a variety of communication failures,qsubwill continually retry connecting topbs_serverfor job submission. This value overrides theCLIENTRETRYparameter intorque.cfg. This is a non-portable TORQUE extension. Portability-minded users can use thePBS_CLIENTRETRYenvironmental variable. A negative value is interpreted as infinity. The default is0.-c checkpoint_optionsβ Defines the options that will apply to the job. If the job executes upon a host which does not support checkpoint, these options will be ignored.
Valid checkpoint options are:
noneβ No checkpointing is to be performed.enabledβ Specify that checkpointing is allowed but must be explicitly invoked by either theqholdorqchkptcommands.shutdownβ Specify that checkpointing is to be done on a job atpbs_momshutdown.periodicβ Specify that periodic checkpointing is enabled. The default interval is 10 minutes and can be changed by the$checkpoint_intervaloption in the mom config file or by specifying an interval when the job is submitted.interval=minutesβ Checkpointing is to be performed at an interval ofminutes, which is the integer number of minutes of wall time used by the job. This value must be greater than zero.depth=numberβ Specify a number (depth) of checkpoint images to be kept in the checkpoint directory.dir=pathβ Specify a checkpoint directory (default is/var/spool/torque/checkpoint).
-C directive_prefixβ Defines the prefix that declares a directive to theqsubcommand within the script file. See the paragraph on script directives in the Extended Description section.
If the -C option is presented with a directive_prefix argument that is the null string, qsub will not scan the script file for directives.
-d pathβ Defines the working directory path to be used for the job. If the-doption is not specified, the default working directory is the home directory. This option sets the environment variablePBS_O_INITDIR.-D pathβ Defines the root directory to be used for the job. This option sets the environment variablePBS_O_ROOTDIR.-e pathβ Defines the path to be used for the standard error stream of the batch job. Thepathargument is of the form:
[hostname:][path_name]
where hostname is the name of a host to which the file will be returned and path_name is the path name on that host in the syntax recognized by POSIX. The argument will be interpreted as follows:
- relative
path_nameβ Wherepath_nameis not an absolute path name, then theqsubcommand will expand the path name relative to the current working directory of the command. The command will supply the name of the host upon which it is executing for thehostnamecomponent. hostname:path_namewith relativepath_nameβ Wherepath_nameis not an absolute path name, then theqsubcommand will not expand the path name relative to the current working directory of the command. On delivery of the standard error, the path name will be expanded relative to the user's home directory on thehostnamesystem.- absolute
path_nameβ Wherepath_namespecifies an absolute path name, thenqsubwill supply the name of the host on which it is executing for thehostname. hostname:path_namewith absolutepath_nameβ Wherepath_namespecifies an absolute path name, the path will be used as specified for thathostname.hostname:β Wherehostnamespecifies the name of the host that the file should be returned to. The path will be the default file name.
If the -e option is not specified or the path_name is not specified or is specified and is a directory, the default file name for the standard error stream will be used. The default name has the following form: job_name.esequence_number where job_name is the name of the job, see the -N option, and sequence_number is the job number assigned when the job is submitted.
-fβ Specifies that the job is fault tolerant. Thefault_tolerantattribute will be set to true, which indicates that the job can survive the loss of a mom other than the "mother superior" mom (the first node in theexec hosts).-Fβ Specifies the arguments that will be passed to the job script when the script is launched. The accepted syntax is:
qsub -F "myarg1 myarg2 myarg3=myarg3value" myscript2.sh
-hβ Specifies that a user hold be applied to the job at submission time.-i idle_slot_lmitβ Sets an idle slot limit for the job array being submitted. If this parameter is set for a non-array job, it will be rejected. Additionally, if the user requests an idle slot limit that exceeds the server parameter's default, the job will be rejected. See also theidle_slot_limitserver parameter. (yep, the synopsis up there spells the argidle_slot_limit, while this OPTIONS entry literally saysidle_slot_lmitβ iykyk.)
$ qsub -t 0-99 -i 10 script.sh
The submitted array will only instantiate 10 idle jobs; instead of all 100 jobs at submission time.
-Iβ Declares that the job is to be run "interactively". The job will be queued and scheduled as any PBS batch job, but when executed, the standard input, output, and error streams of the job are connected throughqsubto the terminal session in whichqsubis running. Interactive jobs are forced to be not rerunable. See the "Extended Description" paragraph for additional information about interactive jobs.-j joinβ Declares if the standard error stream of the job will be merged with the standard output stream of the job.
An option argument value of oe directs that the two streams will be merged, intermixed, as standard output. An option argument value of eo directs that the two streams will be merged, intermixed, as standard error.
If the join argument is n or the option is not specified, the two streams will be two separate files.
-k keepβ tells the execution host which stream(s) get kept around on it. If you set this for a stream, this option overrides that stream's path name. If you don't set it, neither stream stays on the execution host, periodt.
Your argument is either the single letter "e" or "o", or the letters "e" and "o" combined in either order, or the letter "n". So:
eβ standard error gets retained on the execution host. The stream lands in the home directory of the user under whose user id the job executed, and the file name is the default given byjob_name.esequence, wherejob_nameis the name specified for the job andsequenceis the sequence number component of the job identifier πoβ standard output gets retained on the execution host. Same home-directory situation (of the user under whose user id the job executed), and the default file name isjob_name.osequence, wherejob_nameis the name specified for the job andsequenceis the sequence number component of the job identifier β¨eoβ both the standard output and standard error streams get retained π«Άoeβ both the standard output and standard error streams get retained (yes bestie, same deal, the order of the letters is literally whatever) π«Άnβ neither stream is retained π
-K kill_delayβ sets a job-specific kill delay, in seconds. When you specify it, this job gets sent aSIGTERM, followed by aSIGKILLthe specified number of seconds later. It's giving "I'll give you a head start, then it's over" π-l resource_listβ the main-character option: it defines the resources your job requires and sets a limit on how much resource can be consumed. If it's not set for a generally available resource β CPU time, for example β the limit is infinite, no cap fr fr. Theresource_listargument looks like this:
resource_name[=[value]][,resource_name[=[value]],...]
-L NUMA_resource_listβ NUMA-aware resource requests, for NUMA hardware. Lowkey it will also work with non-NUMA hardware, so no stress. The syntax forNUMA_resource_listis:
tasks=#[:lprocs=#|all]
[:{usecores|usethreads|allowthreads}]
[:place={socket|numanode|core|thread}[=#]{node}][:memory=#][:swap=#][:maxtpn=#][:gpus=#[:<mode>]][:mics=#]
[:gres=<gres>][:feature=<feature>]
[[:{cpt|cgroup_per_task}]|[:{cph|cgroup_per_host}]]
-m mail_optionsβ defines the set of conditions under which the execution server will send a mail message about the job π¬ Themail_optionsargument is a string made of either the single character"n"or"p", or one or more of the characters"a","b","e", and"f".
If the character "n" is specified, no normal mail is sent β but mail for job cancels and other events outside of normal job processing still goes out. If the character "p" is specified, mail will never be sent for the job. Iconic silence.
And for the characters "a", "b", "e", and "f":
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 πfβ mail is sent when the job terminates with a non-zero exit code π
If the -m option isn't specified, mail will be sent if the job is aborted.
-M user_listβ declares the list of users that the execution server mails when it sends mail about the job. Theuser_listargument looks like:
user[@host][,user[@host],...]
If it's unset, the list defaults to the submitting user at the qsub host β i.e. the job owner π«Ά
-n node_exclusiveβ lets you request exclusive-node access/allocation for the job. This setsnode_exclusive = Truein the output ofqstat -f <job ID>. By default this only applies for cpusets, and only for compatible schedulers.
For systems that use Moab and have cgroups enabled, the recommended way to assign all cores is to use NUMA syntax: "-L tasks=<count>:lprocs=all:place=node".
With cgroups, the (-l) syntax (lowercase L) will, by default, restrict to the number of cores requested, or to the resources_default.procs value (i.e., 1 core, typically). To override this behavior and have Moab assign all the cores on a node while using "-l...singlejob" and/or "-n" (in other words, without "-L ...lprocs=all..."), you must also set RMCFG[<torque>] FLAGS=MigrateAllJobAttributes in moab.cfg. No cap, that's just how it is π
-N nameβ declares a name for the job, you know, so it doesn't feel anonymous π The name can be up to and including 15 characters in length. It must consist of printable, non white space characters, and the first character must be alphabetic.
If -N isn't specified, the job name will be the base name of the job script file you specified on the command line. And if no script file name was specified and the script was read from the standard input, then the job name gets set to STDIN π
-o pathβ defines the path used for the standard output stream of the batch job. Thepathargument looks like:
[hostname:][path_name]
where hostname is the name of a host to which the file will be returned, and path_name is the path name on that host in the syntax recognized by POSIX. The argument gets interpreted like this:
path_nameβ wherepath_nameis not an absolute path name, theqsubcommand expands the path name relative to the current working directory of the command. The command supplies the name of the host upon which it's executing for thehostnamecomponent πΈhostname:path_nameβ wherepath_nameis not an absolute path name, theqsubcommand will not expand the path name relative to the current working directory of the command. On delivery of the standard output, the path name gets expanded relative to the user's home directory on thehostnamesystem π¦path_nameβ wherepath_namespecifies an absolute path name, thenqsubsupplies the name of the host on which it's executing for thehostnamehostname:path_nameβ wherepath_namespecifies an absolute path name, the path is used as specified.hostname.hostname:β wherehostnamespecifies the name of the host that the file should be returned to. The path will be the default file name π
If the -o option isn't specified, or path_name isn't specified, or it is specified and is a directory, then the default file name for the standard output stream gets used. That default name is:
job_name.osequence_number
where job_name is the name of the job (peep the -N option) and sequence_number is the job number assigned when the job was submitted π
-p priorityβ defines the priority of the job. Thepriorityargument must be an integer between-1024and+1023, inclusive. The default is no priority, which is equivalent to a priority of zero β-P proxy_user[:group]β the proxy user the job should be submitted for. Heads up: this option is only available for the super user π-q destinationβ defines the destination of the job. The destination names a queue, a server, or a queue at a server.
The qsub command submits the script to the server defined by the destination argument. If the destination is a routing queue, the job may get routed by the server to a new destination π
If -q isn't specified, qsub submits the script to the default server. Check PBS_DEFAULT under the Environment Variables section of this man page, and the PBS ERS section 2.7.4, "Default Server".
If -q is specified, it's in one of these three forms:
queue
@server
queue@server
- If the
destinationargument names a queue and doesn't name a server, the job gets submitted to the named queue at the default server. - If the
destinationargument names a server and doesn't name a queue, the job gets submitted to the default queue at the named server. - If the
destinationargument names both a queue and a server, the job gets submitted to the named queue at the named server π―
-r y|nβ declares whether the job is rerunable. See theqreruncommand. The option argument is a single character, eitheryorn.
If the argument is "y", the job is rerunable. If the argument is "n", the job is not rerunable. The default value is 'y' β rerunable π
-S path_listβ declares the shell that interprets the job script. The option argumentpath_listlooks like:
path[@host][,path[@host],...]
Only one path may be specified for any host named. Only one path may be specified without the corresponding host name. The path that gets selected is the one with the host name matching the name of the execution host. If no matching host is found, then the path specified without a host gets selected, if present.
If the -S option isn't specified, the option argument is the null string, or no entry from the path_list is selected, then execution uses the user's login shell on the execution host π
-t array_requestβ specifies the task ids of a job array. Single task arrays are allowed, bestie, no gatekeeping π
The array_request argument is an integer id or a range of integers. Multiple ids or id ranges can be combined in a comma delimted list. Examples: -t 1-100 or -t 1,10,50-100 β¨
Also! Lowkey the most important part of the array_request: you can tack on an optional slot limit at the end, and it caps how many jobs from your array are allowed to run at the same time. Default is unlimited, no cap, run free π¦
The slot limit has to be the last thing you specify in the array_request, and it's separated from the array by a percent sign (%).
qsub script.sh -t 0-299%5
That sets the slot limit to 5 β only 5 jobs from this array can run at the same time. iconic, honestly.
Note: you can useqalterto change slot limits on an existing array. And the server parametermax_slot_limitlets you set a global slot limit policy. π
-Tscript_name β this one's for per-job prologue and epilogue scripts β¨ The full script name ends up beingprologue.[name]orepilogue.[name]β so when you submit, you only ask for the name of the prologue/epilogue script, not the whole thing.
Example:
qsub -T prescript
That one says "use the script prologue.prescript" π
-uuser_list β sets the user name the job runs under on the execution system.
The user_list argument is of the form:
user[@host][,user[@host],...]
Rules, bestie, listen up: only one user name per specified host. Only one of your user specs can be supplied without a matching host spec β and that hostless user name is the one used for execution on any host that isn't named in the argument list. If you don't set it at all, the user list defaults to whoever is running qsub. π«Ά
-vvariable_list β expands the list of environment variables exported to the job π
On top of the variables described in the DESCRIPTION section above, variable_list names environment variables from the qsub command environment that get made available to the job when it executes. The variable_list is a comma-separated list of strings of the form variable or variable=value. Those variables and their values get passed to the job. π¦
-Vβ declares that all environment variables in theqsubcommand's environment are exported to the batch job. all of them. every last one. go off π-wpath β defines the working directory path to use for the job. If you don't pass-w, the default working directory is the current directory. This option sets the environment variablePBS_O_WORKDIR. ποΈ-Wadditional_attributes β the β¨extra creditβ¨ option, for specifying additional job attributes.
General syntax:
-W attr_name=attr_value[,attr_name=attr_value...]
Heads up: if white space shows up anywhere inside the option argument string, or an equal sign = occurs inside an attribute_value string, then you gotta wrap the string in either single or double quote marks. no cap, it'll break otherwise π
PBS currently supports these attributes inside -W:
depend=dependency_list β defines the dependency between this job and other jobs. The dependency_list is in the form:
type[:argument[:argument...][,type:argument...].
The argument is either a numeric count or a PBS job id, depending on type. If it's a count, it must be greater than 0. If it's a job id and it's not fully specified as seq_number.server.name, it gets expanded according to the default server rules that apply to job IDs on most commands. If argument is null (the preceding colon need not be specified), the dependency of that type is cleared/unset. π§Ή
synccount:count β this job is the first in a set of jobs that execute at the same time. count is the number of additional jobs in the set.syncwith:jobid β this job is an additional member of a set of jobs that execute at the same time. In this and the following dependency types, jobid is the job identifier of the first job in the set.after:jobid[:jobid...] β this job may be scheduled for execution at any point after jobs jobid have started execution.afterok:jobid[:jobid...] β this job may be scheduled for execution only after jobs jobid have terminated with no errors. See thecshwarning under "Extended Description".afternotok:jobid[:jobid...] β this job may be scheduled for execution only after jobs jobid have terminated with errors. See thecshwarning under "Extended Description".afterany:jobid[:jobid...] β this job may be scheduled for execution after jobs jobid have terminated, with or without errors.on:count β this job may be scheduled for execution after count dependencies on other jobs have been satisfied. This form is used together with one of thebeforeforms, see below πbefore:jobid[:jobid...] β once this job has begun execution, then jobs jobid... may begin.beforeok:jobid[:jobid...] β if this job terminates execution without errors, then jobs jobid... may begin. See thecshwarning under "Extended Description".beforenotok:jobid[:jobid...] β if this job terminates execution with errors, then jobs jobid... may begin. See thecshwarning under "Extended Description".beforeany:jobid[:jobid...] β when this job terminates execution, jobs jobid... may begin.
If any of thebeforeforms are used, the jobs referenced by jobid must have been submitted with a dependency type ofon. fr fr, that's the deal π€
Array Dependencies π
It is now possible to have a job depend on an array. These dependencies are in the form depend=arraydep:arrayid[num]. If [num] isn't present, the dependency applies to the entire array. If [num] is present, then num means the number of jobs that must meet the condition for the dependency to be satisfied.
afterstartarray:arrayid[count] β this job may be scheduled for execution only after jobs in arrayid have started execution.afterokarray:arrayid[count] β this job may be scheduled for execution only after jobs in arrayid have terminated with no errors.afternotok:arrayid[count] β this job may be scheduled for execution only after jobs in arrayid have terminated with errors.afteranyarray:arrayid[count] β this job may be scheduled for execution after jobs in array id have terminated, with or without errors.beforestartarray:arrayid[count] β this job may be scheduled for execution only before jobs in arrayid have started execution.beforeokarray:arrayid[count] β this job may be scheduled for execution only before jobs in arrayid have terminated with no errors.beforenotok:arrayid[count] β this job may be scheduled for execution only before jobs in arrayid have terminated with errors.beforeanyarray:arrayid[count] β this job may be scheduled for execution before jobs in array id have terminated, with or without errors.
If any of the before forms are used, the jobs referenced by jobid must have the same owner as the job being submitted. Otherwise, the dependency is just ignored π
Error processing of the existence, state, or condition of the job that the newly submitted job depends on is a deferred service β like, the check happens after the job is queued. If an error is detected, the new job gets deleted by the server π and mail is sent to the job submitter explaining the error.
Dependency examples, saved for you bestie π:
qsub -W depend=afterok:123.big.iron.com /tmp/script
qsub -W depend=before:234.hunk1.com:235.hunk1.com /tmp/script
qsub -W depend=afterokarray:21.tom.com[] /tmp/script
qsub -W depend=beforenotokarray:22.tom.com[][5] /tmp/script
group_list=g_list β defines the group name the job runs under on the execution system. The g_list argument is of the form:
group[@host][,group[@host],...]
Same energy as -u: only one group name per specified host, and only one of the group specs may be supplied without its matching host spec. That hostless group name is the one used for execution on any host not named in the argument list. If it's not set, group_list defaults to the primary group of the user under which the job will be run. π
interactive=trueβ if the interactive attribute is specified, the job is an interactive job. (And psst, the-Ioption is an alternative way of specifying this same attribute π)
stagein=file_list/stageout=file_listβ okay so these two tell qsub which files get staged (copied) in before the job starts, or staged out after the job finishes. On completion of the job, all staged-in and staged-out files are removed from the execution system. Thefile_listis in the form:
local_file@hostname:remote_file[,...]
regardless of the direction of the copy. local_file is the name of the file on the system where the job executed. It may be an absolute path or relative to the home directory of the user. remote_file is the destination name on the host specified by hostname. That name may be absolute or relative to the user's home directory on the destination host. The use of wildcards in the file name is not recommended π. The file names map to a remote copy program (rcp) call on the execution system in the follow manner:
For stagein: rcp hostname:remote_file local_file
For stageout: rcp local_file hostname:remote_file
Data staging examples, bestie:
-W stagein=/tmp/input.txt@headnode:/home/user/input.txt
-W stageout=/tmp/output.txt@headnode:/home/user/output.txt
If TORQUE has been compiled with wordexp support, then variables can be used in the specified paths. Currently only $PBS_JOBID, $HOME, and $TMPDIR are supported for stagein.
umask=XXXβ sets the umask used to create stdout and stderr spool files in thepbs_momspool directory. Values starting with0are treated as octal values, otherwise the value is treated as a decimal umask value. π-xβ when you're running an interactive job, this flag makes it so that the script won't be parsed for PBS directives, but instead will be a command that is launched once the interactive job has started. The job will terminate at the completion of this command. No cap.-Xβ enables X11 forwarding. TheDISPLAYenvironment variable must be set. π-zβ directs that theqsubcommand is not to write the job identifier assigned to the job to the command's standard output. Sneaky lil quiet mode.
π¦ OPERANDS π¦
The qsub command accepts a script operand that is the path to the script of the job. If the path is relative, it will be expanded relative to the working directory of the qsub command.
If the script operand is not provided or the operand is the single character -, the qsub command reads the script from standard input. When the script is being read from standard input, qsub will copy the file to a temporary file. This temporary file is passed to the library interface routine pbs_submit. The temporary file is removed by qsub after pbs_submit returns or upon the receipt of a signal which would cause qsub to terminate. Very responsible of it, honestly π«Ά
πΈ STANDARD INPUT πΈ
The qsub command reads the script for the job from standard input if the script operand is missing or is the single character -.
π INPUT FILES π
The script file is read by the qsub command. Qsub acts upon any directives found in the script.
When the job is created, a copy of the script file is made and that copy cannot be modified. It's giving locked-in main character energy π₯
β STANDARD OUTPUT β
Unless the -z option is set, the job identifier assigned to the job will be written to standard output if the job is successfully created.
π STANDARD ERROR π
The qsub command will write a diagnostic message to standard error for each error occurrence. So if something's cooked, it will tell you π
π ENVIRONMENT VARIABLES π
The values of some or all of the variables in the qsub command's environment are exported with the job, see the -v and -V options.
The environment variable PBS_DEFAULT defines the name of the default server. Typically, it corresponds to the system name of the host on which the server is running. If PBS_DEFAULT is not set, the default is defined by an administrator established file.
The environment variable PBS_DPREFIX determines the prefix string which identifies directives in the script.
The environment variable PBS_CLIENTRETRY defines the maximum number of seconds qsub will block. See the -b option above. Despite the name, currently qsub is the only client that supports this option. iykyk β¨
π§ TORQUE.CFG π§
The torque.cfg file, located in PBS_SERVER_HOME (/var/spool/torque by default) controls the behavior of the qsub command. This file contains a list of parameters and values separated by whitespace.
QSUBSLEEP takes an integer operand which specifies time to sleep when running qsub command. Used to prevent users from overwhelming the scheduler. Respect the scheduler's nap time π
SUBMITFILTER specifies the path to the submit filter used to pre-process job submission. The default path is $(libexecdir)/qsub_filter, which falls back to /usr/local/sbin/torque_submitfilter for backwards compatibility. This torque.cfg parameter overrides this default.
SERVERHOST specifies the value for the PBS_SERVER environment variable.
QSUBHOST specifies the hostname for the jobs QSUB_O_HOST variable.
QSUBSENDUID specifies a uid to use for the jobs PBS_O_UID variable.
XAUTHPATH specifies the path to xauth.
CLIENTRETRY specifies the integer seconds between retry attempts to communicate with pbs_server.
VALIDATEGROUP set this parameter to force qsub to verify the submitter's group id.
DEFAULTCKPT specifies the default value for the jobs checkpoint attribute. The user overrides this with the -c qsub option.
VALIDATEPATH set this parameter to force qsub to validate local existence of a -d working directory.
RERUNNABLEBYDEFAULT this parameter specifies if a job is rerunnable by default. The default is true, setting this to false causes the rerunnable attribute value to be false unless the users specifies otherwise with the -r option.
FAULT_TOLERANT_BY_DEFAULT this parameter specifies if a job is fault tolerant by default. The default value for the fault_tolerant job attribute is false, setting this parameter to true causes the default value of the attribute to be true. The user can specify their preference with the -f qsub option.
For example:
QSUBSLEEP 2
RERUNNABLEBYDEFAULT false
β¨ EXTENDED DESCRIPTION β¨
π Script Processing
Okay so a job script can be made of three things: PBS directives, comments, and executable statements. A PBS directive is literally just a way to set job attributes in addition to the command line options β like, you get to be extra, bestie. Example time:
:
#PBS -N Job_name
#PBS -l walltime=10:30,mem=320kb
#PBS -m be
#
step1 arg1 arg2
step2 arg3 arg4
Here's how qsub reads it: it scans the lines of the script file looking for directives. If the very first line of the script starts with the characters #! or the character :, that line is ignored and scanning starts with the next line. π
Scanning keeps going until it hits the first executable line β meaning a line that is not blank, not a directive line, and not a line whose first non-white-space character is #. And heads up: if directives show up on any lines after that point, they get ignored. Sorry babe, the window closed. π
A line in the script file gets processed as a directive to qsub if and only if the string of characters starting with the first non-white-space character on the line, of the same length as the directive prefix, matches the directive prefix. That's the whole vibe check.
The rest of the directive line is just the options to qsub in the exact same syntax as they'd appear on the command line. The option character gets preceded with the - character. β¨
Now the drama: if an option is in both a directive and on the command line, that option and its argument (if it has one) get ignored in the directive. Command line takes precedence, always, no cap. Command line is the main character.
But if an option is in a directive and not on the command line? Then it and its argument (if any) get processed as if it had occurred on the command line. Teamwork. π«Ά
The directive prefix string gets determined in order of preference from:
- The value of the
-Coption argument, if the option is specified on the command line. - The value of the environment variable
PBS_DPREFIXif it is defined. - The four character string
#PBS.
Lowkey important: if the -C option is found in a directive in the script file, it will be ignored. Periodt. π
π User Authorization
So when the user submits a job from a system other than the one the PBS Server is running on, the name under which the job is executed gets selected according to the rules listed under the -u option. The user submitting the job must be authorized to run the job under the execution user name. π€
This authorization is provided if:
- The host on which
qsubis run is trusted by the execution host (see/etc/hosts.equiv), or - The execution user has an
.rhostsfile naming the submitting user on the submitting host.
That's the whole deal β one of those two, or you're not getting in. πͺ
π C-Shell .logout File
Okay this next one is a genuine warning and it applies to all the csh girlies out there. If the job is executed under the csh and a .logout file exists in the home directory in which the job executes, the exit status of the job is that of the .logout script β not the job script. π
And yeah, this may impact any inter-job dependencies. Which is bad. So to preserve the job exit status, you either remove the .logout file entirely, or place the following line as the first line in the .logout file:
set EXITVAL = $status
and then the following line as the last executable line in .logout:
exit $EXITVAL
There. Fixed. You're welcome. π
π» Interactive Jobs
If the -I option is specified on the command line or in a script directive, or if the "interactive" job attribute is declared true via the -W option β that's -W interactive=true β either on the command line or in a script directive, then congrats, the job is an interactive job, bestie. π
The script will be processed for directives, but it will not be included with the job. When the job begins execution, all input to the job comes from the terminal session in which qsub is running. So it's very much a you and the terminal, together situation.
When an interactive job is submitted, qsub will not terminate just because the job got submitted. qsub stays running until the job terminates, gets aborted, or the user interrupts qsub with an SIGINT (the Ctrl+C key). If qsub is interrupted before the job starts, it will query whether the user wishes to exit β and if the user responds "yes", qsub exits and the job is aborted. π
Once the interactive job has started executing, input to and output from the job both pass through qsub. Keyboard-generated interrupts get passed along to the job too. And here's the cute part β lines you enter that begin with the tilde (~) character and contain special sequences get escaped by qsub. The recognized escape sequences are:
~.βqsubterminates execution. The batch job is also terminated.~suspβ Suspend theqsubprogram if running under the C shell."susp"is the suspend character, usuallyCNTL-Z.~asuspβ Suspend the input half ofqsub(terminal to job), but allow output to continue to be displayed. Only works under the C shell."asusp"is the auxiliary suspend character, usuallyCNTL-Y.
π« EXIT STATUS
Upon successful processing, the qsub exit status will be a value of zero. π₯³
If the qsub command fails, the command exits with a value greater than zero. Sad times, but at least you know. π
π SEE ALSO
Go follow the whole friend group, they're all iconic:
qalter(1B), qdel(1B), qhold(1B), qmove(1B), qmsg(1B), qrerun(1B), qrls(1B), qselect(1B), qsig(1B), qstat(1B), pbs_connect(3B), pbs_job_attributes(7B), pbs_queue_attributes(7B), pbs_resources_irix5(7B), pbs_resources_sp2(7B), pbs_resources_sunos4(7B), pbs_resources_unicos8(7B), pbs_server_attributes(7B), and pbs_server(8B).
And that's the whole page, babe! π This one's brought to you by Local and it's the qsub(1B) era officially β go submit something iconic, and remember: command line always wins. π¦πΈπ
π¦ where this page comes from
- epel 9: torque-client 6.1.3-8.el9 Β· OpenPBS and TORQUEv1.1
- Copyright (c) 1999-2000 Veridian Information Solutions, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms