\section{Introduction}

  \subsection{What is Cactus}

{ %\usebackgroundtemplate{\includegraphics{viz1.png}}
    \frame { \frametitle{What is Cactus?}
      Cactus is
      \begin{itemize}[<+->]
       \item \textcolor{black}{a \hyperlink{framework}{framework} for developing portable, modular applications}
       \item \textcolor{black}{focusing, although not exclusively, on high-performance
             simulation codes}
       \item \textcolor{black}{designed to allow experts in different fields to develop
             modules based upon their experience and to use modules
             developed by experts in other fields with minimal knowledge
             of the internals or operation of the other modules}
      \end{itemize} }
}

    \frame { \frametitle{Cactus Goals}
      \begin{itemize}
        \item<1-> Portable
          \begin{itemize}
            \item Different development machines
            \item Different production machines
          \end{itemize}
        \item<2-> Modular
          \begin{itemize}
            \item Standard interfaces for module interaction for easier
                  code interaction, writing and debugging
            \item Interchangeable modules with same functionality
          \end{itemize}
        \item<3-> Easy to use
          \begin{itemize}
            \item Good documentation
            \item Try to let users program the way they are used to
            \item Support all major (HPC) programming languages
          \end {itemize}
      \end{itemize} }

    \frame { \frametitle{Philosophy}
     \begin{center}
      \begin{figure}[h]
       \includegraphics[width=30mm]{cactusphilo.png}
      \end{figure}
     \end{center}
      \begin{itemize}[<+->]
        \item Open code base to encourage community contributions
        \item Strict quality control for base framework
        \item Development always driven by real user requirements
        \item Support and develop for a wide range of application domains
      \end{itemize} }

    \frame { \frametitle{What is Cactus for?}
     Assume:
     \begin{itemize}
      \item Computational problem
      \item Too large for single machine
      \begin{itemize}
       \item<2-> \only<5->{\textcolor{cactusgreen}}{OpenMP}
       \item<2-> \only<5->{\textcolor{cactusgreen}}{MPI}
      \end{itemize}
      \item Distributed development
      \begin{itemize}
       \item<3-> \only<5->{\textcolor{cactusgreen}}{Modularize Problem}
       \item<3-> \only<5->{\textcolor{cactusgreen}}{Versioning system(s)}
      \end{itemize}
      \item Multiple programming languages
      \begin{itemize}
       \item<4-> \only<5->{\textcolor{cactusgreen}}{Modularize Problem}
       \item<4-> \only<5->{\textcolor{cactusgreen}}{Interfaces for inter-language communication}
      \end{itemize}
     \end{itemize}
    }

  \subsection{History and Current Usage}

% Copied from the web site.
\begin{frame} \frametitle{History}
 \begin{itemize} \justifying
  \item Cactus is a direct descendant of many years of code development in Ed
Seidel's group of researchers at the National Center for Supercomputing
Applications (NCSA) as the group wrestled to numerically solve Einstein's
Equations for General Relativity and thus model black holes, neutron stars, and
boson stars.
  \item In 1995, Ed Seidel and many of his group moved to the Max Planck
Institute for Gravitational Physics (Albert Einstein Institute or AEI) in
Potsdam, Germany. Frustrated by the difficulties of coordinating the
development and use of several different codes across a large collaborative
group, Paul Walker, Joan Massó, Ed Seidel, and John Shalf, designed and wrote
the original version of Cactus, Cactus 1.0, which provided a collaborative
parallel toolkit for numerical relativity.
 \end{itemize}
\end{frame}

\frame { \frametitle{Current Users and Developers}
  \centering
  \includegraphics[height=7cm]{groups_map}\\
}

\frame { \frametitle{Covers}
 \hspace{0cm}\includegraphics[height=3.5cm]{ACMCommunications}
 \hspace{1cm}\includegraphics[height=3.5cm]{FutureTechPhysCosm}
 \hspace{1cm}\includegraphics[height=3.5cm]{Gravity}\\\vspace{-1.5cm}
 \hspace{1cm}\includegraphics[height=3.5cm]{max-planck-research2}
 \hspace{1cm}\includegraphics[height=3.5cm]{nsffy2006budgetcover}
 \hspace{1cm}\includegraphics[height=3.5cm]{mmcover}\\\vspace{-1.5cm}
 \hspace{2cm}\includegraphics[height=3.5cm]{visprocessingtensor}
 \hspace{1.5cm}\includegraphics[height=3.5cm]{PetascaleComputingBook}
 \hspace{1cm}\includegraphics[height=3.5cm]{NR689}
}

