Next Previous Contents

2. User commands

This section describes the commands available to the general user. See the corresponding man page for complete documentation When more than one operand is specified on the command line, the command processes each operand in turn. An error reply from a server on one operand will be noted in the standard error stream. The command continues processing the other operands. If an error reply was received for any operand, the final exit status for the command will be greater than zero.

Besides the PBS commands you can use xpbs which provides a user-friendly point-and-click interface to manage jobs and xpbsmon, a GUI for displaying, monitoring the nodes/execution hosts under PBS.

2.1 Job identifiers

When the term job identifier is used, the identifier is specified as:

sequence_number[.server_name][@server]

The sequence_number is the number supplied by the server when the job was submitted.The server_name component is the name of the server which created the job. If it is missing, the name of the default server will be assumed. @server specifies the current location of the job.

When the term fully qualified job identifier is used, the identifier is specified as:

sequence_number.server[@server]

The @server suffix is not required if the job is still resides at the original server which created the job. The qsub command will return a fully qualified job identifier.

2.2 Directing requests to correct server

A command performs its function by sending the corresponding request for service to a batch server. The choice of batch servers to which to send the request is governed by the following ordered set of rules:

  1. For those commands which require or accept a job identifier operand, if the server is specified in the job identifier operand as @server, then the batch requests will be sent to the server named by server.
  2. For those commands which require or accept a job identifier operand and the @server is not specified, then the command will attempt to determine the current location of the job by sending a Locate Job batch request to the server which created the job.
  3. If a server component of a destination is supplied via the -q option, such as on qsub and qselect, but not qalter, then the server request is sent to that server.
  4. The server request is sent to the server identified as the default server, (see the environment variable PBS_DEFAULT).

2.3 qalter - alter pbs batch job

qalter [-a date_time] [-A account_string] [-c interval] [-e path] [-h hold_list] [-j join] [-k keep] [-l resource_list] [-m mail_options] [-M user_list] [-N name] [-o path] [-p priority] [-r c] [-S path] [-u user_list] [-W additional_attributes] job_identifier...

The qalter command modifies the attributes of the job or jobs specified by job_identifier on the command line. Only those attributes listed as options on the command will be modified. If any of the specified attributes cannot be modified for a job for any reason, none of that job's attributes will be modified.

2.4 qdel - delete pbs batch job

qdel [-W delay] job_identifier ...

The qdel command deletes jobs in the order in which their job identifiers are presented to the command. A job that has been deleted is no longer subject to management by batch services. A batch job may be deleted by its owner, the batch operator, or the batch administrator. A batch job being deleted by a server will be sent a SIGTERM signal following by a SIGKILL signal. The time delay between the two signals is an attribute of the execution queue from which the job was run (settable by the administrator). This delay may be overridden by the -W option. .

2.5 qhold - hold pbs batch jobs

qhold [-h hold_list] job_identifier ...

The qhold command requests that a server place one or more holds on a job. A job that has a hold is not eligible for execution. There are three supported holds: USER, OTHER (also known as operator), and SYSTEM.

A user may place a USER hold upon any job the user owns. An "operator", who is a user with "operator privilege", may place ether an USER or an OTHER hold on any job. The batch administrator may place any hold on any job.

If no -h option is given, the USER hold will be applied to the jobs described by the job_identifier operand list.

If the job identified by job_identifier is in the queued, held, or waiting states, then all that occurs is that the hold type is added to the job. The job is then placed into held state if it resides in an execution queue.

If the job is in running state, then the following additional action is taken to interrupt the execution of the job. If checkpoint/restart is supported by the host system, requesting a hold on a running job will:

  1. cause the job to be check-pointed
  2. the resources assigned to the job will be released, and
  3. the job is placed in the held state in the execution queue.
If checkpoint/restart is not supported, qhold will only set the requested hold attribute. This will have no effect unless the job is rerun with the qrerun command.

2.6 qmove - move a pbs batch job to another queue

qmove destination job_identifier ...

To move a job is to remove the job from the queue in which it resides and instantiate the job in another queue. Destination can specify a queue, a server or a specific queue in a server. A job in the Running , Transiting , or Exiting state cannot be moved.

2.7 qmsg - send a message into standard output/error of pbs batch jobs

qmsg [-E] [-O] message_string job_identifier ...

