ACCC Home Page ACADEMIC COMPUTING and COMMUNICATIONS CENTER
Accounts / Passwords Email Labs / Classrooms Telecom Network Security Software Computing and Network Services Education / Teaching Getting Help
 

The batch submission qsub command

   
 
     
Overview
 

There are two commands to submit jobs to the batch system: scasub and qsub. While the scasub command is used to submit parallel jobs to batch, qsub is normally used to submit serial jobs (serial jobs uses only one processor). This document will cover the qsub command.

 
     
Syntax
 

The format of the qsub command is:

qsub script_file

where script_file is not an executable program but rather a text file containing, among other things:

  • the executable program
  • options that tell batch how to run your program

If something like the following message is in your output file:

argo..SC: cannot execute binary file

then you used an executable program

qsub executable_program

as the option to the qsub command, an invalid action.

What follows will be a series of examples, the first of which will present the most basic of commands/options. Each subsequent example will show an additional option. The standard "hello_world" program, a program whose sole function is to print the line "Hello World" to stdout and exit, will be used.

However, before doing so, let's review some basic batch job output and management management principles.

After submitting the job to batch, a job id is assigned in the format: xxx.argo.cc.uic.edu
where xxx is the job-id.

To see the status of your job, use: qstat job-id
Assume your job is assigned job id 338. (You don't need the stuff after the number.)
Then you'd use: qstat 338

For stdout and stderr, batch creates two files. The names of the files are constructed from the job name, the letter e (for stderr) or o (for stdout), and the job number.

So for your hello_world run that had job-id 338, you would have the following files:

hello_world.o338 <-- this is stderr
hello_world.e338 <-- this is stdout

 
     
Examples
 

Example 1:

Content of file

/home/homes51/jsmith/hello_world

Explanation

The script file, consisting of a single line, has the path to and the name of the executable:

Path: /home/homes51/jsmith
Name of executable: hello_world

Submission

[jsmith@argo jsmith]$ qsub script
1074.argo.cc.uic.edu

Results:

[jsmith@argo jsmith]$ cat script.o1074
Hello World:

Example 2:

Content of file

#PBS -N new_name

/home/homes51/jsmith/hello_world

Explanation

Line 1: Instead of using the default name for the job-the default is the name of the script file, use new_name. The pound sign must be the first character on the line followed by the capital letters PBS (there is no space between the # character and the letter P).

Line 2: explained in example 1.

Submission

[jsmith@argo jsmith]$ qsub script
1076.argo.cc.uic.edu

Results:

[jsmith@argo jsmith]$ cat hello.o1077
Hello World

[jsmith@argo jsmith]$ cat script.o1077
Hello World

jsmith@argo jsmith]$ cat script.o1077 cat: script.o1077: No such file or directory

The portion of the utput file that is normally the script name, is replaced with the word hello.

Example 4:

Content of file

#PBS -e /home/homes51/jsmith/hello_world.error

#PBS -o /home/homes51/jsmith/hello_world.output

#PBS -N new_name

/home/homes51/jsmith/hello_world

Explanation

Line 1: Instead of writing job error messages for stderr to the default file (script.e<jobid>, write the error messages to the file hello_world.error in my home directory.

Line 2: explained in example 3.

Line 3: explained in example 2.

Line 4: explained in example 1.

Submission

[jsmith@argo jsmith]$ qsub script
1079.argo.cc.uic.edu

Results:

ls -al *1079*ls:

*1079*: No such file or directory

ls -al hello_world.*

-rw------- 1 jsmith sys 0 Mar 28 2003 hello_world.error
-rw------- 1 jsmith sys 12 Mar 28 2003 hello_world.output

[jsmith@argo jsmith]$ cat hello_world.output
Hello World

Example 5:

Content of file

#PBS -m bea

#PBS -e /home/homes51/jsmith/hello_world.error

#PBS -o /home/homes51/jsmith/hello_world.output

#PBS -N new_name

/home/homes51/jsmith/hello_world

Explanation

Line 1: Send email to my UIC mail account when the job begins (b), when the job ends (e), and if the job aborts with an error (e). You may use one, two, or all three flags. If you use multiple flags, they must be on one line.

Line 2: explained in example 4.

Line 3: explained in example 3.

Line 4: explained in example 2.

Line 5: explained in example 1.

Submission

[jsmith@argo jsmith]$ qsub script
1084.argo.cc.uic.edu

Results:

On my UIC email account, tigger, there are two pieces of email.

Date: Fri, 28 Mar 2003 13:08:43 -0600
From: adm <adm@argo.cc.uic.edu>
To: jsmith@argo.cc.uic.edu
Subject: PBS JOB 1084.argo.cc.uic.edu

PBS Job Id: 1084.argo.cc.uic.edu
Job Name: hello
Begun execution

Date: Fri, 28 Mar 2003 13:08:44 -0600
From: adm <adm@argo.cc.uic.edu>
To: jsmith@argo.cc.uic.edu
Subject: PBS JOB 1084.argo.cc.uic.edu

PBS Job Id: 1084.argo.cc.uic.edu
Job Name: hello
Execution terminated
Exit_status=0
resources_used.cput=00:00:00
resources_used.mem=0kb
resources_used.vmem=0kb
resources_used.walltime=00:00:01

Since the program did not abort, no mail was sent for the "a" option.

Example 6:

Content of file

#PBS -V

#PBS -m bea

#PBS -e /home/homes51/jsmith/hello_world.error

#PBS -o /home/homes51/jsmith/hello_world.output

#PBS -N new_name

/home/homes51/jsmith/hello_world

Explanation

Line 1: Export all my session environmental variables to the job.

Line 2: explained in example 5.

Line 3:explained in example 4.

Line 4:explained in example 3.

Line 5:: explained in example 2.

Line 6: explained in example 1.

Submission

[jsmith@argo jsmith]$ qsub script
1085.argo.cc.uic.edu

Results:

No results to display

Some additional options; there are more but these seem relevant

#PBS -l ncpus=x

Number of CPUs to be used

#PBS -l mem=xxxmb

Amount of memory to be used

#PBS -l walltime=hh:mm:ss

Maximum wall time for job execution

#PBS -l nodes=xxxxx

Identify one or more nodes on which the program should execute. For example -l nodes=argo4-4

 
     
Documentation
 
  • For more information about the qsub command, see the man page (man qsub).

 

 


2004-8-17  ACCC Systems Group
UIC Home Page Search UIC Pages Contact UIC