How to compute/Batch jobs

Z MetaCentrum
Přejít na: navigace, hledání

(Česká verze)

Related topics
Examining job's output
Scheduling system

Batch jobs are a non-interactive type of jobs. You must prepare a startup script (=batch script) for your job, submit the job, wait until it is finished and after that you can check its results.

Prepare a startup script

Related topics
Requesting resources
Working with data in a job

A startup script is collection of commands with given order, which are executed by your requested resources. You can specify requested resources outside (via qsub options) or inside your startup script. Both ways are absolutely correct, choose what you personally prefer.

Specify requested resources

You can specify resources inside the startup script via #PBS line prefix + an option. Create a text file in any editor (vim, pico, nano..) with following lines:

#!/bin/bash
#PBS -N myFirstJob
#PBS -l select=1:ncpus=4:mem=4gb:scratch_local=10gb
#PBS -l walltime=1:00:00

#Options above for scheduling system: job will run 1 hour at maximum, 1 machine with 4 processors + 4gb RAM memory + 10gb scratch memory are requested 
module add g03 #loads the Gaussian's application modules, version 03
trap 'clean_scratch' TERM EXIT # setup SCRATCH cleaning in case of an error
cd $SCRATCHDIR || exit 1 # enters user's scratch directory
cp /software/testData/gaussian_test.com $SCRATCHDIR # gets job's input data

g03 <gaussian_test.com >results.out # starts the Gaussian application and saves output into results.out

cp results.out /home/$USER || export CLEAN_SCRATCH=false # moves the produced (output) data to user's home directory or leave it in SCRATCH if an error occured

You can also specify resources outside the script by moving PBS options to qsub submit command. See example below.

Submit the job

You can submit your job via qsub command. For example:

qsub myJob.sh

In case you want to specify requested resources outside batch script, move the PBS options to the submitting command:

qsub -l select=1:ncpus=4:mem=4gb:scratch_local=10gb -l walltime=1:00:00 myJob.sh

Qsub returns jobID (10583298 in this example) which you can use to track your job.

If you specify requested resources inside your startup script, run just qsub command with name of the script.

qsub myJob.sh

Examine job's output

You can find information about this topic here.