Submitting and Monitoring a Simple Test Job


We will begin by submitting a simple test job. First, we'll relink it with the Condor libraries. We'll then examine the submit description fine. Next, we'll submit the job to Condor. Finally, we'll monitor the jobs progress.

First, change into a directory with the example job:

% cd ~/examples/simple

The example job is a simple "hello world" program that will run very quickly. It simply writes "Hello World!" to STDOUT.

First, we'll compile and run the program normally, without Condor. We'll use two steps to compile, the first to create a simple ".o" file from the source file, and the second to actually link this ".o" into an executable.

% gcc -c hello.c
% gcc hello.o -o hello 
% ./hello

In order to take advantage of the advanced features of condor, we need to re-link the executable with Condor's libraries. In order to do this, we use condor_compile to re-link the object file (hello.o) into a new binary that will work with condor:

% condor_compile gcc hello.o -o hello.condor

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

% ./hello.condor

It will print out a warning telling you the binary is linked for Condor, and then it will produce the same output as before.

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 simple test job example
#
################

Universe        = standard
Executable      = hello.condor

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

Queue

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 file. The first line of the submit file that is not a comment specifies that we want to run this job in the standard universe, so we use the checkpointing and remote system call features of Condor.

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 setup these files automatically for the executable.

The "log = hello.log" line is very important. It tells Condor you want to see a "User log" for the job, which is a record of everything that happened to it.

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 hello.submit

Now you can use "condor_q" to view the status of your job. You can look at the output files to see that it ran. Furthermore, you can look at the log file (hello.log) to see what Condor did with your job. You may use any of the following commands in any order:

% condor_q
% condor_status -run
% cat hello.log
% cat hello.out

Since this job will execute so quickly, you might not see it in condor_q. In that case, try using condor_history to see that it completed:

% condor_history

That's it, we're done!