Newsletter sign-up
View all newsletters

Sign up for our technology specific newsletters.

Enterprise Java
Email Address:

Create your own supercomputer with Java

By combining Java with the Web's collection of computers, you too can have the processing power you crave -- without buying a Cray

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone

Page 2 of 6

Raytracing models reality very closely indeed. It attempts to model rays of light that, after emanating from some light source(s), interact with the model and eventually end up hitting your eye's retina. Concretely, the raytracing algorithm is extremely simple, in principle: For each image pixel to be rendered, it traces an imaginary beam of light from your eye (the viewpoint), going through the pixel and intersecting at some point the computer model of the scene to be drawn. At such an intersection the algorithm determines the pixel's color (and intensity) by tracing more imaginary light beams, this time emanating from the light source(s) in the scene's model. Hence ray-tracing, a very elegant but incredibly compute-intensive solution. (It is essentially a brute-force approach.)

Raytracing has one characteristic that's quite relevant to parallel computation: Each pixel can be computed totally independently from all others. In parallel jargon, there are no data dependencies. This means raytracing can be easily adapted to a parallel distributed environment, which is exactly what I have done with a raytracer written in Java, by Frederico Inacio de Moraes (who kindly gave me permission to use his code for this project).

The DAMPP Design: JobMasters and WorkerApplets

Let us now forget about raytracing and design the system this article is all about: a distributed applet-based (massively) parallel processing (DAMPP) system.

We need applets to calculate some parts of a parallel computation and we need to somehow assemble all the produced results in one central location. That central location will be the WWW server that carries the Web page containing our applets. These millions of applets, working like ants toward a common goal, are in fact just clones. So from now on I will simply talk about the WorkerApplet. (Keep in mind, though, that hundreds or thousands of these cloned applets can be instantiated at any one time, working in parallel on a given problem.)

On the WWW server runs another server program (along with the HTTP server), which I call the JobMaster. It is the command and control center of a DAMPP system. See the DAMPP high-level protocol diagram for the big picture.


DAMPP high-level protocol


Here's the scenario of the two components (WorkerApplet and JobMaster) interacting with each other:

A user surfs the Web and hits the page containing the worker applet. The worker applet loads and starts running immediately. The user is not even aware of this fact since the applet is totally invisible; it does not boast flashy animations or a GUI. It is simply a harmless visitor process in the machine.

The first thing the applet does is call home to tell the JobMaster it arrived safe and sound, and is ready to do some work (Step 1 in the DAMPP high-level protocol diagram). The JobMaster responds by issuing the applet with a job "specification" (Step 2). This is a parcel of information that allows the applet to start working on a sub-part of the big problem being attacked (in our raytracing example application, each applet calculates individual image lines).

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone
Comment
Login
Forgot your account info?
Add comment
Anonymous comments subject to approval. Register here for member benefits.
Have a JavaWorld account? Log in here. Register now for a free account.
Resources