

\documentstyle{article}

\input{psfig} 

\begin{document}

\sloppy

\pagestyle{plain}

\title{``HPJava'': Demo Description}

\author{Bryan Carpenter, Yuh-Jye Chang}

\maketitle

The Web server for the demo runs on a processor from a cluster
of high performance workstations located at NPAC.  Various other hosts
in this cluster run daemons that support remote execution of the Java
class files for the demos.

When the demo starts, a menu of available hosts is presented.  A subset
of these hosts can be selected and added to the set subsequently used
for running the examples.
\begin{figure}[bt]
\centerline{\psfig{figure=procsmenu.eps,height=3in}}
\caption{\label{procsmenu}Menu for selecting processors.}
\end{figure}

\section{Conway's Game of Life}

``Life'' is a familiar {\em cellular automaton}, in which cells on a
two-dimensional board are updated according to the current state of
their eight neighbours.  It provides a simple illustration of the the
archetypal nearest-neighbour update, which recurs in various numerical
simulations, and lends itself well to parallel computation.

The Java implementation uses an experimental version of a class
library intended to facilitate {\em data-parallel} computations on
regular arrays.  Characteristics of this approach, similar to
{\em High Performance Fortran}, include
\begin{itemize}
\item
The distribution format of the arrays can be changed just by
altering a few parameters at the start of the program---the main
program is insensitive to these details
\item
low level message-passing (in the Java case, through Internet sockets)
is abstracted into high-level collective operations on distributed
array structures.
\end{itemize}

Clicking on the ``Life'' button brings up a menu of parameters which
can be changed.  These include the size of the grid (``board''), the
number of iterations, and the frequency with which the state of the
board is displayed.  Displaying the board generally takes much longer
than updating it:  for benchmarking purposes the display should happen
infrequently (for demonstration purposes, frequently).  The options also
allow changing the {\em distribution format} of the board---the way the
board is split between processors.  Like HPF, block or cyclic
distributions are allowed.
\begin{figure}[btp]
\centerline{\psfig{figure=lifeset.eps,height=2.5in}
\hspace{0.25in}
\psfig{figure=liferun.eps,height=2.5in}}
\caption{\label{procsmenu}Screens of the ``Life'' demo.}
\end{figure}

Clicking on the ``Begin'' button causes the simulation to start.  The
initial state of the board is currently a fixed ``cross'' of
live cells.  This will evolve into more interesting patterns as the
simulation proceeeds.  The processor ``owning'' a portion of the board
is coded through the colour of the cells, providing a clear
visualization of the various distribution formats.

The processor set can be changed by clicking the ``Proc'' button.
The parameters or distribution format can be changed by clicking
the ``Life'' button again.

\section{2D FFT ``Image Compression''}

This demo is a Java port of one of the HPFA ({\em High Performance
Fortran Applications}) kernels.  As explained in the description
of the original code:
\begin{quote}
The Fast Fourier Transform (FFT) is the most widely known example
of the Spectral method for computational problems. In all such
methods, one performs a linear transformation of the stated
problem into another physical domain where it is hoped will be
more tractable. In Fourier transformations, the mapping is from
the time-domain to the frequency-domain. The FFT is widely used in
the field of image processing, where one commonly describe an
image in terms of intensity values in a two-dimensional matrix.
The codes contained here performs a two-dimensional FFT over an
example matrix in the following manner:
\begin{enumerate}
\item
Set up the input 2-D matrix. 
\item
Perform FFT across the leading dimension of the matrix. 
\item
Transpose the matrix, using an F90/HPF intrinsic function.
\item
Perform FFT again, across the leading dimension. 
\end{enumerate}
\end{quote}
In our case ``transpose'' is a new operation in the class library, on a
par with the ``shift'' operation used in nearest neighbour updates.  As
explained above, sequential FFTs are performed on all columns of the
image data in parallel, then on all rows of the image in parallel.  The
transpose operation sits between these two phases.

After selecting the set of processors click on the ``FFT'' button.
In the demo the image data is a photograph of a wolf.  One of several
image files (of different resolution) can be selected.  In order of
increasing size, the options presently are
\begin{verbatim}
  wolf_4.pgm
  wolf_2.pgm
  wolf.pgm
\end{verbatim}
The mask width defines the size of a square centered in the
Fourier space representation of the picture.  You can choose to delete
modes inside or outside this boundary.  On clicking the ``Begin''
button, the original image is displayed then the FFT is performed.  The
result of the Fourier transform is also displayed as an image, mapping
Fourier components into pixels.  According to the masking selection,
some of the components will be deleted.  Finally the FFT is reversed,
and the modified (``uncompressed'') version of the original image is
displayed.

Once again the processor ``owning'' a particular pixel or Fourier
component is coded through the colour of the cells.
\begin{figure}[btp]
\centerline{\psfig{figure=fftset.eps,height=2.5in}
\hspace{0.25in}
\psfig{figure=fftrun.eps,height=2.5in}}
\caption{\label{procsmenu}Screens of the ``FFT'' demo.}
\end{figure}

\end{document}

