TIFR - PORTABLE BATCHING SYSTEM

 

Prev

Table of Contents

Next

 

The qstat Command

Request States

The qdel Command

Other Useful PBS Commands

The qstat Command

Use the qstat command to display the status of the PBS queues and batch jobs. The syntax of the qstat command is:

qstat [ option ] [ server-name ] [ destination ] [ job-id ]

where option is one or more of the available options, queue-name indicates a specific queue, and request-id designates a specific request. server-name usually corresponds to the system running PBS. If no options or queues are specified, a summary of jobs in all PBS queues on the local computer is displayed. A complete list of options is available in the man pages for qstat. The following table shows the more commonly used options.

Commonly Used qstat Options

Option

Definition

no option  Shows all PBS job requests. Display includes PBS Job ID, Job Name, User Name, Time Used, Job Status, and the Queue Name.
-a [queue] Shows all of PBS batch requests with a little more detail. Optional queue name displays information for only the queue specified. Display includes PBS Job ID, Job Name, User Name, Number of Nodes, Number of Tasks, Session ID,  Requested Memory, Job Status, and the amount of file system space requested. 
-Q[f queue] Shows queue status for all queues. Optional f flag displays full detail on the specified queue. 
 -q Provides a list of all queues and status information in a different format from the -Q option. 
-c Displays the queue complex information.
-B [server]   Shows batch server status. Optional server name shows information on specified server. 
-f request-id Shows job in full detail. 
 -i Shows batch jobs awaiting processing. 
 -r Shows running batch requests. 
 -u user-name  Shows only those requests belonging to user-name (can be used with -a, -i, or -r option).

      To find out which jobs you have in PBS, enter the command:

qstat -au username or simply qstat -u username

The following commands also work:

qstat -au username @tifrc7 or qstat -u username @tifrc7 

TOP

Request States

A request may also be in one of several states. The state of a request can be determined by using the qstat command. Table below lists some common  request states.

Request States

State

Definition

Queued (Q) Job is eligible to proceed
Running (R) Job has reached its final destination queue, and is actually executing.
Held (H)  Job is being held. The job can be released (by a qrls command).
Waiting (W) Job was submitted with the constraint that it not run before a certain date and time, which has not yet occurred, or requires a resource not currently available.
Transit (T) Job is changing states.
Exiting (E) Job is finishing.

The list of currently running jobs is obtained by using the -r flag with the qstat command. The use of a specific queue further limits the displayed list.

% qstat -r long
-----------------------------------
PBS Batch Request Summary
-----------------------------------
PBSid  Jobname    Username Queue      NDS TSK  SID  REQMEM  REMTIME S
------ ---------- -------- -------- --- --- ----- ------ -------- - ---- -------------------------
2474     ks_pbs           abc               long        -       -     86697   55mw         00:03:26         R
2480     av8                  sxy                long       -       -     86929   20mw         00:02:01         R
2482     job1                lmn                long        -       -     86927   80mw        00:01:53         R

To get the full listing of information available on a specific PBS job using the -f flag and the PBS job ID.

% qstat -f  jobid

% qstat -Q  -->  displays the status of the queues.

TOP

The qdel Command

The qdel command is used to delete a PBS request. The syntax of the command is:

qdel [ -W delay ] PBSid

where PBSid is the number assigned to the job by PBS when the job is submitted. You can also obtain this number with the command:

qstat -au username

A SIGTERM followed by a SIGKILL are sent to the jobs specified. delay is the amount of time to delay between the SIGTERM and SIGKILL. More than one PBSid number can be specified.

To delete a PBS job, you must be the owner (submitter) of the job. If you issue the qdel command and PBS responds that the job-id does not exist,  then the job has already completed or terminated.

The example shown below demonstrates the use of the qdel command.

% qsub sample
     14359.tifrc7.tifr.res.in

% qdel 14359
     pbs-98 qdel:INFO
     Request <14359.tifrc7>: Deleted by 

TOP

Other Useful PBS Commands

There are several other PBS commands available. For a complete list, refer to the man pages on the system. A few of the more frequently used commands are shown in the following table.

Additional PBS Commands

Command

Definition

qhold jobid   qhold allows you to indefinitely prevent a job from running. jobid is the PBS job identification number. This is useful for preventing a job from running while you investigate a potential problem, or want another job to finish before this one runs. It may also be handy for keeping a job from starting while you are in the process of reordering your jobs.  See the command qorder below for how do this.
qrls jobid qrls is the companion to qhold and is used to release a job that has been held by you with qhold. You can only qrls a job you have held.
qorder jobid1 jobid2 qorder allows you to change the order in which two of your jobs are processed. Both jobs must belong to you.  Basically, the two jobs are switched such that jobid2 takes the location of jobid1 in the queue, and jobid1 that of  jobid2. This command allows you to order your jobs based on their priority to you. Another use is to replace a job that you know is going to fail with a corrected version. In this case you might want to qhold the job that will fail, then submit the correct version, qorder the two jobs, and then qdel the bad job.
 

TOP