\frame { \frametitle{Cactus Funding}
 \begin{itemize}
  \item Organizations:
  \begin{itemize}
   \item Max-Planck-Gesellschaft
   \item Center for Computation \& Technology at LSU
   \item National Center for Supercomputing Applications
   \item Lawrence Berkeley National Laboratory
   \item Washington University
   \item University of Tübingen 
  \end{itemize}
  \item Grants:
  \begin{itemize}
   \item NSF (PHY-9979985, 0540374, 0653303, 0701491, 0701566,
              PIF-0904015, 0903973, 0903782)
   \item Europ. Commission (HPRN-CT-2000-00137, IST-2001-32133)
   \item DFN-Verein (TK 6-2-AN 200) 
   \item DFG (TiKSL)
   \item ONR (COMI)
   \item DOE/BOR (OE DE-FG02-04ER46136, BOR DOE/LEQSF)
  \end{itemize}
 \end{itemize}
}

% Copied from web site
\begin{frame} \frametitle{Cactus Awards}
 \begin{tabular}{ll}
  IEEE SCALE09 Challenge Winner & 2009\\
  IEEE Sidney Fernback Award & 2006\\
  High-Performance Bandwidth Challenge & SC2002\\
  High-Performance Computing Challenge & SC2002\\
  Gordon Bell Prize for Supercomputing & SC2001\\
  HPC ``Most Stellar'' Challenge Award & SC1998\\
  Heinz Billing Prize for Scientific Computing & 1998
 \end{tabular}
\end{frame}

%\begin{frame}
% \tiny
% %\begin{columns}[t]
%  %\column{.5\textwidth}
% \begin{tabular}[ll]
%  \begin{figure} 
%   \includegraphics[width=30mm]{collapse-vel-x.png} 
%  \end{figure} 
%  &
%  A velocity component in a stellar core collapse. The x component of the fluid
%  velocity in a stellar core collapse. This simulation was performed by Christian
%  Ott. 
%  \\
%  \begin{figure} 
%   \includegraphics[width=30mm]{quadrupole.jpeg} 
%  \end{figure}
%  &
%  %\column{.5\textwidth}
%  A quadrupole wave. Two rotating scalar charges create a quadrupolar wave,
%  mimicking the gravitational wave trail of a binary black hole system. The small
%  bumps and riddles are artifacts caused by the discontinuous charge
%  distribution.  
%  \\
%  \begin{figure} 
%   \includegraphics[width=30mm]{matter-density.jpeg} 
%  \end{figure}
%  &
%  The fate of a proto-neutron-star bar-mode deformation. Matter density at z=0
%  during the transition from an m=2 deformed star to an m=1 deformed one. The
%  light on the right is used to emphasizes the spiral arms which are responsible
%  for a small mass loss. This simulation was performed by Gian Mario Manca. 
% \end{tabular}
% %\end{columns}
% \normalsize
%\end{frame}

  \subsection{Cactus Features}

\begin{frame} \frametitle{The Flesh}
 \begin{itemize}
  \item The \textbf{flesh} is the central component of Cactus. It interfaces
        with modular components called \textbf{thorns}. The flesh provides:
  \begin{columns}[t]
   \column{.6\textwidth}
  \begin{itemize}[<+->]
   \item Variables \& Data Types
   \item Parameters
   \item Functions for:
     \begin{itemize}[<+->]
     \item Parallelisation
     \item Input/Output 
     \item Coordinates
     \item Reduction 
     \item Interpolation
     \item Information
    \end{itemize}
   \item Staggering
    \begin{itemize}
     \item Indexing
     \item Ghostzones
    \end{itemize} 
  \end{itemize}

      \column{.3\textwidth}
       \begin{center}
        \begin{figure}[h]
         \includegraphics[width=40mm]{cactusflesh.png}
        \end{figure}
       \end{center}
      \end{columns}
    \end{itemize}
 \end{frame}

\begin{frame} \frametitle{Thorns}
 \begin{itemize}
  \item Some thorns provide additional functionality, while others serve as applications.
  \item Thorns are grouped into \textbf{arrangements} which supply some common functionality.
  \item Example thorns:
  \\ \vspace{12pt}
  \small
  \begin{tabular}{ll} 
   \textit{CactusIO}        & input and output operations\\
   \ \textbf{CactusIOJpeg}  & JPEG image data compression and writing operations\\
   \textit{CactusConnect}   & networking\\
   \ \textbf{HTTPD}         & starts the HTTP daemon for remote connections\\
   \textit{PUGH}            & unigrid driver + tools; reductions and interpolations\\
   \ \textbf{PUGH}          & unigrid driver handles grid scalars, arrays and functions\\
  \end{tabular}
 \end{itemize}
