The qsub options can be read from the PBS directives of a PBS job script or from the qsub command line. For a complete list of available options, see man qsub. Commonly used options include:
- -S shell_name
- Specifies the shell that interprets the job script.
- -V
- Declares that all environment variables in the qsub command's environment are to be exported to the batch job.
- -v variable_list
- Lists environment variables to be exported to the job. For example, to pass the variable Year and its value 2025 to the job script, use qsub -v Year="2025" job_script. Within the job_script, reference the variable with ${Year}.
- -q queue_name
- Defines the destination of the job. For a list of available queues, run the command qstat -Q on an appropriate front-end node. For example, for jobs submitted from the PFEs to run on Electra or Aitken, queue names include normal, debug, devel, long, and low. Endeavour queue names include e-normal, e-long, and e-debug. See PBS Job Queue Structure.
- -l resource_list
- Specifies the resources that are required by the job and establishes a limit to the amount of resources that can be consumed. Commonly specified resources include select, ncpus, walltime, and mem (memory). You can also specify filesystems. See man pbs_resources for a complete list.
- -e path
- Directs the standard error output produced by the request to the stated file path.
- -o path
- Directs the standard output produced by the request to the stated file path.
- -j join
- Declares that the standard output and error streams of the job should be merged (joined). Possible values for join are:
oe– Standard output and error streams are merged in the standard output file.
eo– Standard error and output streams are merged in the standard error file.
- -k keep
- Declares that the standard output and error streams of the job should be retained on the (first) execution host. This is not typically useful on NAS systems; however, when the d (direct) option is included, it changes the way the standard output and error files from a job are handled. Usually, these files are collected until the job ends and only then copied back to their destination files. With -kod, the job writes directly to its output file as it is running. Similarly, with -ked, the error file is written directly. You can then view those files from a front-end host to monitor how the job is running.
There are a few caveats to this feature. First, the output or error files must be available to the nodes where the job runs (the files should be on /homeX or /nobackup filesystems, not on a local filesystem such as /tmp). Second, if the files already exist, they will be appended to, rather than overwritten, as would be the case without -k. If multiple jobs specify the same output file, the outputs from the jobs can be intermingled in the final file. Third, there can be a delay of a few seconds between the time the job writes to the files and the time the change is visible on the front-end host.
- -m mail_options
- Defines the set of conditions under which the execution server will send mail message about the job. See man qsub for a list of mail options.
- -N name
- Declares a name for the job.
- -W addl_attributes
- Allows for the specification of additional job attributes. The most common additional attributes are:
-W group_list=g_list – Specifies the group the job runs under.
-W depend=afterany:job_id.server_name.nas.nasa.gov – Submits a job that is to be executed after job_id has finished with any exit status (for example, 12345.pbspl1.nas.nasa.gov).
-W depend=afterok:job_id.server_name.nas.nasa.gov – Submits a job that is to be executed after job_id has finished with no errors.
- -r y|n
- Declares whether the job is re-runnable. See Checkpointing and Restart.