Loading...
Searching...
No Matches
Sparse Direct Solver

This section gives an overview on the basic usage of the sparse solvers in STRUMPACK. Many STRUMPACK options can be set from the command line. Running with --help or -h, will give you a list of supported run-time options.

An example Makefile is available in the examples/ directory. This is a simple manual Makefile, with certain variables set during the CMake configure phase, see Installation and Requirements.

STRUMPACK is written in C++, and offers a simple C++ interface. See C Interface if you prefer a C interface. The STRUMPACK sparse solver has three different solver classes, all interaction happens through objects of these classes:

  • StrumpackSparseSolver<scalar,integer=int> This class represents the sparse solver for a single computational node, optionally using OpenMP parallelism. Use this if you are running the code sequentially, on a (multicore) laptop or desktop or on a single node of a larger cluster. This class is defined in StrumpackSparseSolver.hpp, so include this header if you intend to use it.
  • StrumpackSparseSolverMPIDist<scalar,integer=int> This solver is fully distributed. The numerical factorization and solve as well as the symbolic factorization are distributed. The input is now a block-row distributed sparse matrix and a correspondingly distributed right-hand side. For matrix reordering, ParMetis or PT-Scotch are used. Include the header file StrumpackSparseSolverMPIDist.hpp and call MPI_Init[_thread].

The three solver classes StrumpackSparseSolver, StrumpackSparseSolverMPI and StrumpackSparseSolverMPIDist depend on two template parameters <scalar,integer>: the type of a scalar and an integer type. The scalar type can be float, double, std::complex<float> or std::complex<double>. It is recommended to first try to simply use the default integer=int type, unless you run into 32 bit integer overflow problems. In that case one can switch to for instance int64_t (a signed integer type).