next up previous contents
Next: Evaluation Up: Applications and Performance Previous: Evaluation   Contents


HPJava with GUI

In this section we will illustrate how our HPJava can be used with a Java graphical user interface. The Java multithreaded implementation of mpjdev makes it possible for HPJava to cooperate with Java AWT. We ported the mpjdev layer to communicate between the threads of a single Java Virtual Machine (see section 5.5.2). The threads cooperate in solving a problem by communicating through our communication library, Adlib, with pure Java version of the mpjdev. In this version of the implementation we followed the mpjdev buffer specification which is described in Chapter 5. By adding pure Java version of the mpjdev to the Adlib communication library, it gives us the possibility to use the Java AWT and other Java graphical packages to support a GUI and visualize graphical output of the parallel application. Visualization of the collected data is a critical element in providing developers or educators with the needed insight into the system under study.

Figure 6.11: A 2 dimensional inviscid flow simulation.
\begin{figure}\centering\epsfig{file=Figs/CFDdemo.eps, height=3.5in}\end{figure}
For test and demonstration of multithreaded version of mpjdev, we implemented computational fluid dynamics (CFD) code using HPJava which simulates 2 dimensional inviscid flow through an axisymmetric nozzle(Figure 6.11). The simulation yields contour plots of all flow variables, including velocity components, pressure, Mach number, density and entropy, and temperature. The plots show the location of any shock wave that would reside in the nozzle. Also, the code finds the steady state solution to the 2 dimensional Euler equations, seen below.

$\displaystyle \frac{\partial U}{\partial t} + \frac{\partial E}{\partial x} + \frac{\partial F}{\partial y} = \alpha H$ (6)

Here $ U = \left( \begin{array}{c} \rho \\ \rho u \\ \rho v \\ e_{t}
\end{array}\right)$, $ E = \left( \begin{array}{c} \rho u\\ \rho u^2 + p \\ \rho uv \\ (e_{t} + p)u
\end{array}\right)$, and $ F = \left( \begin{array}{c} \rho v\\ \rho uv \\ \rho v^2 + p \\ (e_{t} + p)v
\end{array}\right)$.

The source vector $ H$ is zero for this case.

The demo consists of 4 independent Java applets communicating through the Adlib communication library which is layered on top of mpjdev. Applet 1 is handling all events and broadcasting control variables to other applets. Each applet has the responsibility to draw its own portion of the data set into the screen, as we can see in the figure. That this demo also illustrates usage of Java object in our communication library. We are using writeHalo() method to communicate Java class object between threads.

This unusual interpretation of parallel computing, in which several applets in a single Web browser cooperate on a scientific computation, is for demonstration purpose only. The HPJava simulation code can also be run on a collection of virtual machines distributed across heterogeneous platforms like the native MPI of MPICH, SunHPC-MPI, and IBM POE (see next section).

You can view this demonstration and source code at

  http://www.hpjava.org/demo.html



Subsections
next up previous contents
Next: Evaluation Up: Applications and Performance Previous: Evaluation   Contents
Bryan Carpenter 2004-06-09