\end{frame}


 \subsection{Application Toolkits}

% Should put more here.
\begin{frame} \frametitle{Application Toolkits}
  \begin{columns}[t] 
  \column{.5\textwidth}
    \begin{center} 
      \begin{figure}
        \includegraphics[width=0.4\textwidth]{einstein.png} 
        \end{figure} 
      \end{center}
    
    \justifying The \textbf{Cactus Computational Toolkit} is a collection of
    arrangements that provides general computational infrastructure.

  \column{.5\textwidth}
    \justifying The \textbf{Einstein Toolkit} is a collection of arrangements for
    computational relativity. The toolkit includes a vacuum spacetime solver
    (McLachlan), a relativistic hydrodynamics solver, along with thorns for initial
    data, analysis and computational infrastructure.
    \begin{center} 
      \begin{figure}
        \includegraphics[width=20mm]{cactuslogo.png} 
        \end{figure} 
      \end{center}
    \end{columns}
\end{frame}

\frame { \frametitle{I/O Capabilities}
  Usual I/O and checkpointing in different formats:
  \begin{columns}[t]
   \column{.6\textwidth}
   \begin{itemize}[<+->]
     \item Screen output
     \item ASCII file output
     \item HDF5 file in-/output
     \item Online Jpeg rendering
     \item Online VisIt visualization
    \end{itemize}

    \column{.3\textwidth}
     \begin{center}
      \begin{figure}[h]
       \includegraphics[width=40mm]{viz.png}
      \end{figure}
     \end{center}
   \end{columns}
}

\frame { \frametitle{More Capabilities: Grids, Boundaries, Symmetries}
 \begin{columns}[t]
  \column{.5\textwidth}
  \begin{itemize}[<+->]
     \item Grids
       \begin{itemize}[<+->]
        \item Only structured meshes (at the moment)
        \item Unigrid (PUGH)
        \item Adaptive Mesh Refinement (Carpet)
      \end{itemize}
    \item Boundaries / Symmetries
      \begin{itemize}[<+->]
        \item Periodic
        \item Static
        \item Mirror symmetries
        \item Rotational symmetries
        \item Problemspecific boundaries
      \end{itemize}
  \end{itemize}

  \column{.4\textwidth}
   \begin{center}
    \begin{figure}[h]
     \includegraphics[width=45mm]{amr.png}
    \end{figure}
   \end{center}
  \end{columns}
}

\frame { \frametitle{The Cactus Computational Toolkit}
 \begin{columns}[t]
  \column{.3\textwidth}
    \begin{center}
      \begin{figure}
        \includegraphics[height=40mm]{potcact.png}
        \end{figure}
      \end{center}


  \column{.6\textwidth}
   Core modules (thorns) providing many basic utilities:
   \begin{itemize}[<+->]
     \item I/O methods
     \item Boundary conditions
     \item Parallel unigrid driver
     \item Reduction and Interpolation operators
     \item Interface to external elliptic solvers
     \item Web-based interaction and monitoring interface
     \item Simple example thorns (wavetoy)
  \end{itemize}
 \end{columns}
}

\frame { \frametitle{Many arrangements with many modules...}
  \begin{tabular}{ll}
    CactusBase& Basic utility and interface thorns\\
    CactusBench& Benchmark utility thorns\\
    CactusConnect& Network utility thorns\\
    CactusElliptic& Elliptic solvers / interface thorns\\
    CactusExamples& Example thorns\\
    CactusExternal& External library interface thorns\\
    CactusIO& General I/O thorns\\
    CactusNumerical& General numerical methods\\
    CactusPUGH& Cactus Unigrid Driver thorn\\
    CactusPUGHIO& I/O thorns specifix for PUGH driver\\
    CactusTest& Thorns for Cactus testing\\
    CactusUtils& Misc. utility thorns\\
    CactusWave& Wave example thorns\\
  \end{tabular}
}

%\begin{frame}
% \begin{columns}
%  \column{.5\textwidth}
%  \justifying The Einstein Toolkit currently consists of an open set of over 100
%Cactus thorns for computational relativity along with associated tools for
%simulation management and visualization. The toolkit includes a vacuum
%
%  \column{.5\textwidth}
%  \begin{center}
%   \includegraphics[width=40mm]{etk-black-holes}
%  \end{center}
% \end{columns}
%
%\vspace{6pt}
%\justifying spacetime solver (McLachlan), a relativistic hydrodynamics
%solver (formerly the public version of the Whisky code), along with thorns for
%initial data, analysis and computational infrastructure. These thorns have been
%developed and improved over many years by many different researchers.
%\end{frame}

 \subsection{Thorn Structure}

   \begin{frame} \frametitle{Cactus thorn structure}
     \begin{center}
       \includegraphics[height=7cm]{lifethorn}\\
     \end{center}
   \end{frame}

