Use TORQUE or SGE to submit and manage jobs on high-performance computing systems

TORQUE command SGE command
Job submission qsub [scriptfile] qsub [scriptfile]
Job deletion qdel [job_id] qdel [job_id]
Job status (for user) qstat -u [username] qstat [-j job_id]
Extended job status qstat -f [job_id] qstat -f [-j job_id]
Hold a job temporarily qhold [job_id] qhold [job_id]
Release job hold qrls [job_id] qrls [job_id]
List of usable queues qstat -Q qconf -sql
Job ID $PBS_JOBID $JOB_ID
Submission directory $PBS_O_WORKDIR $SGE_O_WORKDIR
Processor list $PBS_NODEFILE $PE_HOSTFILE
Queue #PBS -q [queue] #$ -q [queue]
Nodes #PBS -l nodes=[#] n/a
Processors #PBS -l ppn=[#] #$ -pe ompi [#]
Wall clock limit #PBS -l walltime=[hh:mm:ss] #$ -l time=[hh:mm:ss]
Standard output file #PBS -o [file] #$ -o [path]
Standard error #PBS -e [file] #$ -e [path]
Copy environment #PBS -V #$ -V
Notification event #PBS -m abe #$ -m abe
Email address #PBS -M [email] #$ -M [email]
Job name #PBS -N [name] #$ -N [name]
Job restart #PBS -r [y|n] #$ -r [yes|no]
Initial directory n/a #$ -wd [directory]
Node usage #PBS -l naccesspolicy=singlejob n/a
Memory requirement #PBS -l mem=XXXXmb #$ -mem [#]G

 

  • A TORQUE job script for an MPI job might look like this:

#!/bin/sh
#
#PBS -q default
#PBS -l nodes=1:ppn=24
#PBS -N JobName
## Export all my environment variables to the job
#PBS -V
cd $PBS_O_WORKDIR
mpirun -n 16 vaspmpi > out

  • A TORQUE job script for a serial job might look like this:

#!/bin/sh
#
#PBS -q default
#PBS -l nodes=1:ppn=24
#PBS -N JobName
## Export all my environment variables to the job
#PBS -V
cd $PBS_O_WORKDIR
./xx.sh

Submitting jobs:

qsub job.script

qsub option Description
-q queue_name Specifies a user-selectable queue (queue_name)
-r Makes the job re-runnable
-a date_time Executes the job only after a specific date and time (date_time)
-V Exports environment variables in your current environment to the job
-I Makes the job run interactively (usually for testing purposes)
-u user_list Displays jobs for users listed in user_list
-a Displays all jobs
-r Displays running jobs
-f Displays the full listing of jobs (returns excessive detail)
-n Displays nodes allocated to jobs

 

Deleting jobs:

  • To delete a specific job (jobid), enter:

qdel jobid

  • To delete all jobs, enter:

qdel all

SHARE