Changes between Initial Version and Version 1 of oldwiki/queue


Ignore:
Timestamp:
Oct 28, 2014, 11:14:56 AM (10 years ago)
Author:
les
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • oldwiki/queue

    v1 v1  
     1Queue System
     2
     3How to submit jobs
     4Before you submit a job, you need to decide on a couple of things:
     5How long time do you expect your job to be running? Start off with a guess. Once you have run your program a few times, you will learn how long time you need to assign.
     6How much memory do you need? Usually you only need modest amounts of memory, less than 4G.
     7You should be aware that the more resources you request, the longer it will take before your job will be run.
     8Once you know these, you must create a job batch file, this you will run to get a place in the queue for your specific job.
     9
     10
     11You can create this batch file using either pico or nano when you are logged into the grid using Terminal or Putty.
     12To start either text editing program just simply type the program name at the prompt - $ nano or pico
     13
     14*** - You can not use any other text editing programs to write your scripts. Use only nano or pico from Terminal or Putty.
     15
     16The program will start and then you can begin typing the commands for the batch file.
     17Note: the control panel at the bottom of the editor, use ctrl+Shift to execute the commands. For example ctrl+Shift+X will exit the program.
     18
     19Once the file is ready and saved in your directory, submit it by using the command - qsub [name of this file] at the prompt - $ qsub batchfile.job
     20
     21Here is a link to useful qsub commands - qsub
     22
     23Below is an example of a batch file for job submission to the Grid:
     24
     25Lines beginning with #$ contains directives to the queue system
     26#!/bin/bash
     27
     28#First inform the system of your email addres, and that you want mails sent at the beginning, end and if you job is aborted.
     29
     30#$ -M make_this_your_em@ail_address
     31#$ -m bae
     32
     33# Second, tell the system that it should execute the job in your current directory
     34
     35#$ -cwd
     36
     37# Now two the things you decided earlier
     38# Ask for a runtime of 2 hours, 0 minutes and 0 seconds
     39
     40#$ -l h_rt=2:0:0
     41
     42# And 1GB of memory
     43
     44#$ -l h_vmem=1G
     45
     46# NEW - YOU MUST PUT THIS LINE IN BEFORE YOU CAN RUN A PROGRAM
     47
     48module load [program name] - for example: module load blast
     49
     50# Finally put the commands needed to run the program:
     51
     52my_program [-option1] [-option2]
     53
     54For example, a local blast would look like this:
     55
     56blastall -p blastn -i infile.blast -o outfile.blas -db my_db -e 1e-40
     57Put all this into a file, let's call it my_job.job with a text editor and place the file in the directory where you want to run your job. Then submit it to the queueing system with the qsub command:
     58
     59mguser@my-mgrid:~$ qsub my_job.job
     60Take a note of the job ID given to you by qsub (it's a numeric ID). To see what jobs you have in the queue use the command qstat:
     61
     62mguser@my-mgrid:~$ qstat
     63The mails sent to you from the queue system will tell you when your jobs i done, but also if it was terminated by the system if it exceeded its runtime or memory allocation. If you didn't get any mails, and your job does not show up in qstat, use qacct with the job id you got from qsub (you kept a note of it, didn't you?) to check the status:
     64
     65mguser@my-mgrid:~$ qacct -j <JOBID>
     66(replace <JOBID> with the numeric ID). Check the exit_status line, it should be 0, if it is not, the job failed. You should also check contents the files <JOBNAME>.o<JOBID> and <JOBNAME>.e<JOBID> for hints on what has happened.