Mandelbrot - Jiva
Over the past few months, we have been spreading all our manpower over numerous projects, including our own product development, as well as contract work for Twisted Pair Solutions. The work load that weighs upon us has left us with little to no time to keep our lively fans up to date with our current projects. However, we caught word (okay, they called us) that Giant Campus has deployed over 1000 machines with Jiva, our java-based grid computing solution. This is big news to us, as this is the 3rd year they have deployed Jiva onto public workstations. This has inspired us to create a new Jiva Task to run on the work stations.
Prior to today, most tasks that have been run were prime number crunching and Fourier transformations. This time we wanted to show something a bit more beautiful on the screen, and decided to use the Mandelbrot Set from the family of complex quadratic polynomials. We needed to produce a graphical representation of the Mandelbrot Set, and push the image to the Jiva screen saver.
Using only the sample PrimeTask code that was provided with the Jiva APIs, and the source code for the JivaScreenSaver. I was able to compute each individual pixel value using the algorithm provided on the wikipedia site to produce a similar image as shown on the wiki. Some of the constraints that I had to work with were how to specify the size of the image that should be pushed to the screen saver.
Prior to integrating the Mandelbrot Set into a JivaTask, I wanted to make sure that my algorithm was working as intended. So I wrote a stand alone application that drew the image into a windows frame on the desktop. Being able to visually confirm that the algorithm was correct, I started to integrate my code into a JivaTask. This work was fairly simple, I looked at the sample PrimeTask class, and gutted out any code that was specific for computing prime numbers, leaving only empty methods for intializing and running the batch process job.
After spending a little time understanding the control flow of a JivaTask, I integrated my existing Mandelbrot code into the gutted skeleton. Within a short period of time, I was able to produce and write a JPG file to the scratch directory and confirm that the Mandelbrot images were manifested properly.
Now that I got my images created, I wanted to start pushing them to the Jiva screensaver. Luckily, I had my image in a format that the JivaScreenSaver could already process, I just needed to push images when they were ready to the screen saver.
Finally, when everything was connected properly, I was able to view my Mandelbrot images in the Jiva screensaver, after which I cashed in 3 weeks of vacation time, purchased a top hat, a cuban cigar and reserved the best hot tub at the Château de Chenonceau. Okay, maybe not. I wisely decided to go back and continue supporting our product development team.

-gcole
Filed under: JIVA by gcole
Leave a Reply
You must be logged in to post a comment.