\section{Parallel Adaptive Grid Simulations}
\label{sec:PAGS}

In this section we provide an overview of the PAGS framework.
We begin by describing how the major components of the framework
inter-operate.
We then provide additional details describing the semantics and interfaces
of those components.
In defining this framework, we are faced with a tension between
ease of use and efficiency of implementations.
Our strategy to address these concerns has been:
\begin{itemize}
\item to provide developers with an interface that provides the
illusion of sequential behavior.
\item to expose implementation details that are performance critical
to the developer
\end{itemize}
In doing this, we are able to hide significant complexity
from the developer while allowing them the ability to hand-tune
their application for good performance.
Thus, PAGS can be viewed as an open implementation \cite{kiczales:96}
that provides a simulation problem interface
and a performance tuning interface.

\subsection*{Architecture}
\begin{figure*}
\epsfxsize=2.0in
\epsfverbosetrue
\centerline{\epsffile{pags-arch.eps}}
\caption{PAGS Architecture}
\label{fig:pags-arch}
\end{figure*}
Figure \ref{fig:pags-arch} depicts the major components of the PAGS
framework built on top of a Java infra-structure.  PAGS is designed
to be configurable to take advantage of shared-memory, distributed-memory
or mixed-memory execution platforms.  In distributed and mixed-memory configurations
an instance of the Java virtual machine will be active on each host.

The replicated workers coordination abstraction (RWCA) implements a reusable
pattern of parallel execution.  
The abstraction provides thread/process management, synchronization, 
communication and termination capabilities
in a way that is independent of application data and computation.
Applications parameterize the RWCA
with data and computational elements to define complete parallel computations.
An additional parameter allows users to control the semantics of the
work pool.
When instantiating a coordination abstraction application developers
may choose to configure the degree of parallelism, granularity and 
parallel execution model to be used.  Parallelism is controlled by
specifying the maximum number of worker threads/processes that may
execute.  Granularity is controlled by allowing for block-transfers
of multiple data elements to/from workers.  Finally, the execution
model for the computation may be either shared-memory or distributed-memory.
The coordination abstraction is defined to allow for composition
of instances, thus we can have a mixed-model computation where
a higher-level distributed-memory abstraction dispatches work data
to its workers who are themselves shared-memory abstractions.

The associative workpool (AW) is an abstract data structure that is compliant
with the coordination abstractions pool interface requirements.
The AW is designed to manage dependences between sub-problems in
a computation.  It provides a framework within which problem convergence,
inter-region data flow, and discrete simulation time are all managed.
Applications parameterize the AW with initial sub-problem values
and a description of the dependence structure of the sub-problems.
These dependences can represent data, control, causal or time related
constraints depending on the nature of the simulation.
The AW makes minimal constraints on the problem dependence structure,
it need only be defined as a collection of sub-problem relations.
One can think of the AW as a parameterizable scheduler, once a sub-problem
is determined to be ready it can be dispatched through the
RWCA to have its computation performed.

Our philosophy in defining the PAGS framework is to provide support
for functionality that is required in a broad class of parallel discrete-time
simulations.  There is no doubt that special variants of PAGS could
be defined to provide effective support for specific simulation domains.


