Monday, June 8, 2009

Very Short Tutorial: How to submit jobs through SGE?

Very Short Tutorial: How to submit jobs through SGE?

  1. Construct a short shell script that runs your program. In this example, we create submit_tut.sh with the following contents:

    date
    hostname
    uptime
    echo parameters are $*
    date

    Important Note: Please make sure that your script does not die before all your processes complete or our cleanup script will kill your processes. This can be assured by having a "wait" at the end of your script if you "background" any of your processes or (better) not use any background processes at all.

  2. Load the SGE settings.

    $ . /opt/sge/settings.sh

    Note the "." in front of "/opt/sge/settings.sh". You need that to source the settings file or it will not work!! Do this exactly once for every session you want to use SGE. You may also want to put it in your .profile.

  3. Submit your job:

    qsub < jobname >

    in our case:

    $ qsub submit_tut.sh

    $ qsub submit_tut.sh test

    $ qsub submit_tut.sh test test2

  4. Other SGE commands you might be interested in:

    You can check on the progress of your jobs by using the command

    $ qstat

    If you wish to abort your run, you can use the command

    $ qdel -u <userid> # or
    $ qdel <jobid>...

    Do not worry if your jobs went into the background as we have a cleanup procedure that will help you remove your processes within 5 minutes of your 'qdel'.

    SGE also does process accounting. Contents of the accounting database can be access using the command

    $ qacct

There is also a X11-based GUI tool for all of SGE's controls.

  1. To start it, you need to enable X11 forwarding. Here's a link containing instructions on setting up X11 support on a Windows machine.

  2. To verify if X11 is enabled on your particular session, just do

    $ echo $DISPLAY

    If the $DISPLAY variable is set to something like localhost:10.0, you're all set to go.

  3. Load the SGE settings if you have not done so.

  4. $ . /opt/sge/settings.sh

  5. Start the qmon program:

    $ qmon

Details about how to use the GUI and SGE are in the SGE User Guide availablehere.

 

From: https://www.comp.nus.edu.sg/cf/tembusu/sge.html

No comments:

Post a Comment

Google+