This is an introduction to the functionalities offered by ProActive : you will be performing distributed computations, moving objects between virtual machines and verify the transparency of the
Follow the instructions for downloading and installing ProActive.
The examples used in this tour are provided in the /scripts directory of the distribution.
The scripts are platform dependant : .sh files on linux are equivalent to the .bat files on windows
Illustrates several synchronization policies.
Use the readers script
What happens when priority is set to "reader priority" ?
in org.objectweb.proactive.examples.readers.ReaderWriter.java
More specifically, look at the routines in :
public void evenPolicy(org.objectweb.proactive.Service service)
public void readerPolicy(org.objectweb.proactive.Service service)
public void writerPolicy(org.objectweb.proactive.Service service)
Look at the inner class MyRequestFilterm that implements
org.objectweb.proactive.core.body.request.RequestFilter
How does it work?
For instance, let several writers go through at the same time.
- observe the Writer Policy policy before recompiling
- recompile (using compile.sh readers or compile.bat readers)
- observe that stub classes are regenerated and recompiled
- observe the difference due to the new synchronization policy : what happens now?
- correct the bug and recompile again ; check that everything is back to normal
The "dining philosophers" problem is a classical exercise in the teaching of concurrent programming. The goal is to avoid deadlocks.
We have provided an illustration of the solution using ProActive, where all the philosophers are active objects, as well as the table and the dinner frame (user interface).
with philosophers.sh or philosophers.bat
Philosophers |
![]() |
philosophing |
![]() |
hungry, wants the fork ! | |
![]() |
eating | |
Forks |
![]() |
taken |
![]() |
free |
The application runs by itself without encountering a deadlock.
Click on the philosophers' heads to switch their modes
Test that there are no deadlocks!
Test that you can starve one of the philosophers (ie the others alternate eating and thinking while one never eats!)
IC2D is a graphical environment for monitoring and steering of distributed and metacomputing applications.
- being in the autopilot mode, start the IC2D visualization application (using ic2d.sh or ic2d.bat)
- acquire you current machine
menu monitoring - monitor new RMI host
look at the active objects, and at the topology
C3D is a Java benchmark application that measures the performance of a 3D raytracer renderer distributed over several Java virtual machines using Java RMI.
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 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
- 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?
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 activating "add event timeline for this WorldObject" on the World panelm with the right 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!
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 on 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.
This example shows a set of mobile agents moving around while still communicating with their base and with each other. It also features the capability to move a swing window between screens while moving an agent from one JVM to the other.
using the penguin script.
using the ic2d script
acquire the machines you have started nodes on
- on the Advanced Penguin Controller window : button "add agent"
- select it, and press button "start"
- observe that the active object is moving between the machines, and that the penguin window disappears and reappears on the screen associated with the new JVM.
after selecting them, use the buttons to :
- communicate with them ("call agent")
- start, stop, resume them
- trigger a communication between them ("call another agent")
- start a node on a different computer, using another screen and keyboard
- monitor the corresponding JVM with IC2D
- drag-and-drop the active object "AdvancedPenguinController" with IC2D into the newly created JVM : the control window will appear on the other computer and its user can now control the penguins application.
- still with IC2D, doing a drag-and-drop back to the original JVM, you will be able to get back the window, and control yourself the application.
pick up your favorite topic, and develop your own distributed application using the ProActive library. Don't forget to use IC2D to visualize the topology, and to debug.
you can also try other applications