Sample Compute Grid applications

Use the sample Compute Grid applications as a starting point for implementing your own applications. The sample applications are in the <install_root>/installableApps directory.

The following list shows the available samples:

MandelbrotCI.ear

A compute-intensive application with a Web interface that computes and renders Mandelbrot fractal images. The MandelbrotCI application contains two modules: a Web module that provides the user interface and an Enterprise JavaBean (EJB) module that contains the compute-intensive logic.
  1. When installing the MandelbrotCI.ear file, ensure that the Deploy enterprise beans in Step 1: Select installation options box is cleared.
  2. Deploy the Web module to the same dynamic cluster as the job scheduler.
  3. Deploy the EJB module to a grid endpoint dynamic cluster.
  4. After installation, the URL for the GUI is http://<hostname>:<port>/mandelbrotci/gui, where hostname and port specify the host name and port number of the Web module.
The Web interface provides the controls as shown in the following table:
Table 1. Mandelbrot Web interface controls
Control Description
Zoom in, zoom out Zooms the current view in or out.
Pan up, left, right, down Moves the current view of the image as specified.
Minimum, maximum real, imaginary value Precisely controls what portion of the fractal shows. The zoom and pan controls are shortcuts for modifying these values.
Pixels horizontally, vertically Specifies how large the resulting image is in pixels.
Tiles horizontally, vertically Specifies how many tiles the image is split into for computation. One long-running job is submitted for each tile.
Maximum iterations A parameter of the Mandelbrot algorithm that controls the contrast of the computed image. You do not typically need to adjust this value.
Repeat count Specifies how often the computations repeat. By default, an iteration of the calculations for a tile takes approximately 0.1 seconds on an average machine. Increase this number to lengthen each job.
Reset values Resets the numeric values in the fields.
Restart computation Starts or restarts the specified computation. If any jobs are outstanding from the previous computation, then they are canceled.
Cancel computation Cancels any outstanding jobs.
User ID, password Supplies login credentials. The Mandelbrot application does not have any security constraints. However, the credentials are used to establish user identity for submitting and canceling jobs.

SimpleUtility.jar

Two simple native Java applications that calculate the factorial of a number and count for 60 seconds are contained in the SimpleUtility.jar file, which is located at <install_root>/longRunning.
  1. Test the Factorial application with the xJCL in <install_root>/longRunning/FactorialXJCL.xml. Before submitting the job, edit the file and supply a number by updating <arg line="60"/ >.
  2. Test the SimpleCounter application with the xJCL in <install_root>/longRunning/SimpleCounterXJCL.xml.