To send a message to a job is to write a message string into one or more output files of the job (standard output or standard error). Typically this is done to leave an informative message in the output of the job. The qmsg command writes messages into the files of jobs by sending a Message Job batch request. The qmsg command does not directly write the message into the files of the job: only sends a request to the batch server that owns the job.

2.8 qorder - exchange order of two pbs batch jobs in a queue

qorder job_identifier job_identifier

To order two jobs is to exchange the jobs positions in the queue or queues in which the jobs resides. The two jobs must be located at the same server. No attribute of the job, such as priority is changed. The impact of interchanging the order with the queue(s) is dependent on local job scheduled policy. A job in the running state cannot be reordered.

2.9 qrerun - rerun a pbs batch job

qrerun job_identifier ...

The qrerun command directs that the specified jobs are to be rerun if possible. To rerun a job is to terminate the session leader of the job and return the job to the queued state in the execution queue in which the job currently resides. If a job is marked as not rerunable then the rerun request will fail for that job. See the -r option on the qsub and qalter commands.

2.10 qrls - release hold on pbs batch job

qrls [-h hold_list] job_identifier ...

The qrls command removes or releases holds which exist on batch jobs. A job may have one or more types of holds which make the job ineligible for execution. The types of holds are USER, OTHER, and SYSTEM. The different types of holds may require that the user issuing the qrls command have special privilege. Typically, the owner of the job will be able to remove a USER hold, but not an OTHER or SYSTEM hold. An Attempt to release a hold for which the user does not have the correct privilege is an error and no holds will be released for that job. If no -h option is specified, the USER hold will be released. If the job has no execution_time pending, the job will change to the queued state. If an execution_time is still pending, the job will change to the waiting state.

2.11 qselect - list the job identifiers in accordance with selection criteria

qselect [-a [op]date_time] [-A account_string] [-c [op]interval] [-h hold_list] [-l resource_list] [-N name] [-p [op]priority] [-q destination] [-r rerun] [-s states] [-u user_list]

The qselect command provides a method to list the job identifier of those jobs which meet a list of selection criteria. Jobs are selected from those owned by a single server. When qselect successfully completes, it will have written to standard output a list of zero or more jobs which meet the criteria specified by the options. Each option acts as a filter restricting the number of jobs which might be listed. With no options, the qselect command will list all jobs at the server which the user is authorized to list (query status of). The -u option may be used to limit the selection to jobs owned by this user or other specified users.

2.12 qstat - show status of pbs batch jobs

qstat [-f][-W site_specific] [job_identifier... | destination...]

qstat [-a|-i|-r] [-n] [-s] [-G|-M] [-R] [-u user_list] [job_identifier... | destination...]

qstat -Q [-f][-W site_specific] [destination...]

qstat -q [-G|-M] [destination...]

qstat -B [-f][-W site_specific] [server_name...]

The qstat command is used to request the status of jobs, queues, or a batch server. The requested status is written to standard out. When requesting job status, synopsis format 1 or 2, qstat will output information about each job_identifier or all jobs at each destination. Jobs for which the user does not have status privilege are not displayed. When requesting queue or server status, synopsis format 3 through 5, qstat will output information about each destination.

2.13 qsub - submit a new pbs job

qsub [-a date_time] [-A account_string] [-c interval] [-C directive_prefix] [-e path] [-h] [-I] [-j join] [-k keep] [-l resource_list] [-m mail_options] [-M user_list] [-N name] [-o path] [-p priority] [-q destination] [-r c] [-S path_list] [-u user_list] [-v variable_list] [-V] [-W additional_attributes] [-z] [script]

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. See 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 have 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.

PBS_O_HOST the name of the host upon which the qsub command is running.

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 the qsub command.

PBS_ENVIRONMENT set to PBS_BATCH to indicate the job is a batch job, or to PBS_INTERACTIVE to indicate the job is a PBS interactive job, see -I option.

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 contain 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.

2.14 nqs2pbs - convert NQS job scripts to PBS

nqs2pbs nqs_script [pbs_script]

This utility converts a existing NQS job script to work with PBS and NQS. The existing script is copied and PBS directives, #PBS , are inserted prior to each NQS directive #QSUB or #@$ , in the original script. Certain NQS date specification and options are not supported by PBS. A warning message will be displayed indicating the problem and the line of the script on which it occurred.

If any unrecognizable NQS directives are encountered, an error message is displayed. The new PBS script will be deleted if any errors occur.


Next Previous Contents