Banner
Title: Condor Practical
Subtitle: Shape Visualizer Advanced Practical
Tutor: Alain Roy
Authors: Alain Roy, Sara Collins

Advanced Solution 2

For this solution, I wrote one submit file for each job. Each one looked something like this:

> cat submit0
Universe   = java
Executable = condor_shapes.jar
jar_files  = condor_shapes.jar
Log        = explorer.log
Output     = explorer.0.output
Error      = explorer.0.error
Arguments  = uk.ac.nesc.training.sfk.RegularExplorer 0 0 10 10 2000
Queue

> cat submit1
Universe   = java
Executable = condor_shapes.jar
jar_files  = condor_shapes.jar
Log        = explorer.log
Output     = explorer.1.output
Error      = explorer.1.error
Arguments  = uk.ac.nesc.training.sfk.RegularExplorer 0 10 10 20 2000
Queue

I then ran these with a big DAG that looked like this:

JOB N0 submit0
JOB N1 submit1
JOB N2 submit2
...
JOB COLLATE collate
PARENT N0 CHILD COLLATE
PARENT N1 CHILD COLLATE
PARENT N2 CHILD COLLATE
...

To write this submit file, I wrote a a Perl script to write the DAG and submit files, because it's a tedious job to do by hand:

#!/usr/bin/env perl

my $x, $y, $i;

open(DAG, ">dag");

$i = 0;
for ($x = 0; $x < 100; $x += 10) {
    for ($y = 0; $y < 100; $y += 10, $i++) {
        my $xx = $x + 10;
        my $yy = $y + 10;
        open(SUBMIT, ">submit$i");
        print SUBMIT "Universe   = java\n";
        print SUBMIT "Executable = condor_shapes.jar\n";
        print SUBMIT "jar_files  = condor_shapes.jar\n";
        print SUBMIT "Log        = explorer.log\n";
        print SUBMIT "Output     = explorer.$i.output\n";
        print SUBMIT "Error      = explorer.$i.error\n";
        print SUBMIT "Arguments  = uk.ac.nesc.training.sfk.RegularExplorer ";
        print SUBMIT "$x $y $xx $yy 2000\n";
        print SUBMIT "Queue\n";
        close(SUBMIT);

        print DAG "JOB N$i submit$i\n";
    }
}

print DAG "JOB COLLATE collate\n";

open(COLLATE, ">collate");
print COLLATE "Universe   = scheduler\n";
print COLLATE "Executable = /bin/cat\n";
print COLLATE "Log        = collate.log\n";
print COLLATE "Output     = collate.output\n";
print COLLATE "Error      = collate.error\n";
print COLLATE "Arguments  = ";
for ($i = 0; $i < 100; $i++) {
    print COLLATE "explorer.$i.output ";
}
print COLLATE "\n";
print COLLATE "Queue\n";
close(COLLATE);

for ($i = 0; $i < 100; $i++) {
    print DAG "PARENT N$i CHILD COLLATE\n"
}
close(DAG);

exit 0;

After running the DAG, it's a simple matter of asking gnuplot to graph collate.output.

Top