[Radiance-general] running rtrace in parallel?

Thomas Bleicher tbleicher at googlemail.com
Fri Oct 16 02:01:56 PDT 2009


Hi Ery.

On Thu, Oct 15, 2009 at 9:19 PM, Guglielmetti, Robert
<Robert.Guglielmetti at nrel.gov> wrote:
> On 10/15/09 2:13 PM, "Ery Djunaedy" <ery.mailinglist at gmail.com> wrote:
>
>> All,
>>
>> Is there a way to run rtrace in parallel? Or any tricks to speed up
>> the process.
>
> You could break your grid into smaller pieces, and then start multiple
> rtrace processes on different machines or cores, then merge the data back
> into one "grid"...

Just did the very same thing yesterday. On Unix "split" and "cat" will
chop the file for you and reassemble it in the right order.

This is the script I used (with a few untested improvements):

#!/bin/bash

## optional: create your octree here
oconv -w sky.rad scene.rad > scene.oct

## scene.pts is the file with all the grid points
lines=`wc -l scene.pts | awk '{print $1}'`
## we have 8 CPUs and don't care about responsiveness of the system
lines_per_file=`echo "($lines / 8)+1" | bc`
mkdir -p parts
rm -f parts/*
mkdir -p parts_out
rm -f parts_out/*
split -l ${lines_per_file} scene.pts parts/part_

OPTS="-ab 6 -aa .1 -ar 2048 -ad 4096 -as 256 -av 0 0 0"

for pts in `find parts -type f`
do
    echo "starting '${pts}' ..."
    ## obviously you can add rcalc to the command if you want
    cat ${pts} | rtrace -I -w -h $OPTS  scene.oct > parts_out/${pts}.dat &
done
wait

## compile everything to one file
cat parts_out/*.dat > scene.dat

## end of script


Regards,
Thomas



More information about the Radiance-general mailing list