Sun N1 Grid Engine 6.1 User's Guide

Submitting a Simple Job

Use the information and instructions in this section to become familiar with basic procedures involved in submitting jobs.


Note –

If you installed the N1 Grid Engine 6.1 software under an unprivileged user account, you must log in as that user to be able to run jobs. See Installation Accounts in Sun N1 Grid Engine 6.1 Installation Guide for details.


ProcedureHow To Submit a Simple Job From the Command Line

Before you run any grid engine system command, you must first set your executable search path and other environment conditions properly.

  1. From the command line, type one of the following commands.

    • If you are using csh or tcsh as your command interpreter, type the following:


      % source sge-root/cell/common/settings.csh

      sge-root specifies the location of the root directory of the grid engine system. This directory was specified at the beginning of the installation procedure.

    • If you are using sh, ksh, or bash as your command interpreter, type the following:


      # . sge-root/cell/common/settings.sh

      Note –

      You can add these commands to your .login, .cshrc, or .profile files, whichever is appropriate. By adding these commands, you guarantee proper settings for all interactive session you start later.


  2. Submit a simple job script to your cluster by typing the following command:


    % qsub simple.sh
    

    The command assumes that simple.sh is the name of the script file, and that the file is located in your current working directory.

    You can find the following job in the file /sge-root/examples/jobs/simple.sh.


    #!/bin/sh
    #
    #
    # (c) 2004 Sun Microsystems, Inc. Use is subject to license terms.
    
    # This is a simple example of a SGE batch script
    
    # request Bourne shell as shell for job
    #$ -S /bin/sh
    
    #
    # print date and time
    date
    # Sleep for 20 seconds
    sleep 20
    # print date and time again
    date

    If the job submits successfully, the qsub command responds with a message similar to the following example:


    your job 1 (“simple.sh”) has been submitted
  3. Type the following command to retrieve status information about your job.


    % qstat

    You should receive a status report that provides information about all jobs currently known to the grid engine system. For each job, the status report lists the following items:

    • Job ID, which is the unique number that is included in the submit confirmation

    • Name of the job script

    • Owner of the job

    • State indicator; for example, r means running

    • Submit or start time

    • Name of the queue in which the job runs

    If qstat produces no output, no jobs are actually known to the system. For example, your job might already have finished.

    You can control the output of the finished jobs by checking their stdout and stderr redirection files. By default, these files are generated in the job owner`s home directory on the host that ran the job. The names of the files are composed of the job script file name with a .o extension for the stdout file and a .e extension for the stderr file, followed by the unique job ID. The stdout and stderr files of your job can be found under the names simple.sh.o1 and simple.sh.e1 respectively. These names are used if your job was the first ever executed in a newly installed grid engine system.

ProcedureHow To Submit a Simple Job With QMON

A more convenient way to submit and control jobs and of getting an overview of the grid engine system is the graphical user interface QMON. Among other facilities, QMON provides a job submission dialog box and a Job Control dialog box for the tasks of submitting and monitoring jobs.

  1. Type the following command to start the QMON GUI:


    % qmon
    

    During startup, a message window appears, and then the QMON Main Control window appears.

    Figure 3–1 QMON Main Control Window

    QMON Main Control window. Shows callouts indicating
that you should first click the Job Control button and then click
the Submit Jobs button.

  2. Click the Job Control button, and then click the Submit Jobs button.


    Tip –

    The button names, such as Job Control, are displayed when you rest the mouse pointer over the buttons.


    The Submit Job and the Job Control dialog boxes appear, as shown in the following figures.

    Figure 3–2 Submit Job Dialog Box

    Dialog box titled Submit Job. Shows callouts
indicating that you should first click the script button and then
click Submit to submit the job.

    Figure 3–3 Job Control Dialog Box

    Dialog box titled Job Control. Shows the Running
Jobs tab with job information. Shows buttons for manipulating jobs.

  3. In the Submit Job dialog box, click the icon at the right of the Job Script field.

    The Select a File dialog box appears.

    Figure 3–4 Select a File Dialog Box

    Dialog box titled Select a File. Shows lists
of directories and files from which to select a job script. Shows
OK, Filter, Cancel, and Help buttons.

  4. Select your script file.

    For example, select the file simple.sh that was used in the command line example.

  5. Click OK to close the Select a File dialog box.

  6. On the Submit Job dialog box, click Submit.

    After a few seconds you should be able to monitor your job on the Job Control dialog box. You first see your job on the Pending Jobs tab. The job quickly moves to the Running Jobs tab once the job starts running.