next up previous contents
Next: 5.2 Program Structure Up: 5. Implementation Previous: 5. Implementation   Contents


5.1 Required Libraries

The basic structure of the PETSc package is outlined in Fig. 5.1. It is built on well established standards for scientific computation: The BLAS libraries for basic linear algebra operations [59], LAPACK for higher level linear algebra functions [60], LINPACK for dense matrix factorization [61], and MPI for interprocess communication [62,63], to name the most important ones. For all these libraries there are highly optimized implementations for all major hardware platforms available, which ensures easy portability and maximum performance.

Figure 5.1: Structure of the PETSc library.
\includegraphics[scale=1]{fig/talk/fig/prgstruct_petsc.eps}

On top of these ``building blocks'' PETSc implements commonly used data structures like vectors and matrices, the latter in various formats for dense, sparse, and block diagonal types for serial or parallel programs. These data structures are then used by the different numerical solvers for linear and nonlinear systems and ODEs to carry out the calculations with the underlying libraries. Even though PETSc is implemented in plain ANSI C it uses many object oriented techniques like data encapsulation and polymorphism, which makes it very flexible and efficient. Moreover, it provides a number of utility functions, which simplify the implementation of the application around the numerical problem: There are routines for the handling of program parameters and configuration files, data i/o and graphics output, profiling and logging, debugging and memory allocation tracking.

In addition, PETSc has interfaces to several other software packages. The `Toolkit for Advanced Optimization'' (TAO) [46] is one of them, and it is used for the static energy minimization in the micromagnetics application (in fact TAO itself is built on PETSc). There are also interfaces to ParMetis for parallel graph partitioning and PVODE [48] the parallel ODE integrator. For reasons to be explained later these built-in interfaces have not been used, but still the integration into PETSc is straight forward.

Figure 5.2: Structure of additional libraries.
\includegraphics[scale=1]{fig/talk/fig/prgstruct_rest.eps}

TAO is among a number of other libraries, which are used by the micromagnetics application (Fig. 5.2). The Metis library is used for mesh partitioning [64], PVODE for the time integration of the LLG equation [48], zlib for compressed data output [65], and libpng for the direct output of graphics files in PNG format [66].

A complete list of all required packages, short descriptions, references, and URLs can be found in App. B.


next up previous contents
Next: 5.2 Program Structure Up: 5. Implementation Previous: 5. Implementation   Contents
Werner Scholz 2003-06-08