Sparse matrix formats have long been a problem for general purpose sparse packages. Effective sparse formats must not only be general enough to address a large class of application problems, but also must be well-designed to give high performance on the target architectures in question. For newer parallel architectures, the additional issues of portability across architectures as well as data distributions across processors also are raised.
Two approaches toward solving the problem of sparse matrix formats are adopted in PCG. First, a small number of formats are supplied which are nearly identical across architectures, give reasonably good performance on all platforms, and address the majority of user applications. Secondly, the alternate layers of access through the direct communication or reverse communication interface allow the user to access the PCG iterative solution methods with user-defined or vendor-specific formats or with sparse matrix data structures from other libraries.
The two critical classes of sparse matrix formats which are required in most applications are structured matrix formats and general unstructured formats. Structured matrices arise typically from discretizations of regular rectangular grids and give rise to matrices with diagonal structure. Such matrices are typically solved by high performance techniques, since issues such as indirect addressing and load balancing are avoided. On the other hand, a general purpose sparse format for general unstructured sparse matrices is required to address the wide range of matrices arising from unstructured problems.
The PCG package currently implements a Regular Stencil format which is effective for structured matrices arising from stencil-based discretizations. For this format, the user supplies the physical dimensions of the problem, the dimensions of the grid along each axis, the definition of the stencil to be used at each grid point, and the number of degrees of freedom at each point. For parallel machines, the subgrid sizes and the distribution of the subgrids to processors are also supplied. The user then specifies the matrix in terms of coefficients at each grid point. This simplified format not only addresses a large fraction of applications but also yields high performance and carries a natural block structure which is amenable to a wide range of preconditioners and domain decomposition methods.
A second matrix format for general unstructured problems is currently under development.