BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
belfem::solver::MUMPS Class Reference

#include <cl_SolverMUMPS.hpp>

Inheritance diagram for belfem::solver::MUMPS:
[legend]
Collaboration diagram for belfem::solver::MUMPS:
[legend]

Public Member Functions

 MUMPS (const SolverParameters *aParams, const proc_t aMasterRank=0)
 ~MUMPS () override
bool supports_factorization_reuse () const override
void freeze_factorization (const SpMatrix &aMatrix) override
 arm the frozen state: subsequent solves reuse the factorization that the LAST SUCCESSFUL solve built, instead of rebuilding it.
void unfreeze_factorization () override
 drop the frozen state and return to ordinary re-factorizing solves.
bool factorization_is_frozen () const override
 true while the frozen scope is armed
void solve (SpMatrix &aMatrix, Vector< real > &aLHS, Vector< real > &aRHS) override
void solve (SpMatrix &aMatrix, Matrix< real > &aLHS, Matrix< real > &aRHS) override
void free () override
void set_reordering (const MumpsSerialReodrdering aSerial, const MumpsParallelReodrdering aParallel)
void set_block_low_ranking (const MumpsBlockLowRanking aBLK, const real aEpsilon)
void set_error_analysis (const MumpsErrorAnalysis aSetting)
real get_determinant () const override
 returns the determinant, if supported by the solver and computation was requested
real get_cond1 () const override
 returns the conditioning number, if supported by the solver and computation was requested
real get_cond2 () const override
 returns the conditioning number, if supported by the solver and computation was requested
real get_forward_error () const override
 RINFOG( 9 ): estimated forward error of the last solve.
real get_backward_error () const override
 RINFOG( 7 ) + RINFOG( 8 ): the componentwise backward error.
real get_omega2 () const override
 RINFOG( 8 ) alone: omega2.
Public Member Functions inherited from belfem::solver::Wrapper
 Wrapper (const string &aLabel, const bool aUsesMPI)
virtual ~Wrapper ()
const stringlabel () const
 returns the name of the solver as string
void set_soft_fail (const bool aFlag)
 arm/disarm the soft-fail contract ( see the member note )
bool failed () const
 true if the last factorization/solve failed softly
void clear_failure ()
 clear a recorded soft failure before the next solve
bool is_initialized () const
 tells if the initialitzation routine has already been called
proc_t rank () const
 returns the communication rank of this proc
proc_t comm_size () const
 returns the communication size of this proc
bool uses_mpi () const
void free () override
Public Member Functions inherited from belfem::CommunicationObject
 CommunicationObject ()
 ~CommunicationObject ()
index_t index () const

Protected Member Functions

void initialize (SpMatrix &aMatrix, const SymmetryMode aSymmetryMode=SymmetryMode::Unsymmetric, const int_t aNumRhsColumns=1) override
string error_message (const int_t *aInfo, const int_t &aN, const int_t &aNNZ)
void warning_message (const int_t *aInfo, Cell< string > &aWarnings)
Protected Member Functions inherited from belfem::solver::Wrapper
bool soft_fail () const
 subclass hooks for the soft-fail contract
void flag_failure ()
virtual void initialize ()
void hatch_turtle ()
 print a warning ( the turtle ) when the MPI ranks sharing a node ask for more OpenMP threads than the node has PHYSICAL cores.
void mat2vec (const Matrix< real > &aM, Vector< real > &aV)
void vec2mat (const Vector< real > &aV, Matrix< real > &aM)
SpMatrixmatrix ()
Vector< real > & x ()
Vector< real > & y ()

Additional Inherited Members

Protected Attributes inherited from belfem::solver::Wrapper
SpMatrixmMatrix = nullptr
Vector< real > * mX = nullptr
Vector< real > * mY = nullptr

Constructor & Destructor Documentation

◆ MUMPS()

belfem::solver::MUMPS::MUMPS ( const SolverParameters * aParams,
const proc_t aMasterRank = 0 )

◆ ~MUMPS()

belfem::solver::MUMPS::~MUMPS ( )
override

Member Function Documentation

◆ error_message()

string belfem::solver::MUMPS::error_message ( const int_t * aInfo,
const int_t & aN,
const int_t & aNNZ )
protected

◆ factorization_is_frozen()

bool belfem::solver::MUMPS::factorization_is_frozen ( ) const
overridevirtual

true while the frozen scope is armed

Reimplemented from belfem::solver::Wrapper.

◆ free()

void belfem::solver::MUMPS::free ( )
overridevirtual

Reimplemented from belfem::CommunicationObject.

◆ freeze_factorization()

void belfem::solver::MUMPS::freeze_factorization ( const SpMatrix & aMatrix)
overridevirtual

arm the frozen state: subsequent solves reuse the factorization that the LAST SUCCESSFUL solve built, instead of rebuilding it.

This is a scope, not a hint, and the caller owns the whole of it:

