POV-Ray Benchmark

By: James Reynolds - Revised: 2006-06-06 devin

Introduction

Learn how to use the POV-Ray benchmark with Xgrid.


POV-Ray Benchmark

We decided to try rendering POV-Ray's benchmark graphic.


Using the instructions in this article, we installed POV-Ray (Developer Tools and Darwin Ports also required--see our Xgrid POV-Ray movie page for more details about installing POV-Ray on multiple agents).

We also used a modified generate script to create the ini files. We modified it so that it used the parameters suggested by the POV-Ray team. We saved all the ini files to a folder and specified that as a filelist argument. The modified generate script can be found below:

#!/usr/bin/perl

$width=384;
$height=384;

$number_of_slices = 48; #384, 192, 96, 48, 24

$ini_save_path = "/Users/james/Desktop/xgrid/povjob/jobs/benchmark/filelist"; # This is the file list location.  Nothing else should be there (and will be erased)

$includedir = "include";
$inputfile = "benchmark.pov";
$outfilename = "benchmark_";
$other_arguments = "+a0.3 +v -d -f -x";

# Check input params
$slice=$height/$number_of_slices;
die "The height ($height) divided by the number of slices ($number_of_slices) must be an integer. " if ($height % $number_of_slices > 0);
die "$ini_save_path does not exist" if (! -e $ini_save_path);

# Clean up from previous runs
system "rm $ini_save_path/*";

# Go
for ($i = 0 ; $i < $number_of_slices; $i++ ) {
    $start = $i * $slice+1;
    $end =  ($i +1 ) * $slice;
    if ($i < 10) { $output_file = "0$i"; } else { $output_file = $i; }
    if ($i < 100) { $output_file = "0$output_file"; }
    $text = sprintf ("+H$height +W$width $other_arguments +I$inputfile +L$includedir +SR$start +ER$end ",$i) ; #+O${outfilename}%0.4d.ppm
    print `echo "$text" > $ini_save_path/$output_file.ini`;
}

Here is the script we used for the command:

# Show results
system "ls -al $ini_save_path";

#!/usr/bin/perl

print "----------------------------------------------------\n";
system "hostname";
print "----------------------------------------------------\n";
system "date";
print "----------------------------------------------------\n";
print "Rendering POV-Ray image\n";
system "/opt/local/bin/povray @ARGV"; # 2>> /tmp/povout
system "date";

We created a working directory and put into it the benchmark.pov file (found at /opt/local/share/povray-3.5/scenes/advanced) and the required include files (/opt/include/share/povray-3.5/include).


We created an empty folder for the destination, but we didn't need to because the benchmark test doesn't actually create any files, just tests how fast it can render (of course we did save the files once so we could see the graphic!).

Here is the custom plug-in:


We wanted to test it against something, so first we rendered the benchmark on a dual processor G5 2.0 GHz with 1 GB of RAM. We just used this command:

/opt/local/bin/povray -w384 -h384 +a0.3 _v -d -f -x +L/opt/local/share/povray-3.5/include/ +I/opt/local/share/povray-3.5/scenes/advanced/benchmark.pov

It took 36.5 minutes. Note, it was only using 1 CPU.

Then we ran it on the grid, with 22 agents composed of G4/400's (1 G4/466) with 192-576 MB RAM. 18 agents did 2 jobs, and 4 agents did 3 jobs. It took about 26 minutes, which is about the length of 3 G4 jobs that took 9 minutes each.

Then we ran it on the grid again, but we added the G5 to the grid. 6 agents did 1 job, 16 agents did 2 jobs, and the G5 did 10 jobs. The G4's took between 6.5 to 15 minutes on their jobs. The G5 took 1.5 to 3 minutes on its jobs. But the G5 was idle the last 13 minutes. The total time was 24 minutes, which is about the length of 2 G4 jobs that took 12 minutes each.

The key to understanding why the 2 tests were so close in time is understanding which agents are left with tasks at the end of a job. In the first test, 4 agents did 3 jobs, most likely, they were the last computers with jobs while the others sat idle. However, those 4 agents are also the fastest. See, when an agent finishes, it gets a new job. So the fastest agent is going to get the most jobs. So those 4 agents are relatively fast compared to the rest of the grid. The slowest of those 4 took an average of 9 minutes per job, a total time of 26 minutes.

On the other hand, the second job was much different. 6 agents did 1 job. Those 6 were the slowest. Then there were 16 agents that did 2 jobs. Of those 16, there were some pretty slow agents. In fact, the slowest of the 16 took an average of 12 minutes per job, or 24 minutes total. In the first test, this same computer would have been one of the agents that only got 2 jobs.

To speed the second job up, I could have doubled the number jobs. However, POV-Ray spends a few minutes at the beginning of each job parsing the pov file and figuring out where the "rays" are. So no matter how much I split the job up, I can't speed up that part of the job. So I shouldn't increase the number of jobs too much.

In fact, to really speed up the test, I would reduce the number of jobs to 1 per CPU (24 jobs), and increase the amount of work done by each agent so that they all took close to the same time (maybe 12 minutes?). The G5 would have about a third of the image (since it took 36 minutes to calculate the whole thing, it would take about 12 minutes to calculate that third. That agent that took 12 minutes on average per job would be given the same job size. The 6 agents that were slower, that took 15 minutes, well, they would have to be given less to do so that they took roughly 12 minutes too. This is all in an attempt to eliminate the idle time at the end of the job.

But this is all meaningless really. Xgrid is designed for tasks that take hours or days, not something like the POV-Ray benchmark that can be finished under an hour. If each agent were given 48 jobs that lasted an average 30 minutes each (30 minutes x 48 job = 24 hours), then an extra half hour idle time at the end of the day long task is insignificant.

POV-Ray LDraw Movie

So what have we done with Xgrid? Well, we made a little animation! You can watch it and download all of the scripts and other tools that we used to render the images in the movie. Xgrid POV-Ray movie.