rpiece and parallel processing

Here is part of a recent exchange with Greg Ward on this subject:

Hi Greg,

When I first started to use rpiece I thought it would automatically start up

separate processes but then I realized that the processes I started were all

on the same processor. I don't know where to find the option in rpiece to
start parallel processes. I could not find it in the manual. ..... As for
the -PP option, I included it with a file name and
noticed that Radiance put something into the file when I checked after a run

but it was only one entry, I think. ............

Thomas

···

----------------------------------------------------------------------
Hi Thomas,

To run rpiece on a machine with 4 processors, do like so:

% rpiece -X 10 -Y 10 -F syncfile -o output.pic -PP mach1.pst -af ambfile
[rpict options] octree &
# wait 10 seconds or so for the first process to load the octree, then:
% rpiece -F syncfile -o output.pic -PP mach1.pst octree &
% rpiece -F syncfile -o output.pic -PP mach1.pst octree &
% rpiece -F syncfile -o output.pic -PP mach1.pst octree &

The first invocation initializes the synchronization file and starts the
initial rpict process. The rpict process then forks itself and waits
for another process to attach to it via the named pipes in mach1.pst.
This is why you don't need to specify the rpict options on subsequent
invocations. However, you need to invoke rpiece once for each separate
rendering process, and that is how it's supposed to work.

To run rpiece on another machine sharing the same directory over NFS,
execute:

% rpiece -F syncfile -o output.pic -af ambfile [rpict options] octree &

If that machine also has multiple processors, add a -PP option to the
first invocation, this time giving it a unique name for that machine,
and add one invocation as above for each additional processor, assuming
you want as many rpict processes running as you have processors.

Is that clear enough?
-Greg

Hi Greg,

Yes, that is clear enough and it is essentially what I had in a C shell script. I
have now added a ten second wait after the first invocation as you suggest. The
script file is run like this
mrpiece n
where n + 1 is the number of invocations
and args2 is a file with all the arguments for rpiece.

Here is the script I wrote (I am a beginner) to save invoking up to 16
processes:

#!/bin/csh -f

···

#
# script to execute rpiece 1 \+ 1 times \# if \(#argv != 1)then#Script needs exactly one argument
echo "Incorrect number of arguments"
exit 1
endif
sleep 10
rpiece -v @args2 &
set end=$1
@ x=0
while ($x < $end)
@ x=$x + 1
      rpiece -v @args2 &
      echo $x
end
-------------------------
In the future I will add more arguments to provide more flexibility.

Thomas
p.s. a 70MB octree took less than two minutes to render at 1024 x1024 resolution,
medium quality and two bounces of indirect lighting using 11 processors.

Hi Thomas,

To run rpiece on a machine with 4 processors, do like so:

rpiece \-X 10 \-Y 10 \-F syncfile \-o output\.pic \-PP mach1\.pst \-af ambfile \[rpict options\] octree &amp; \# wait 10 seconds or so for the first process to load the octree, then: rpiece -F syncfile -o output.pic -PP mach1.pst octree &
rpiece \-F syncfile \-o output\.pic \-PP mach1\.pst octree &amp; rpiece -F syncfile -o output.pic -PP mach1.pst octree &

The first invocation initializes the synchronization file and starts the
initial rpict process. The rpict process then forks itself and waits
for another process to attach to it via the named pipes in mach1.pst.
This is why you don't need to specify the rpict options on subsequent
invocations. However, you need to invoke rpiece once for each separate
rendering process, and that is how it's supposed to work.

To run rpiece on another machine sharing the same directory over NFS,
execute:

% rpiece -F syncfile -o output.pic -af ambfile [rpict options] octree &

If that machine also has multiple processors, add a -PP option to the
first invocation, this time giving it a unique name for that machine,
and add one invocation as above for each additional processor, assuming
you want as many rpict processes running as you have processors.

Is that clear enough?
-Greg

Ooops, I slipped up in the C shell script I posted in the previous message
on this subject. The "sleep 10" line should be moved down one line after the
first invocation of rpiece (it works this way but not as efficiently).
Thanks Greg.

For those interested in the system I am running rpiece on: It is a 16
processor SGI Onyx2 IR3 with R12000, 400Mhz processors (not directly
comparable to PC Mhz) and 1GB memory each. In the reported run I was not
using 11 of the processors because another user was running on the remaining
ones. We are also setting up an 8 processor Linux cluster and will make
comparisons of how Radiance runs on it versus the SGI system.

Thomas