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).


strumpack::KrylovSolver::PREC_GMRES
@ PREC_GMRES
strumpack::ReorderingStrategy::NATURAL
@ NATURAL
strumpack::StrumpackSparseSolverMPIDist::set_distributed_csr_matrix
void set_distributed_csr_matrix(integer_t local_rows, const integer_t *row_ptr, const integer_t *col_ind, const scalar_t *values, const integer_t *dist, bool symmetric_pattern=false)
strumpack::KrylovSolver::GMRES
@ GMRES
strumpack::StrumpackSparseSolver
StrumpackSparseSolver is the main sequential or multithreaded sparse solver class.
Definition: StrumpackSparseSolver.hpp:74
strumpack::SPOptions::reordering_method
ReorderingStrategy reordering_method() const
Definition: StrumpackOptions.hpp:727
strumpack::MatchingJob::MAX_SMALLEST_DIAGONAL_2
@ MAX_SMALLEST_DIAGONAL_2
strumpack::Trans::N
@ N
strumpack::KrylovSolver::AUTO
@ AUTO
strumpack::ReorderingStrategy::PTSCOTCH
@ PTSCOTCH
strumpack::MatchingJob::MAX_DIAGONAL_SUM
@ MAX_DIAGONAL_SUM
strumpack::KrylovSolver::DIRECT
@ DIRECT
strumpack::MatchingJob::MAX_DIAGONAL_PRODUCT_SCALING
@ MAX_DIAGONAL_PRODUCT_SCALING
strumpack
Definition: StrumpackOptions.hpp:42
strumpack::StrumpackSparseSolverBase< scalar_t, int >::solve
ReturnCode solve(const scalar_t *b, scalar_t *x, bool use_initial_guess=false)
strumpack::MatchingJob::COMBBLAS
@ COMBBLAS
strumpack::MatchingJob::MAX_CARDINALITY
@ MAX_CARDINALITY
strumpack::StrumpackSparseSolverBase< scalar_t, int >::reorder
ReturnCode reorder(int nx=1, int ny=1, int nz=1, int components=1, int width=1)
strumpack::KrylovSolver
KrylovSolver
Definition: StrumpackOptions.hpp:141
strumpack::SPOptions
Options for the sparse solver.
Definition: StrumpackOptions.hpp:192
strumpack::SPOptions::set_reordering_method
void set_reordering_method(ReorderingStrategy m)
Definition: StrumpackOptions.hpp:299
strumpack::SPOptions::set_Krylov_solver
void set_Krylov_solver(KrylovSolver s)
Definition: StrumpackOptions.hpp:271
StrumpackSparseSolver.hpp
Contains the definition of the sequential/multithreaded sparse solver class.
strumpack::StrumpackSparseSolverMPIDist
This is the fully distributed solver.
Definition: StrumpackSparseSolverMPIDist.hpp:71
strumpack::StrumpackSparseSolverBase< scalar_t, int >::factor
ReturnCode factor()
strumpack::KrylovSolver::PREC_BICGSTAB
@ PREC_BICGSTAB
strumpack::ReorderingStrategy::RCM
@ RCM
strumpack::SPOptions::set_matching
void set_matching(MatchingJob job)
Definition: StrumpackOptions.hpp:491
strumpack::ReturnCode
ReturnCode
Enumeration for the possible return codes.
Definition: StrumpackParameters.hpp:60
strumpack::MatchingJob::MAX_SMALLEST_DIAGONAL
@ MAX_SMALLEST_DIAGONAL
strumpack::StrumpackSparseSolverBase< scalar_t, int >::options
SPOptions< scalar_t > & options()
strumpack::SPOptions::gpu_streams
int gpu_streams() const
Definition: StrumpackOptions.hpp:958
strumpack::ReorderingStrategy::METIS
@ METIS
strumpack::CompressionType::HSS
@ HSS
strumpack::SPOptions::disable_gpu
void disable_gpu()
Definition: StrumpackOptions.hpp:663
strumpack::SPOptions::set_gpu_streams
void set_gpu_streams(int s)
Definition: StrumpackOptions.hpp:668
strumpack::ReorderingStrategy::PARMETIS
@ PARMETIS
strumpack::StrumpackSparseSolver::set_csr_matrix
void set_csr_matrix(integer_t N, const integer_t *row_ptr, const integer_t *col_ind, const scalar_t *values, bool symmetric_pattern=false)
strumpack::ReorderingStrategy::SCOTCH
@ SCOTCH
strumpack::SPOptions::enable_gpu
void enable_gpu()
Definition: StrumpackOptions.hpp:658
strumpack::ReorderingStrategy::GEOMETRIC
@ GEOMETRIC
strumpack::KrylovSolver::BICGSTAB
@ BICGSTAB
strumpack::SPOptions::matching
MatchingJob matching() const
Definition: StrumpackOptions.hpp:795
strumpack::KrylovSolver::REFINE
@ REFINE
strumpack::ReorderingStrategy
ReorderingStrategy
Definition: StrumpackOptions.hpp:48
strumpack::CompressionType::NONE
@ NONE
strumpack::MatchingJob
MatchingJob
Definition: StrumpackOptions.hpp:95