Frequently Asked Question

4.2 PBS Commands
Last Updated 6 months ago

This article covers essential PBS commands used to submit, monitor, and manage jobs in an HPC environment.

1. Submitting a Job: qsub

The `qsub` command is used to submit a job to the PBS scheduler. This command takes the PBS script, which contains job instructions, and sends it to the queue for execution.

qsub myjob.pbs

In this script:

  • Job resources (nodes, memory, walltime) are specified using PBS directives.
  • PBS processes the script and assigns the job an ID for tracking purposes.

2. Checking Job Status: qstat

Once a job is submitted, you can monitor its status with the `qstat` command. This command provides a list of all jobs along with their status, such as running (R), queued (Q), or completed (C).

qstat

3. Displaying Job Information: qstat -f

The `qstat -f` command provides detailed information about a specific job, such as resource usage, submission time, and job attributes. This is useful for debugging or tracking resource consumption.

qstat -f 

This provides verbose output with resource usage (CPU, memory) and other metadata.


4. Deleting a Job: qdel

The `qdel` command is used to cancel a job from the queue or terminate a running job. You’ll need the job ID that was assigned when the job was submitted.

qdel job_id

This stops the job immediately and removes it from the queue. It is useful when a job is running too long or consuming excessive resources.


5. Example: Submit and Monitor a Job

image

Please note that you need to submit the *.pbs file, not your actual code file (e.g., *.py). For more details on preparing your PBS script, refer to the Introduction to PBS.

Please Wait!

Please wait... it will take a second!