Hoffman2:Submitting Jobs: Difference between revisions

From Center for Cognitive Neuroscience
Jump to navigation Jump to search
No edit summary
No edit summary
Line 7: Line 7:
Ask for a simple 1GB of memory and a single computing core with a short time window, and your job will likely get placed at the front of the line and start running soon if not immediately.
Ask for a simple 1GB of memory and a single computing core with a short time window, and your job will likely get placed at the front of the line and start running soon if not immediately.


So how does one submit a computing job request?  The answer is <code>qsub</code>.
So how does one submit a computing job request?  You've got some options:
# job.q - Use the wonderful tool that ATS wrote, it has a great menu and walks you through everything
# qsub - Get under the hood and do things yourself, it can get messy but it can also be faster.
 
==job.q==
On the command line, enter <code>job.q</code> and follow its step-by-step instructions.
 
 
==qsub==
Everything that job.q did can be done on the command line.


===EXAMPLE===
===EXAMPLE===
Line 20: Line 29:
  Your job 1875395 ("J1") has been submitted
  Your job 1875395 ("J1") has been submitted


Where the number is your JOBID, a unique numerical identified for your job.
Where the number is your JOBID, a unique numerical identifier for your job.


Let's now break down the arguments in the script
Let's now break down the arguments in the script
Line 34: Line 43:
;-N J1
;-N J1
: Names your job "J1."  When you look at the queue, this will be the text that shows up in the "name" column.  This will also be the beginning of the output (<code>J1.o[JOBID]</code>) and error (<code>J1.e[JOBID]</code>) files for your job.
: Names your job "J1."  When you look at the queue, this will be the text that shows up in the "name" column.  This will also be the beginning of the output (<code>J1.o[JOBID]</code>) and error (<code>J1.e[JOBID]</code>) files for your job.
;-l
: This is the resources flag meaning that the text immediately after it will ask for things like:
:* certain amount of memory (mem=1024MB)
:* certain number of processors (pe=8), or
:* certain length of time (time=HH:MM:SS)

Revision as of 04:42, 15 March 2012

Back to all things Hoffman2

If you remember from Anatomy of the Computing Cluster, the Sun Grid Engine on Hoffman2 is the scheduler for all computing jobs. It takes your computing job request, considers what resources you are asking for and then puts your job in a line waiting for those resources to become available.

Ask for a lot of memory or many computing cores, and your job will get put further back in the line because it will have to wait for more things to become available.

Ask for a simple 1GB of memory and a single computing core with a short time window, and your job will likely get placed at the front of the line and start running soon if not immediately.

So how does one submit a computing job request? You've got some options:

  1. job.q - Use the wonderful tool that ATS wrote, it has a great menu and walks you through everything
  2. qsub - Get under the hood and do things yourself, it can get messy but it can also be faster.

job.q

On the command line, enter job.q and follow its step-by-step instructions.


qsub

Everything that job.q did can be done on the command line.

EXAMPLE

I have a script called gather.sh which can take a list of directories and aggregate the contents of a specific file in each directory into a single text file. This file actually exists and can be found in /u/home/FMRI/apps/examples/gather.sh

If it needs to go through a bunch of directories and the files are large, this would be a good job to submit to the queue. The command to do this would be:

qsub -cwd -V -N J1 -l express,time=0:05:00 /u/home/FMRI/apps/examples/gather.sh

And something like the following will be printed out:

Your job 1875395 ("J1") has been submitted

Where the number is your JOBID, a unique numerical identifier for your job.

Let's now break down the arguments in the script

-cwd
Change working directory
When your script runs, change the working directory to where you currently are in the filesystem.
e.g. If you were in the director /u/home/mscohen/data/ when you ran the command, the queue will change directories to that location and then execute the script you gave it. This means output and error directories will be placed here for that job.
-V
Exports all the environment variables in qsub to the context of the job. Useful if you passed a variable to the script.
-N J1
Names your job "J1." When you look at the queue, this will be the text that shows up in the "name" column. This will also be the beginning of the output (J1.o[JOBID]) and error (J1.e[JOBID]) files for your job.
-l
This is the resources flag meaning that the text immediately after it will ask for things like:
  • certain amount of memory (mem=1024MB)
  • certain number of processors (pe=8), or
  • certain length of time (time=HH:MM:SS)