GURIANG-Cluster
Geophysics --- Universitas Padjadjaran

Topics list


Main Page
General

Submiting Program to The Queuing System


Sending simple command:
	$ echo "date" | qsub
To run a program in the current working directory, pass the working path to qsub command using -d option.
	$ echo "./runthis" | qsub -d `pwd`

Sending more complex job using job script
We can create a script to run job. This script consists of a sequence of commands that we want to execute (batch). qsub can also accept inlined parameters using the "pseudo command" starting with #PBS. Here is the example,
       #!/bin/sh
       #PBS -l nodes=2:ppn=2
       #PBS -l walltime=00:04:00
       #PBS -o NEWOUT
       #PBS -j oe
       #PBS -m e
       #PBS -N NEW
       echo $PBS_O_WORKDIR
       cat $PBS_NODEFILE
       cd  $PBS_O_WORKDIR
       ./test -text "hallo"
The parameters after #PBS are the parameters that are accepted by qsub command. This script (say, mybatch) can be executed using,
        $ qsub mybatch
User may run interactive program which is not "power consumming" directly at the node head. Such as processing data, calculating numbers, etc. But it is better to use qsub interactive mode as follows,
        $ qsub -I 
This command will allocate cpu in a node. User can do normal work in that script. Here is the example:
     user@guriang:~> qsub -I
     qsub: waiting for job XXX.guriang.geophys to start
     qsub: job XXX.guriang.geophys ready
     
user@node01:~> octave -q octave:1> x=linspace(1,10); octave:2> y=sin(x); octave:3> %bla..bla..bla octave:4> exit user@node01:~> logout
qsub: job XXX.guriang.geophys completed user@guriang:~>
The login shell to node01 is automatically chosen by the queuing system. User can do his work there as in normal shell.

Monitoring Job

User can monitor and see the status of his job using,
     $ qstat
See the manual page of qstat for more comprehensive information. and more information about the scheduled jobs can be displayed with
     $ showq
The output of a job will be put below the directory in which it was sent, after finished. The file names are by default NNNN.eXXX and NNNN.oXXX, where NNN is the job name and XXX is the job id/number.

Deleting Jobs

Jobs can be deleted via
     $ qdel JOBNAME

To see when your job may start

Once your job is in the queue, this command will give you the prediction when it will start
     $ showstart JOB
where JOB is the job id number.


 Special thanks to G. Ziegenhain


back to topic index