From PETSc Users Manual

PETSc 2.0 Users Manual

PETSc 2.0 Users Manual

Satish Balay
William Gropp
Lois Curfman McInnes
Barry Smith

Mathematics and Computer Science Division
Argonne National Laboratory

Abstract:

This manual describes the use of PETSc 2.0 for the numerical solution of partial differential equations and related problems on high-performance computers. The Portable, Extensible Toolkit for Scientific Computation (PETSc) is a suite of data structures and routines that provide the building blocks for the implementation of large-scale application codes on parallel (and serial) computers. PETSc 2.0 uses the MPI standard for all message-passing communication.

PETSc includes an expanding suite of parallel linear and nonlinear equation solvers that may be used in application codes written in Fortran, C, and C++. PETSc provides many of the mechanisms needed within parallel application codes, such as simple parallel matrix and vector assembly routines that allow the overlap of communication and computation. In addition, PETSc includes growing support for distributed arrays. The library is organized hierarchically, enabling users to employ the level of abstraction that is most appropriate for a particular problem. By using techniques of object oriented programming, PETSc provides enormous flexibility for users.

PETSc is a sophisticated set of software tools; as such, for some users it initially has a much steeper learning curve than a simple subroutine library. In particular, for individuals without some computer science background or experience programming in C, Pascal, or C++, it may require a large amount of time to take full advantage of the features that enable efficient software use. However, the power of the PETSc design and the algorithms it incorporates make the efficient implementation of many application codes much simpler than ``rolling them'' yourself. For many simple (or even relatively complicated) tasks a package such as Matlab is often the best tool; PETSc is not intended for the classes of problems for which effective Matlab code can be written.

Since PETSc is still under development, small changes in usage and calling sequences of PETSc routines will continue to occur. Although keeping one's code up to date can be somewhat annoying, all PETSc users will be rewarded in the long run with a cleaner, better designed, and easier-to-use interface.

Acknowledgments:

We thank Victor Eijkhout for his valuable comments on this manual as well as on the source code for PETSc 2.0. We also thank David Keyes for his insightful suggestions about increased functionality. In addition, we thank all our users of PETSc for their suggestions, bug reports, support, and encouragement.

Some of the source code and utility routines in PETSc have been written by Cameron Cooper, Matt Hille, Peter Mell, and Wing-Lok Wan while visiting Argonne National Laboratory as summer research students.

PETSc uses routines from BLAS, LAPACK, SPARSPAK, and BlockSolve95 to provide a small subset of its low-level functionality.

The Portable, Extensible Toolkit for Scientific Computation (PETSc) has successfully demonstrated that the use of modern programming paradigms can ease the development of large-scale scientific application codes in Fortran, C, and C++. Begun several years ago, the software has evolved into a powerful set of tools for the numerical solution of partial differential equations and related problems on high-performance computers.

PETSc consists of a variety of components (similar to classes in C++), which are discussed in detail in Parts II and III of the users manual. Each component manipulates a particular family of objects (for instance, vectors) and the operations one would like to perform on the objects. The objects and operations in PETSc are derived from our long experiences with scientific computation. Some of the PETSc modules deal with


Each of these components consists of an abstract interface (simply a set of calling sequences) and one or more implementations using particular data structures. Thus, PETSc provides clean and effective codes for the various phases of solving PDEs, with a uniform approach for each class of problems. This design enables easy comparison and use of different algorithms (for example, to experiment with different Krylov subspace methods, preconditioners, or truncated Newton methods). Hence, PETSc provides a rich environment for modeling scientific applications as well as for rapid algorithm design and prototyping.

The components enable easy customization and extension of both algorithms and implementations. This approach promotes code reuse and flexibility, and separates the issues of parallelism from the choice of algorithms. In addition, the PETSc infrastructure creates a foundation for building large-scale applications and extended suites of numerical routines.