HPC2N - Support - The Batch system: Job Submission

PBS Job Submission

 

Jobs are submitted using the command qsub. The requirements for nodes, memory, computing time, etc. can either be given as options to the command line or put into a job submission script. In the latter case, the command to submit is this (assuming the job script is called my_script):

qsub my_script

Go to the page about PBS Job Scripts to read more about this.

Otherwise, the options are given on the command line, like this:

qsub -l nodes=4:ppn=4,walltime=00:04:00 my_executable 

This example submits a job to the default queue (in you need to use a different queue, add -q <queue_name> to the line) and requests 4 nodes and 4 processors on each. It has a walltime (the time the program are allowed to use) of 4 minutes. The executable is called my_executable. Remember to not ask for more processors per node than what the cluster you want to run on have. Akka has 8 processors per node.

To run a job interactively (good for debugging purposes), use the option -I:

qsub -I my_script

or

qsub -I -l nodes=4:ppn=4,walltime=00:04:00 

Note: the time to get an interactive job started is the same as to get a batch job started. Thus, it may sometimes  get to run quickly and sometimes it will take a long time. This depends on both the number of other users, and on which resources you have asked for. The difference is that when you have your interactive job, you can test several things, instead of having to wait for a new job to start each time. This is very useful during testing of your program.

Some useful options for the qsub command includes (can either be given on the command line or in the script):

  • -l nodes=<#nodes>:<#procs per node>: nodes are the number of nodes you wish to use, followed by how many processors you want on each node. To get exclusive access to a node, ask for all processors on it. This is useful if you need all the memory of the node, maybe to run shared-memory jobs. Note that it may take longer to allocate a full node.
  • -I: Job is to be run interactively.
  • -walltime=hh:mm:ss: The maximum time allocated for your job.
  • -V: Declares that all environment variables in the qsub command's environment are to be exported to the batch job.
  • -q <queue_name>: Tells the job to run in a specific queue. Normally not needed.

To see which queues are available, run 

qstat -Q