|
![]() |
C3D is a Java benchmark application that measures the performance of a 3D raytracer renderer distributed over several Java virtual machines using Java RMI. It showcases some of the benefits of ProActive, notably the ease of distributed programming, and the speedup through parallel calculation.
Several users can collaboratively view and manipulate a 3D scene. The image of the scene is calculated by a dynamic set of rendering engines using a raytracing algorithm, everything being controlled by a central dispatcher.
the active objects in the c3d application
using the script c3d_no_user
A "Dispatcher" object is launched (ie a centralized server) as well as 4 "Renderer" objects, that are active objects to be used for parallel rendering.
the 4 renderers are launched
the dispatcher GUI is launched
The bottom part of the window allows the addition and removal of renderers.
using c3d_add_user
- connect on the current host (proposed by default) by just giving your name
for example the user "alice"
- spin the scene, add a random sphere, and observe how the action takes place immediately
- add and remove renderers, and observe the effect on the "speed up" indication from the user window.
Which configuration is the fastest for the rendering?
Are you on a multi-processor machine?
* you might not perceive the difference of the performance. The difference is better seen with more distributed nodes and objects (for example on a cluster with 30+ renderers).
using the c3d_add_user script, and specifying the host (NOT set by default)
If you use rlogin, make sure the DISPLAY is properly set.
You must use the same version of ProActive on both machines!
- test the collaborative behavior of the application when several users are connected.
Notice that a collaborative consensus must be reached before starting some actions (or that a timeout occured).
- to visualize all Active objects, you need to acquire ("monitoring" menu) :
- the machine on which you started the "Dispatcher"
- the machine on which you started the second user
- add random spheres for instance, and observe messages (Requests) between Active Objects.
- add and remove renderers, and check graphically whether the corresponding Active Objects are contacted or not, in order to achieve the rendering.
- you can textually visualize this information by activating "add event timeline for this WorldObject" on the World panel with the right mouse button, and then "show the event list window" on the top menu window
- from IC2D, you can drag-and-drop active objects from one JVM to another. Click the right button on a C3DRenderingEngine, and drag and drop it in another JVM. Observe the migration taking place.
- add a new sphere, using all rendering engines, and check that the messages are still sent to the active object that was asked to migrate.
- as migration and communications are implemented in a fully compatible manner, you can even migrate with IC2D an active object while it is communicating (for instance when a rendering action is in progress). Give it a try!
Since version 1.0.1 of the C3D example, you can also migrate the client windows!
manually you can start a new JVM - a "Node" in the ProActive terminology - that will be used in a running system.
- on a different machine, or by remote login on another host, start another Node, named for instance NodeZ :
under linux :
startNode.sh rmi://mymachine/NodeZ & (or startNode.bat rmi://mymachine/NodeZ)
The node should appear in IC2D when you request the monitoring of the new machine involved (Monitoring menu, then "monitor new RMI host".
- the node just started has no active object running in it. Drag and drop one of the renderers, and check that the node is now taking place in the computation :
- spin the scene to trigger a new rendering
- see the topology
* if you feel uncomfortable with the automatic layout, switch to manual using the "manual layout" option (right click on the World panel). You can then reorganize the layout of the machines.
- to fully distribute the computation, start several nodes (you need 2 more) and drag-and drop renderers in them.
Depending on the machines you have, the complexity of the image, look for the most efficient configuration.
org.objectweb.proactive.examples.c3d.C3DUser.java
org.objectweb.proactive.examples.c3d.C3DRenderingEngine.java
org.objectweb.proactive.examples.c3d.C3DDispatcher.java
look at the method public void processRotate(org.objectweb.proactive.Body body, String methodName, Request r) that handles election of the next action to undertake.