Submitting a Job to Condor

Submitting a Job to Condor

Now that we understand how to get the condor system up and running, we need to actually use the system. This means submitting jobs for condor to run. There are three major types of jobs in condor: vanilla, standard, and pvm. Here we discuss the first two.

The Vanilla Universe

If your condor pool is set up in such a way that you have a common file system across all of the machines, you can use condor to run any executable that would run normally on Unix, even shell scripts. Such jobs are said to run in a 'vanilla universe', since we are running plain old Unix programs. In order to do this, we need to tell condor some information about what program we want to run, where it is located, and how we want it to be run.

Preliminary: Please change to the vanilla directory by typing:
%  cd ~/workbook/submit/vanilla

In the interest of time, we have created the bare bones of a condor submit file for you. To take a look at it, type:

%  cat vanilla.submit

You'll notice that this submit file is quite trivial.

############
#
# Example submit file for vanilla job
#
############

Universe       = vanilla
Executable     = hello_world.sh  

input   = /dev/null
output  = hello.out                
error   = hello.error       
                                                  
Queue

Now, the first few lines that begin with a # sign are simply comments. Comments are skipped over by condor when it reads the file, but they can be useful to you as reminders as to what you were thinking when you wrote the config file. The first line of the submit file that is not a comment specifies that we want to run this job in the vanilla universe. This lets condor know that it shouldn't try and do anything special like checkpointing or remote system calls with this job. The executable line tells condor which executable program to run. We have also specified where STDIN for the program should come from, and where STDOUT and STDERR should go to. When the condor job is run, condor will be set this up transparently for the executable. In this case it is a shell script. You see the last line of the config file is:

Queue

This tells condor to add the job we just described to the job queue. Now that we have set up the config file, we need to actually submit job to condor. In order to do this, we simply call condor_submit with the our submit file as the only argument.

%  condor_submit vanilla.submit

In order to see what the state of the job queue is, we can use the command condor_q

%  condor_q

This command will print a table containing information about the jobs that have submitted. You should be able to identify the jobs that you have just submitted. After some time, your job will complete. To see the output, cat the files that we set as the output.

%  cat hello.out

You should see the output from your program once it is completed. If you do not, check the queue again to see if it has completed yet.


The Standard Universe

Preliminary: Please change to the standard directory by typing:
%  cd ~/workbook/submit/standard

In order to take advantage of the advanced features of condor, one needs to re-link executables. In order to do this, we use condor_compile to re-link object files into a new binary that will work with condor. If you list the files in this directory, you will see hello.c. This is an C source file for the the hello_world executable that we had before. In order to link a binary for condor, issue the following command:

%  condor_compile gcc hello.c -o hello

Now you should have an executable that is linked for condor called hello. You can run it outside of condor just to test it:

%  ./hello

Before we submit the job to condor, let's take a look at the submit file that we created

%  cat hello.submit

The output is:

################
#
# Condor submit file for standard universe example
#
################

Universe        = standard
Executable      = hello

input           = /dev/null
output          = hello_world.out
error           = hello_world.error
log             = hello_world.log

Initialdir	= /tmp/
Queue

This submit file should seem familiar except for the place where we indicate that we are running the standard universe. We can now submit the job the same way as we did with vanilla jobs. Notice that we are writing the files to /tmp, which is not a shared file system. This is one of the features that the standard universe allows.

%  condor_submit hello.submit

Once again, you can use condor_q to find out when your job has completed. You can look at the output files to see that it ran. Furthermore, you can look at the log file (hello_world.log) to see what Condor did with your job.


Other options in submit files

Preliminary: Please change to the options directory by typing:
%  cd ~/workbook/submit/options

There are many more options then we have seen here in our examples. Next, we will submit a job which exercises the true power of condor submit files and ClassAds. Let's look at the config file that we have built.

%  cat options.submit

You see:

######
#
# A condor submit file that exercises lots of options
#
######
Universe                = standard
Executable              = hello_world.solSPARC

input                   = /dev/null
output                  = hello_world.out.$(Process)
error                   = hello_world.error.$(Process)
Image_Size              = 2 Meg

requirements            = Arch == "SUN4x" && OpSys == "SOLARIS251"
log                     = hello_world.log

Queue 2                           

So there are quite a few more options in this file. The important thing to notice is that we are submitting from a Linux machine to a Solaris SPARC machine. More info about the rest of the options will be coming soon in the ClassAds workbook. So, submit the job to the UW-Madison CS pool:

%  ~/uw-bin/condor_submit options.submit