Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

Sponsored Links

Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs

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

  • Print
  • Feedback
Seymour Cray's Cray and Danny Hillis's Connection Machine -- these two types of supercomputers are what dreams are made of, at least to programmers who, like myself, hunger for infinite processing power. These Testarossas of the number-crunching world can simulate weather, car crashes and impacting anti-tank shells, miniature ecosystems and the global economy, the effects of imaginary pollution disasters, the internals of stars, and the detonation of an H-bomb.

Supercomputers are the ultimate kit for more than day-dreaming power-programmers. Superpower governments and giant multinationals rely heavily on them. Their astronomical costs have meant that few programmers have had the pleasure of even writing a single machine instruction for these ivory-tower instruments of knowledge.

But what does all this have to do with Java?

"Knock, knock. Can I borrow your CPU for a minute?"

Consider for a second your own PC: You're most likely staring at a Pentium-class machine, with 16 or more megabytes of RAM. Now look at your humble telephone socket: For many of us, this is your PC's connection to the Internet, linking your machine to millions more of these same Pentium-class machines. From this perspective, the Internet metamorphoses itself as the largest supercomputer in the world. And all that is necessary to harvest its awesome potential is to convince as many as possible of these Internet-connected machines to do some work for you, while you sit back, still staring at your diminutive PC.

But how do you get millions of Internet nodes to execute some code?

Enter the ubiquitous Web browser (which by now is likely to be Java-compatible). Most applets embedded in a Web page these days range in usefulness from the entertaining but excrutiatingly slow to the annoying crash-on-arrival type. Why not distribute some useful applets for a change, like ones tackling a massive computational problem whose solution could benefit the world, instead of the military or some profit-obsessed oil giant?

Raytracing as an example DAMPP application

Since I am hardly a nuclear physicist or a meteorologist or a world-renowned economist, I have chosen to tackle a subject most computer users and programmers will be more comfortable with: raytraced image generation. Raytracing is a technique that to date has produced the most life-like, photorealistic synthetic images to come out of machines. Some of the best, mind-blowing movie special effects in these past few years were done using raytracing, although most are generated using much cheaper (that is, faster) techniques that end up producing less realistic images or animation.


Although raytracing is not what this article is about, I shall give you a very brief summary of the technique: Computer generated images all have at their heart a mathematical description of the scene to be generated. Life-like images are produced from three-dimensional mathematical descriptions, where the scene or model is composed out of simple building blocks like flat polygons, spheres, cubes, cones, and lines. To obtain realistic images, the algorithm must model color and light and all its physical side-effects (shadows, reflections, transparancy, brightness, and darkness) as close to the real phenomenon as possible. This is where the cheaper image-rendering algorithms use shortcuts that trade image quality for speed of generation. Raytracing does the opposite. Its goal is maximum realism at the expense of quick rendering.

  • Print
  • Feedback

Resources