Sections
In this section
Computational Science and Engineering

2343 Academic Surge
UC Davis
One Shields Avenue
Davis, CA 95616

(530) 752-6298 phone
(530) 752-8894 fax

 
Computational Science and Engineering > Help > How-tos > Submit a Job to a Compute Cluster
Personal tools

Submit a Job to a Compute Cluster

This document describes how to submit a job to a CSE compute cluster

Purpose

This document is meant for users of CSE-managed compute clusters. If you are already familiar with SGE batch queues you may wish to skip to the Policies section.

Sun Grid Engine Clusters

The majority of CSE-managed clusters are running Sun Grid Engine (SGE). This section describes how to submit jobs to a cluster running the SGE batch queue.

Serial Jobs

A serial job is one that runs as a single process and occupies a single CPU. To submit a single cpu job, write a script including the commands you would use from the command line, for instance, put this in a file called q.sh:

#!/bin/bash
date
sleep 30
echo "I slept for 30 seconds";
date

To submit the job type:

$ qsub q.sh
Your job 48 ("q.sh") has been submitted.

Then to check on the job type:

$ qstat
job-ID prior name user state submit/start at queue slots ja-task-ID
-------------------------------------------------------------------------
48 0.55500 q.sh bill r 07/31/2006 14:50:37 all.q

Then when it's done you should have two files in the format <scriptname>.(e|o)<jobid> where e is stderr and o is stdout:

$ cat q.sh.o48
Mon Jul 31 14:50:37 PDT 2006
I slept for 30 seconds
Mon Jul 31 14:51:07 PDT 2006

Parallel Jobs

A parallel job is one that runs as multiple processes across multiple CPUs and potentially multiple machines. To run a parallel job called "relay" create a submit script called q.sh with the following:

#!/bin/bash
#
#$ -cwd
#$ -j y
#$ -S /bin/bash
# relay is the name of the binary
mpirun -np $NSLOTS -machinefile $TMPDIR/machines ./relay 1

Now, to run on 64 processors type:

$ qsub -pe mpi 64 q.sh
Your job 49 ("q.sh") has been submitted.

Then once the job is complete view the output:

$ cat q.sh.o49
size= 1, 131072 hops, 64 nodes in 0.16 sec ( 1.2 us/hop) 3139 KB/sec

Policies

Please see this FAQ regarding policies for participating in research computing at CSE.

Further information

If you would like more information on SGE please see this online documentation. Or if you have a specific question about our setup please feel free to email help@cse.ucdavis.edu.