solve( A, x, b ) <- builds the factorization freeze_factorization( A ) <- arm, only after that succeeded solve( A, y, c ) ... <- reuse, values of A must NOT change unfreeze_factorization() <- always, including on every failure

Why a scope rather than a flag: if the values of A change while frozen, the solver returns a valid-LOOKING solution of the wrong matrix, with no error anywhere. Pointer identity cannot detect that – the wrapper already treats the same pointer as "same structure, different values" and deliberately re-factorizes for exactly this reason. So the contract is that NO assembly may happen inside the scope, the caller guarantees it, and the wrapper checks everything about the matrix it cheaply can ( structure and identity, not an O( nnz ) values scan on every solve ).

Checks are ALWAYS-ACTIVE errors rather than assertions: a silent stale-factor solve is precisely the failure that must not survive into a release build.

Rank behaviour: only the rank that owns the matrix can record its identity – on every other rank the matrix argument is a local submatrix or empty, and the distributed solvers never read it. So a worker records only that it is frozen. Uniformity comes from the caller arming and dropping the scope at the same point of the same code path on every rank, never from a rank-local decision.

The default implementation throws: a wrapper that does not support reuse must be asked via supports_factorization_reuse() first

Reimplemented from belfem::solver::Wrapper.

◆ get_backward_error()

real belfem::solver::MUMPS::get_backward_error ( ) const
overridevirtual

RINFOG( 7 ) + RINFOG( 8 ): the componentwise backward error.

MUMPS reports it in two halves, split by whether a row's denominator is trustworthy, and they sum

Reimplemented from belfem::solver::Wrapper.

◆ get_cond1()

real belfem::solver::MUMPS::get_cond1 ( ) const
overridevirtual

returns the conditioning number, if supported by the solver and computation was requested

Reimplemented from belfem::solver::Wrapper.

◆ get_cond2()

real belfem::solver::MUMPS::get_cond2 ( ) const
overridevirtual

returns the conditioning number, if supported by the solver and computation was requested

Reimplemented from belfem::solver::Wrapper.

◆ get_determinant()

real belfem::solver::MUMPS::get_determinant ( ) const
overridevirtual

returns the determinant, if supported by the solver and computation was requested

Reimplemented from belfem::solver::Wrapper.

◆ get_forward_error()

real belfem::solver::MUMPS::get_forward_error ( ) const
overridevirtual

RINFOG( 9 ): estimated forward error of the last solve.

Reimplemented from belfem::solver::Wrapper.

◆ get_omega2()

real belfem::solver::MUMPS::get_omega2 ( ) const
overridevirtual

RINFOG( 8 ) alone: omega2.

Zero means COND2's term drops out of the forward error. It does NOT prove MUMPS skipped the COND2 estimator – see the implementation for why the two differ

Reimplemented from belfem::solver::Wrapper.

◆ initialize()

void belfem::solver::MUMPS::initialize ( SpMatrix & aMatrix,
const SymmetryMode aSymmetryMode = SymmetryMode::Unsymmetric,
const int_t aNumRhsColumns = 1 )
overrideprotectedvirtual

Reimplemented from belfem::solver::Wrapper.

◆ set_block_low_ranking()

void belfem::solver::MUMPS::set_block_low_ranking ( const MumpsBlockLowRanking aBLK,
const real aEpsilon )

◆ set_error_analysis()

void belfem::solver::MUMPS::set_error_analysis ( const MumpsErrorAnalysis aSetting)

◆ set_reordering()

void belfem::solver::MUMPS::set_reordering ( const MumpsSerialReodrdering aSerial,
const MumpsParallelReodrdering aParallel )

◆ solve() [1/2]

void belfem::solver::MUMPS::solve ( SpMatrix & aMatrix,
Matrix< real > & aLHS,
Matrix< real > & aRHS )
overridevirtual

Reimplemented from belfem::solver::Wrapper.

◆ solve() [2/2]

void belfem::solver::MUMPS::solve ( SpMatrix & aMatrix,
Vector< real > & aLHS,
Vector< real > & aRHS )
overridevirtual

Reimplemented from belfem::solver::Wrapper.

◆ supports_factorization_reuse()

bool belfem::solver::MUMPS::supports_factorization_reuse ( ) const
overridevirtual

MUMPS keeps its factors in the saved DMUMPS_STRUC until JOB -2, so solving against them is a matter of asking for JOB 3

Reimplemented from belfem::solver::Wrapper.

◆ unfreeze_factorization()

void belfem::solver::MUMPS::unfreeze_factorization ( )
overridevirtual

drop the frozen state and return to ordinary re-factorizing solves.

Safe to call when not frozen, so a scope guard can call it unconditionally on the way out

Reimplemented from belfem::solver::Wrapper.

◆ warning_message()

void belfem::solver::MUMPS::warning_message ( const int_t * aInfo,
Cell< string > & aWarnings )
protected

The documentation for this class was generated from the following files: