33#ifndef STRUMPACK_SPARSE_SOLVER_BASE_HPP
34#define STRUMPACK_SPARSE_SOLVER_BASE_HPP
41#include "StrumpackConfig.hpp"
77 template<
typename scalar_t,
typename integer_t=
int>
101 bool verbose=
true,
bool root=
true);
157 int components=1,
int width=1);
219 bool use_initial_guess=
false);
247 bool use_initial_guess=
false);
278 scalar_t* x,
int ldx,
279 bool use_initial_guess=
false);
370 ReturnCode subnormals(std::size_t& ns, std::size_t& nz);
382 void draw(
const std::string& name)
const;
393 virtual void setup_tree() = 0;
394 virtual void setup_reordering() = 0;
396 int compute_reordering(
const int* p,
int base,
397 int nx,
int ny,
int nz,
398 int components,
int width) = 0;
399 virtual void separator_reordering() = 0;
402 virtual Reord_t* reordering() = 0;
403 virtual Tree_t* tree() = 0;
404 virtual const SpMat_t* matrix()
const = 0;
405 virtual const Reord_t* reordering()
const = 0;
406 virtual const Tree_t* tree()
const = 0;
408 virtual void perf_counters_start();
409 virtual void perf_counters_stop(
const std::string& s);
411 virtual void synchronize() {}
412 virtual void communicate_ordering() {}
413 virtual double max_peak_memory()
const
414 {
return double(params::peak_memory); }
415 virtual double min_peak_memory()
const
416 {
return double(params::peak_memory); }
418 void papi_initialize();
419 long long dense_factor_nonzeros()
const;
420 void print_solve_stats(TaskTimer& t)
const;
422 virtual void reduce_flop_counters()
const {}
423 void print_flop_breakdown_HSS()
const;
424 void print_flop_breakdown_HODLR()
const;
425 void flop_breakdown_reset()
const;
427 void print_wrong_sparsity_error();
431 ReturnCode solve_internal(
const scalar_t* b, scalar_t* x,
432 bool use_initial_guess=
false) = 0;
434 ReturnCode solve_internal(
const DenseM_t& b, DenseM_t& x,
435 bool use_initial_guess=
false) = 0;
437 ReturnCode solve_internal(
int nrhs,
const scalar_t* b,
int ldb,
438 scalar_t* x,
int ldx,
439 bool use_initial_guess=
false);
441 SPOptions<scalar_t> opts_;
444 MatchingData<scalar_t,integer_t> matching_;
445 Equilibration<scalar_t> equil_;
447 std::new_handler old_handler_;
448 std::ostream* rank_out_ =
nullptr;
449 bool factored_ =
false;
450 bool reordered_ =
false;
453#if defined(STRUMPACK_USE_PAPI)
454 float rtime_ = 0., ptime_ = 0.;
455 long_long _flpops = 0;
457#if defined(STRUMPACK_COUNT_FLOPS)
458 long long int f0_ = 0, ftot_ = 0, fmin_ = 0, fmax_ = 0;
459 long long int b0_ = 0, btot_ = 0, bmin_ = 0, bmax_ = 0;
460 long long int m0_ = 0, mtot_ = 0, mmin_ = 0, mmax_ = 0;
461 long long int ptot_ = 0, pmin_ = 0, pmax_ = 0;
462 long long int dm0_ = 0, dmtot_ = 0, dmmin_ = 0, dmmax_ = 0;
463 long long int dptot_ = 0, dpmin_ = 0, dpmax_ = 0;
467 ReturnCode reorder_internal(
const int* p,
int base,
468 int nx,
int ny,
int nz,
469 int components,
int width);
471 virtual void delete_factors_internal() = 0;
474 template<
typename scalar_t,
typename integer_t>
475 using StrumpackSparseSolverBase =
476 SparseSolverBase<scalar_t,integer_t>;
Contains the compressed sparse row matrix storage class.
Contains the DenseMatrix and DenseMatrixWrapper classes, simple wrappers around BLAS/LAPACK style den...
Holds options for the sparse solver.
Abstract base class for compressed sparse matrix storage.
Definition CompressedSparseMatrix.hpp:149
Like DenseMatrix, this class represents a matrix, stored in column major format, to allow direct use ...
Definition DenseMatrix.hpp:1018
This class represents a matrix, stored in column major format, to allow direct use of BLAS/LAPACK rou...
Definition DenseMatrix.hpp:139
Definition SparseSolverBase.hpp:53
Definition SparseSolverBase.hpp:52
Options for the sparse solver.
Definition StrumpackOptions.hpp:217
SparseSolverBase is the virtual base for both the sequential/multithreaded and distributed sparse sol...
Definition SparseSolverBase.hpp:78
int Krylov_iterations() const
virtual ~SparseSolverBase()
ReturnCode solve(int nrhs, const scalar_t *b, int ldb, scalar_t *x, int ldx, bool use_initial_guess=false)
SparseSolverBase(int argc, char *argv[], bool verbose=true, bool root=true)
void set_from_options(int argc, char *argv[])
const SPOptions< scalar_t > & options() const
ReturnCode solve(const DenseM_t &b, DenseM_t &x, bool use_initial_guess=false)
ReturnCode inertia(integer_t &neg, integer_t &zero, integer_t &pos)
ReturnCode solve(const scalar_t *b, scalar_t *x, bool use_initial_guess=false)
std::size_t factor_nonzeros() const
std::size_t factor_memory() const
void draw(const std::string &name) const
SPOptions< scalar_t > & options()
SparseSolverBase(bool verbose=true, bool root=true)
ReturnCode reorder(int nx=1, int ny=1, int nz=1, int components=1, int width=1)
ReturnCode reorder(const int *p, int base=0)
Definition StrumpackOptions.hpp:44
ReturnCode
Enumeration for the possible return codes.
Definition StrumpackParameters.hpp:50