POV-Ray : Newsgroups : povray.advanced-users : Batch multi-core rendering server wrapper for povray Server Time
31 Oct 2024 23:31:12 EDT (-0400)
  Batch multi-core rendering server wrapper for povray (Message 1 to 5 of 5)  
From: Stephen Pope
Subject: Batch multi-core rendering server wrapper for povray
Date: 24 Feb 2010 23:20:01
Message: <web.4b85f8dcf96d13da5c2e077e0@news.povray.org>
Hello all,

I'd like to share a useful utility I developed for running povray on a set of
scripts in parallel on multi-core servers. It's a simple C++ program (*nix &
MacOSX) that can be run in parallel from makefiles to render successive frames
of a scene with many threads of povray.

The source code is at:
    http://FASTLabInc.com/pov-render.cpp

Here's the header of the source.

stp

-----

POV-Renderer -- Batch multi-core rendering server wrapper for povray
 (i.e., run povray on a set of scripts in parallel on multi-core servers)
 Stephen Pope - stp### [at] heaveneverywherecom - Dec, 2009, Feb, 2010

This program can be run from a make file in multiple threads to schedule
batch rendering with povray on multi-core machines. Each thread runs through
the frames in sequence using a frame# lock file for synchronization.
The typical Makefile entry is,

 # 2 renderer threads, each makes 600 out of 1200 frames for t = 0 to 1
 t4:
  echo 0 > frame_num
  nohup ./pov-render -n 600 -f 0 1200 -t 0.0 1.0 &
  sleep 2
  nohup ./pov-render -n 600 -f 0 1200 -t 0.0 1.0 &

The cmd "make t4" will now fork 2 processes, which the OS will allocate to their
own cores.
You can run more threads on multi-core machines by editing the Makefile.

The povray command generated to render frames in a thread has format:

/opt/local/bin/povray +W1920 +H1080 +FN +Q9 +KC
 +I/home/stp/POV/Sc12.pov +O/scratch/stp/Sc1200
 +L/opt/local/lib/povray-3.6.1/include +L/home/stp/POV
 +KFI0 +KFF1000 +KI0.0 +KF1.0 +SF81 +EF81

The details of the command options are in the C++ code below, and can be
overridden from the render command.

pov-render command flags
 -c command
 -n # frames to make
 -s starting frame
 -i in file
 -o out file
 -q quality
 -f F0 F1 -- start/end frame
 -t t0 t1 -- start/end time
 -x # threads
 -u print usage

Compile this program like, (in Makefile),
 # target to compile renderer
 re:
  g++ -o pov-render pov-render.cpp  # add -lpthread on Linux

-----


Post a reply to this message

From: tmillic
Subject: Re: Batch multi-core rendering server wrapper for povray
Date: 25 Feb 2010 02:55:27
Message: <4b862cef$1@news.povray.org>
Nice. I've been content with just running folding@home on the other cores, 
but this is nice.


Stephen Pope wrote:

