Sun Microsystems
Products & Services
 
Support & Training
 
 

Previous Previous     Contents     Index     Next Next
Chapter 3

Submitting Jobs

This chapter provides background information about submitting jobs, as well as instructions for how to submit jobs for processing. The chapter begins with an example of how to run a simple job. The chapter then continues with instructions for how to run more complex jobs.

Instructions for accomplishing the following tasks are included in this chapter.

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 software under an unprivileged user account, you must log in as that user to be able to run jobs. See "Installation Accounts" in N1 Grid Engine 6 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.

Steps
  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 the following simple job script to your cluster.

    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

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

    % qsub simple.sh

    The qsub command should confirm the successful job submission as follows:

    your job 1 ("simple.sh")
    has been submitted

  3. Enter 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 with a .e extension for the stderr file, followed by the unique job ID. Thus the stdout and the 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.

Previous Previous     Contents     Index     Next Next