Manta Interactive Ray Tracer Development Mailing List

Text archives Help


Re: [MANTA] Parallel animation callback


Chronological Thread 
  • From: James Bigler <bigler@sci.utah.edu>
  • To: "'manta@sci.utah.edu'" <manta@sci.utah.edu>
  • Subject: Re: [MANTA] Parallel animation callback
  • Date: Mon, 17 Jul 2006 13:09:17 -0600

I don't know that there is an example, but the RTRT/Manta interface shows:

virtual void addParallelOneShotCallback(Whence whence, long frame,
                                    CallbackBase_2Data<int, int>* callback);
virtual void registerParallelAnimationCallback(CallbackBase_3Data<int, int, bool&>*);

There is some documentation about callbacks in trunk/doc/Callbacks.txt, but that is more a document on the functions themselves.

There is one thing you should note about callbacks. There are two types of function parameters. They are differentiated based on when the parameters are bound to the function.

Creation time parameters (called Arg1, Arg2, etc. in the callback structure) are bound when you create the callback. Call time parameters (called Data1, Data2, etc.) are bound when you call the callback function. For a complete explanation refer to the documentation.

Anyway, when you store a list of callbacks all you care about is the number of call time bound parameters. This is what you see in the list of callbacks you can register.

Transactions have no call time bound parameters, so it uses a CallbackBase_0Data as a base class. You can use any function you choose as long as you bind the parameters at creation time (see Callbacks.txt).

The parallel callbacks need to have some call time bound parameters. These would include 2 integers for the one shot parallel callbacks (used once and deleted), and 3 for the parallel animation callback (called every frame).

There doesn't seem to be any documentation on what the call time bound parameters are, but looking at the code in RTRT.cc:

one shot parallel callbacks need (int proc, int numProcs);
paralle callbacks need (int proc, int numProcs, bool& changed);

For examples on how to create appropriate Callbacks see Callbacks.txt.

James

Christiaan Paul Gribble wrote:
Is there an example of how to register a ParallelAnimationCallback anywhere? What the callback's interface, etc. should look like?

On Jul 17, 2006, at 10:08 AM, James Bigler wrote:

Yes, this will be called by all the threads in the system. See Engine/Control/RTRT.cc::doParallelAnimationCallbacks()

The parallel animation callback happen after the serial ones.

James

Christiaan Paul Gribble wrote:
Hi,
I need to have all threads run a loop at the top (or bottom) of the rendering loop. Is a ParallelAnimationCallback what I need to register?
C






Archive powered by MHonArc 2.6.16.

Top of page