The column I want you to pay attention to first is the 'state'. The two most common statuses you'll see are 'r' ('Running') and 'qw' ('Queued and Waiting'). ''Generally speaking'', those jobs that are higher on the list will start running before the ones lower on the list. This way you can see your relative position. Another useful tool is to see how busy Beocat is. [http://ganglia.beocat.cis.ksu.edu/ http://ganglia.beocat.ksu.edu/] will give you those statistics. Depending on the resources you ask for, a job you submit may start immediately or may take up to several weeks, depending on the priority of your job, the resources available, and the requested resources of the jobs ahead of you in the queue.

+

The column I want you to pay attention to first is the 'state'. The two most common statuses you'll see are 'r' ('Running') and 'qw' ('Queued and Waiting'). ''Generally speaking'', those jobs that are higher on the list will start running before the ones lower on the list. This way you can see your relative position. Another useful tool is to see how busy Beocat is. [http://ganglia.beocat.ksu.edu/ http://ganglia.beocat.ksu.edu/] will give you those statistics. Depending on the resources you ask for, a job you submit may start immediately or may take up to several weeks, depending on the priority of your job, the resources available, and the requested resources of the jobs ahead of you in the queue.

If you want to read more, continue on to our [[AdvancedSGE]] page.

If you want to read more, continue on to our [[AdvancedSGE]] page.

Revision as of 13:54, 16 August 2016

Submitting your first job

To submit a job to run under SGE, we use the qsub command. qsub (queue submit) takes the commands you give it, and runs it through the scheduler, which finds the optimum place for your job to run. With over 150 nodes and 2500 cores to schedule, as well as differing priorities, hardware, and individual resources, the scheduler's job is not trivial.

There are a few things you'll need to know before running qsub.

How many cores you need. Note that unless your program is created to use multiple cores (called "threading"), asking for more cores will not speed up your job. This is a common misperception. Beocat will not magically make your program use multiple cores! For this reason the default is 1 core.

How much time you need. Many users when beginning to use Beocat neglect to specify a time requirement. The default is one hour, and we get asked why their job died after one hour. We usually point them to the FAQ.

How much memory you need. The default is 1GB. If your job uses significantly more than you ask, your job will be placed on hold until you fix your request.

Any advanced options. See the AdvancedSGE page for these requests. For our basic examples here, we will ignore these.

So let's now create a small script to test our ability to submit jobs. Create the following file (either by copying it to Beocat or by editing a text file and we'll name it myhost.sh. Both of these methods are documented on our LinuxBasics page.

1 #!/bin/sh2 hostname

Be sure to make it executable

chmod u+x myhost.sh

Now, let's first run it on the headnode. As I write this, I'm logged into the headnode named 'minerva'. When I run it, it looks like this:

% ./myhost.sh
minerva

So, now lets submit it as a job and see what happens. Here I'm going to use three options

-l mem= tells how much memory I need. In my example, I'm using our system minimum of 512 MB, which is more than enough. Note that your memory request is per core, which doesn't make much difference for this example, but will as you submit more complex jobs.

-l h_rt= tells how much runtime I need. This can be in the form of seconds, or hours:minutes:seconds. This is a very short job, so 60 seconds should be plenty. Note that if you submit a job that needs to run for days or weeks, you'll need to translate that into hours. This can't be changed after the job is started please make sure you have requested a sufficient amount of time.

-pe single 1 tells SGE that I need only a single core on one machine. The AdvancedSGE page has much more on the "Parallel Environment" switch.

The four additional files that were created are in the form scriptname.XX.jjjjjjj - where scriptname is the script you submitted, XX is 'po' (parallel output), 'pe' (parallel error), 'e' (error), or 'o' (output), and jjjjjjj is the job number (which is given when you submitted your job, in this case 1483446).

If everything goes as planned, the po, pe, and e jobs will be blank...

Each job line will contain the username, program name, job ID number, number of cores, maximum memory used, whether the job is killable, and the
amount of time the job has run. If the job is still in the queue, it may contain information on the requested run time and memory per core and the time
shown is how long the job has been in the queue.

In this case, I have 2 jobs running on Hero43. unafold is using 1 core while octopus is using 16 cores. The most useful information here
is the memory being used in each case. While unafold is taking very little memory, octopus is using 125 GB and the red
font indicates that it is close to the amount requested. If the memory on a job is over the requested amount it will have a
red background and you should request more memory in future runs. If the memory is flashing with a red background, you are more
than 50% over your requested amount and your code will be forced to use disk swap which can slow it down enormously. You're usually
better off killing the job and restarting with an appropriate memory request.
If the code accesses large files, there may be an IO value reported. This number is not very accurate.

kstat -d 7
This will show you information about the jobs that have completed in the last 7 days.

kstat -c
This provides a global view of Beocat showing how many cores each person is using.

You can also use the 'status' command. By default this command will give you all of your queued and running jobs. If you have no jobs in the queue or running, it will simply quit with no output.

That leaves you with the question, though - when will my waiting job start? We can't really give an absolute answer to that question, but we can show you where you stand relative to others. The tool for this is 'qstat'.

Here is an edited version (just for space sake) of the jobs on Beocat at the time I'm writing this.

The column I want you to pay attention to first is the 'state'. The two most common statuses you'll see are 'r' ('Running') and 'qw' ('Queued and Waiting'). Generally speaking, those jobs that are higher on the list will start running before the ones lower on the list. This way you can see your relative position. Another useful tool is to see how busy Beocat is. http://ganglia.beocat.ksu.edu/ will give you those statistics. Depending on the resources you ask for, a job you submit may start immediately or may take up to several weeks, depending on the priority of your job, the resources available, and the requested resources of the jobs ahead of you in the queue.