Submitting Jobs

Home / User Info / Submitting Jobs

Submitting Jobs

Contents

            1. Submitting a Job

                A. Creating a PBS Script

                A. Using the qsub Command

            2. Checking Job Status

Running a Job on UTM HPC using PBS Script

To run a job on the UTM HPC cluster, you will need to set up a Portable Batch System (PBS) file. This PBS file defines the commands and cluster resources used for the job. A PBS file is a simple text file that can be easily edited with a UNIX editor, such as vi or pico command.

Submitting a Job

In order to use the HPC compute nodes, you must first log into one of the head nodes, portal utmgrid, and submit a PBS job.

a. The qsub command is used to submit a job to the PBS queue and to request additional resources.
b. The qstat command is used to check on the status of a job already in the PBS queue.

To simplify submitting a job, you can create a PBS script and use the qsub and qstat commands to interact with the PBS queue.

Creating a PBS Script

To set the parameters for your job, you can create a control file that contains the commands to be executed. Typically, this is in the form of a PBS script. This script is then submitted to PBS using the qsub command.

Here is a sample PBS file, named pbs-script, followed by an explanation of each line of the file.

#!/bin/bash
#PBS -N lammps
#PBS -l nodes=1:ppn=2
#PBS -l walltime=00:10:00
#PBS -M abc@gmail.com
#PBS -m abc
cd $HOME

mpirun -np 2 [LAMMPS executable] [filename input] [filename output]

  • The 1st line in the file identifies which shell will be used for the job. In this example, bash is used but csh or other valid shells would also work.
  • The 2nd line to set the job name in ONE word. In this example, your job name will appear in status of a job.
  • The 3rd line specifies the number of nodes and processors desired for this job. In this example, one node with two processors is being requested
  • The fourth line in the PBS file states how much wall-clock time is being requested. In this example 10 minutes of wall time have been requested.
  • The 5th and 6th line to set email for a-start job, b-completed job, e-error.
  • The 7th line tells the HPC cluster to access the directory where the data is located for this job. In this example, the cluster is instructed to change the directory to your home directory ( /home/<your-userid> )
  • The 8th line tells the cluster to run the program. In this example, it runs mpirun, -np command is specifying the number of processors, same as above, set path to execute the file, set input and output file name. The output file is results after run the job.

Using the qsub Command

To submit your job as stated below

qsub -q hpc pbs-script
OR
qsub -q bigmem pbs-script
OR
qsub -q qamar pbs-script

Please note that QAMAR HPC only have 4 cpu’s so if u are using this cluster please make sure in the script, you state “ppn=4” to make sure your job can run.

Checking Job Status

To check on the status of your job, you will use the qstat command. The command

qstat –u [your username]

will show you the current status of all your submitted jobs.