\begin{frame} \frametitle{Cactus Configuration Language Files}
 The interaction of a thorn with the Flesh and other thorns is controlled by certain 
 configuration files:
 \vspace{12pt}

 \begin{tabular}{ll}
  \tt{interface.ccl}  & defines the implementation (Section B2.3) the        \\
                      & thorn provides, and the variables the thorn needs,   \\
                      & along with their visibility to other implementations \\
  \tt{schedule.ccl}   & defines which functions are called from the thorn and\\
                      & when they are called; it also handles memory and     \\
                      & communication assignment for grid variables          \\ 
  \tt{param.ccl}      & defines the parameters that are used to control the  \\
                      & thorn, along with their visibility to other          \\
                      & implementations                                      \\
 \end{tabular}
 \vspace{12pt}

 These are called \emph{Cactus Configuration Language} files.
\end{frame}

\tiny
\begin{frame}[containsverbatim] \frametitle{param.ccl}
\verb|param.ccl|:
\begin{verbatim}:
# Parameter definitions for thorn HTTPD
# $Header$

shares: Cactus

# cctk variables used
USES REAL cctk_final_time    
USES REAL cctk_initial_time  
USES INT  cctk_itlast        # time of last iteration

private:

# sets the port number
INT port "HTTP port number to use"
{
    # ports 1-65535 are valid
    1:65535 :: "Any valid port"
} 5555
# 5555 is the default port

# if true, starts the simulation paused
BOOLEAN pause "Pause ?" STEERABLE = ALWAYS
{
} "no"
# do not start simulation paused by default

# username and password for controlling cactus
STRING user "The username for Cactus Control "
{
  # any non-empty string is valid
  ".+" :: "Any name of one or more characters"
} "anon"
# default username is 'anon'
\end{verbatim}
\end{frame}

\begin{frame}[containsverbatim] \frametitle{interface.ccl}
\verb|interface.ccl|:
\begin{verbatim}
# Interface definition for thorn HTTPD
# $Header$

# state what thorn is implemented
Implements: HTTPD
# inherit all the functions of Socket
Inherits: Socket

# name of the include header
USES INCLUDE HEADER: SocketUtils.h

INCLUDE HEADER: Auth.h in http_Auth.h
INCLUDE HEADER: Cookies.h in http_Cookies.h
INCLUDE HEADER: Steer.h in http_Steer.h
INCLUDE HEADER: Content.h in http_Content.h

CCTK_INT FUNCTION Send_Twitter_Msg(CCTK_STRING IN msg)
USES FUNCTION Send_Twitter_Msg
\end{verbatim}
\end{frame}

\begin{frame}[containsverbatim] \frametitle{schedule.ccl}
\verb|schedule.ccl|:
\begin{verbatim}
# Schedule definitions for thorn HTTPD
# $Header$

# perform these functions at startup
SCHEDULE GROUP HTTP_Startup AT startup
{
  OPTIONS: GLOBAL
} "HTTP daemon startup group"

SCHEDULE HTTP_StartServer in HTTP_Startup
{
  LANG: C
  OPTIONS: GLOBAL
} "Start HTTP server"

# during startup but after HTTP_SetupPages, do HTTP_FirstServ
SCHEDULE HTTP_FirstServ in HTTP_Startup AFTER HTTP_SetupPages
{
  LANG: C
  OPTIONS: GLOBAL
} "Serve first pages at startup"

# poststep is after startup and after every evolution step
# HTTP_Work at poststep but before IOUtil_UpdateParFile
SCHEDULE HTTP_Work AT poststep BEFORE IOUtil_UpdateParFile
{
  LANG: C
  OPTIONS: GLOBAL
} "Working routine"

if(provide_pages)
{
  SCHEDULE HTTP_ContentWork AT poststep
  {
    LANG: C
    OPTIONS: GLOBAL
  } "Content Working routine"
}

# at shutdown, do HTTP_Shutdown
SCHEDULE HTTP_Shutdown AT shutdown
{
  LANG: C
  OPTIONS: GLOBAL
} "HTTP daemon shutdown"
\end{verbatim}
\end{frame}
\normalsize