> 
> Hello all,
> 
> I'd like to share a useful utility I developed for running povray on a set
> of scripts in parallel on multi-core servers. It's a simple C++ program
> (*nix & MacOSX) that can be run in parallel from makefiles to render
> successive frames of a scene with many threads of povray.
> 
> The source code is at:
>     http://FASTLabInc.com/pov-render.cpp
> 
> Here's the header of the source.
> 
> stp
> 
> -----
> 
> POV-Renderer -- Batch multi-core rendering server wrapper for povray
>  (i.e., run povray on a set of scripts in parallel on multi-core servers)
>  Stephen Pope - stp### [at] heaveneverywherecom - Dec, 2009, Feb, 2010
> 
> This program can be run from a make file in multiple threads to schedule
> batch rendering with povray on multi-core machines. Each thread runs
> through the frames in sequence using a frame# lock file for
> synchronization. The typical Makefile entry is,
> 
>  # 2 renderer threads, each makes 600 out of 1200 frames for t = 0 to 1
>  t4:
>   echo 0 > frame_num
>   nohup ./pov-render -n 600 -f 0 1200 -t 0.0 1.0 &
>   sleep 2
>   nohup ./pov-render -n 600 -f 0 1200 -t 0.0 1.0 &
> 
> The cmd "make t4" will now fork 2 processes, which the OS will allocate to
> their own cores.
> You can run more threads on multi-core machines by editing the Makefile.
> 
> The povray command generated to render frames in a thread has format:
> 
> /opt/local/bin/povray +W1920 +H1080 +FN +Q9 +KC
>  +I/home/stp/POV/Sc12.pov +O/scratch/stp/Sc1200
>  +L/opt/local/lib/povray-3.6.1/include +L/home/stp/POV
>  +KFI0 +KFF1000 +KI0.0 +KF1.0 +SF81 +EF81
> 
> The details of the command options are in the C++ code below, and can be
> overridden from the render command.
> 
> pov-render command flags
>  -c command
>  -n # frames to make
>  -s starting frame
>  -i in file
>  -o out file
>  -q quality
>  -f F0 F1 -- start/end frame
>  -t t0 t1 -- start/end time
>  -x # threads
>  -u print usage
> 
> Compile this program like, (in Makefile),
>  # target to compile renderer
>  re:
>   g++ -o pov-render pov-render.cpp  # add -lpthread on Linux
> 
> -----


Post a reply to this message

From: Stephen Pope
Subject: Re: Batch multi-core rendering server wrapper for povray
Date: 25 Feb 2010 03:05:02
Message: <web.4b862eddf0ee27f65c2e077e0@news.povray.org>
A few extra notes to the pov-render driver program:

1. The program is "straight" C++ with no GUI; it compiles on Unix/Linux, MacOSX
and MS-Windows with std C/C++ libraries (or cygwin/DOS). The actual povray
command location is a #define in the code.

2. Macro #multithreaded is normally not used; each renderer task runs a single
thread.

3. pov-render can be run from make, shell/batch scripts, or a scripting language
like python or Smalltalk.

4. Partial batches can easily be restarted by editing the frame_num file (and/or
Makefile) and running make again.

5. The default in/out files are Default.pov and Default 0001.png (#define in the
code). These are changed either by compiling a version for each scene, or using
the -i and -o cmd-line options in the Makefile.

Enjoy! (I currently have it running on 30 or so cores here at UCSB -- since
October.)

stp


"Stephen Pope" <stephen [at] HeavenEverywhere [dot] com> wrote:
> Hello all,
>
> I'd like to share a useful utility I developed for running povray on a set of
> scripts in parallel on multi-core servers. It's a simple C++ program (*nix &
> MacOSX) that can be run in parallel from makefiles to render successive frames
> of a scene with many threads of povray.
>
> The source code is at:
>     http://FASTLabInc.com/pov-render.cpp
>
> Here's the header of the source.
>
 [ ...stuff deleted ]
>
> Compile this program like, (in Makefile),
>  # target to compile renderer
>  re:
>   g++ -o pov-render pov-render.cpp  # add -lpthread on Linux
>
> -----


Post a reply to this message

From: Warp
Subject: Re: Batch multi-core rendering server wrapper for povray
Date: 25 Feb 2010 10:34:48
Message: <4b869898@news.povray.org>
Stephen Pope <ste### [at] heaveneverywherecom> wrote:
> I'd like to share a useful utility I developed for running povray on a set of
> scripts in parallel on multi-core servers.

  What advantages does it offer over POV-Ray 3.7, besides consuming multiple
times as much memory (ie. as many times as there are processes running)?

-- 
                                                          - Warp


Post a reply to this message

From: scott
Subject: Re: Batch multi-core rendering server wrapper for povray
Date: 2 Mar 2010 09:51:57
Message: <4b8d260d$1@news.povray.org>
>  What advantages does it offer over POV-Ray 3.7, besides consuming 
> multiple
> times as much memory (ie. as many times as there are processes running)?

I saw 3.6.1 mentioned in his post, so I assume it is so you can use a 
non-beta version of POV on a multi-core machine (they've been popular for 
quite some years now).


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.