b2api
B2000++ API Reference Manual, VERSION 4.6
 
Loading...
Searching...
No Matches
b2mumps_solver.H File Reference
#include <type_traits>
#include "b2sparse_solver.H"
#include "utils/b2timing.H"
#include "b2blaslapack.H"
#include "b2linalg_solver_slave.H"
#include "utils/b2logging.H"
Include dependency graph for b2mumps_solver.H:

Go to the source code of this file.

Classes

class  b2000::b2linalg::MUMPS_LDLt_seq_sparse_direct_solver< T >
 Implementation of the LDLt sparse solver interface with MUMPS. More...
 
class  b2000::b2linalg::MUMPS_LDLt_seq_extension_sparse_direct_solver< T >
 Implementation of the LDLt extension sparse solver interface with MUMPS. More...
 
class  b2000::b2linalg::MUMPS_LU_seq_sparse_direct_solver< T >
 Implementation of the LU sparse solver interface with MUMPS. More...
 
class  b2000::b2linalg::MUMPS_LU_seq_extension_sparse_direct_solver< T >
 Implementation of the LU extension sparse solver interface with MUMPS. More...
 

Namespaces

namespace  b2000
 Contains the base classes for implementing Finite Elements.
 

Typedefs

template<class T >
using b2000::b2linalg::B2MUMPS_STRUC_t = typename B2MUMPS_STRUC< T >::type
 Convenience alias to refer to the B2MUMPS_STRUC type trait.
 
template<class T >
using b2000::b2linalg::B2MUMPS_NUM_t = typename B2MUMPS_STRUC< T >::numtype
 Convenience alias to refer to the B2MUMPS_STRUC numtype trait.
 

Enumerations

enum  b2000::b2linalg::MUMPSICNTL : int
 MUMPS control constants for icntl. More...
 
enum class  b2000::b2linalg::MUMPSACTION : unsigned int
 Actions to take when running a MUMPS call. More...
 

Functions

void b2000::b2linalg::mumps_error_handler (const int *const info, bool autospc=false)
 Handling errors that may occur during the execution of MUMPS.
 
template<typename MUMPS_STRUC_C >
void b2000::b2linalg::decode_mumps_cntl (const Dictionary &d, MUMPS_STRUC_C &mumps_struct)
 Decode user configurations for cntl and icntl.
 
template<typename MUMPS_STRUC_C >
void b2000::b2linalg::b2_mumps_call (MUMPS_STRUC_C &mumps_struct, MUMPSACTION action=MUMPSACTION::Continued)
 Encapsulate calls to MUMPS.
 
template<typename MUMPS_STRUC_C >
void b2000::b2linalg::b2_mumps_new (MUMPS_STRUC_C &mumps_struct, MUMPS_INT sym)
 Initialize a new MUMPS interface structure.
 
template<typename MUMPS_STRUC_C >
void b2000::b2linalg::b2_mumps_delete (MUMPS_STRUC_C &mumps_struct)
 Delete the MUMPS object.
 
template<typename MUMPS_STRUC_C >
void b2000::b2linalg::b2_mumps_call_wsgrow (MUMPS_STRUC_C &mumps_struct)
 Calling MUMPS with MUMPSACTION::Continued and grow its workspace as needed.
 
template<typename T >
void b2000::b2linalg::b2_mumps_init_struct (B2MUMPS_STRUC_t< T > &mumps_struct, bool &autospc, bool &updated, size_t s, size_t nnz, const size_t *const colind, const size_t *const rowind, const T *const value, const Dictionary &dictionary)
 Complete the MUMPS interface and define the matrix structure.
 
template<typename T >
void b2000::b2linalg::mumps_solve (B2MUMPS_STRUC_t< T > &mumps_, bool &updated_value, bool autospc, size_t s, size_t nrhs, const T *const b, size_t ldb, T *const x, size_t ldx)
 Solving the equation system with MUMPS.
 

Detailed Description

Interaction with the MUMPS linear algebra package.

Enumeration Type Documentation

◆ MUMPSACTION

enum class b2000::b2linalg::MUMPSACTION : unsigned int
strong

Actions to take when running a MUMPS call.

We distinguish new objects and continued operation on an existing object, see the Mumps routine of the solver slave.

◆ MUMPSICNTL

MUMPS control constants for icntl.

See http://mumps.enseeiht.fr/doc/userguide_5.4.1.pdf page 63 (section 6.1). minus 1 to account for C arrays starting with 0.

Function Documentation

◆ b2_mumps_call()

template<typename MUMPS_STRUC_C >
void b2000::b2linalg::b2_mumps_call ( MUMPS_STRUC_C &  mumps_struct,
MUMPSACTION  action = MUMPSACTION::Continued 
)
inline

Encapsulate calls to MUMPS.

Each call of the solver has to notify all slaves to also start the processing. Their mumps_struct needs to be properly filled.

Parameters
mumps_structthe MUMPS interface structure to use.
actionto perform in this MUMPS call.

◆ b2_mumps_call_wsgrow()

template<typename MUMPS_STRUC_C >
void b2000::b2linalg::b2_mumps_call_wsgrow ( MUMPS_STRUC_C &  mumps_struct)
inline

Calling MUMPS with MUMPSACTION::Continued and grow its workspace as needed.

This offers a wrapper around the mumps_call functions and takes care of automatic workspace reallocation if the previous memory proofed to be insufficient.

Parameters
mumps_structthe MUMPS interface structure to use.

◆ b2_mumps_delete()

template<typename MUMPS_STRUC_C >
void b2000::b2linalg::b2_mumps_delete ( MUMPS_STRUC_C &  mumps_struct)
inline

Delete the MUMPS object.

Cleanup of the allocated data structures for MUMPS. This routine calls MUMPS and lets it free its data structures on all processes.

Parameters
mumps_structthe MUMPS interface structure to delete.

◆ b2_mumps_init_struct()

template<typename T >
void b2000::b2linalg::b2_mumps_init_struct ( B2MUMPS_STRUC_t< T > &  mumps_struct,
bool &  autospc,
bool &  updated,
size_t  s,
size_t  nnz,
const size_t *const  colind,
const size_t *const  rowind,
const T *const  value,
const Dictionary dictionary 
)
inline

Complete the MUMPS interface and define the matrix structure.

This function takes care of applying user configurations and defines the matrix structure for the equation system to solve.

Parameters
mumps_structthe MUMPS interface structure to fill.
autospcindication of whether symmetric numerically singular matrices are to be healed automatically if possible, this parameter is read from the user configuration in dictionary.
updatedindicates whether matrix entries have been updated since the last MUMPS call and is set to false as the factorization for the initial matrix provided in value is performed here.
sorder of the matrix (number of columns).
nnznumber of non-zeros in the matrix.
colindindex array to point to starting points in the list of non-zeroes in CSC formatted sparse matrix for all columns (size s).
rowindarray of row indices for all non-zeroes in the sparse matrix (size nnz).
valuepointer to the non-zero matrix entries in the order defined by colind/rowind.
dictionaryprovides the user configuration with settings for the solver.

◆ b2_mumps_new()

template<typename MUMPS_STRUC_C >
void b2000::b2linalg::b2_mumps_new ( MUMPS_STRUC_C &  mumps_struct,
MUMPS_INT  sym 
)
inline

Initialize a new MUMPS interface structure.

Properly set up a new MUMPS interface structure across all processes. After the call of this function the interface structure is set up with basic settings, but still empty, the matrix still needs to be filled afterward.

Parameters
mumps_structthe MUMPS interface structure to set up.
symMUMPS_INT integer flag to indicate the symmetry of the equation system to solve. See http://mumps.enseeiht.fr/doc/userguide_5.4.1.pdf page 25, section 5.2.1 Matrix type (SYM), 0 indicates unsymmetric, 1 symmetric positive definit and 2 general symmetric matrix.

◆ decode_mumps_cntl()

template<typename MUMPS_STRUC_C >
void b2000::b2linalg::decode_mumps_cntl ( const Dictionary d,
MUMPS_STRUC_C &  mumps_struct 
)
inline

Decode user configurations for cntl and icntl.

This routine extracts the user configuration for the control fields in the MUMPS interface.

Parameters
dis the Dictionary with the user configuration to get the settings from.
mumps_structis the MUMPS interface structure where the control values are to be set.
Exceptions
Exceptionsome error in the parsing of the user configuration occured.

◆ mumps_error_handler()

void b2000::b2linalg::mumps_error_handler ( const int *const  info,
bool  autospc = false 
)
inline

Handling errors that may occur during the execution of MUMPS.

This helping routine is used to check for possible errors in the infog field of the MUMPS interface.

Parameters
infois a constant int pointer to the constant infog field in the MUMPS interface.
autospcis a bool flag that indicates whether automatically deal with numerically singular matrices, if this is false, the computation will abort when null pivot rows were encountered, even if MUMPS itself does not report an error.
Exceptions
SingularMatrixErrorautospc is false and matrix is numerically singular, MUMPS itself did not report an error.
ExceptionSome error occured in the factorization and MUMPS returned a negative error code.

◆ mumps_solve()

template<typename T >
void b2000::b2linalg::mumps_solve ( B2MUMPS_STRUC_t< T > &  mumps_,
bool &  updated_value,
bool  autospc,
size_t  s,
size_t  nrhs,
const T *const  b,
size_t  ldb,
T *const  x,
size_t  ldx 
)

Solving the equation system with MUMPS.

This implements the resolve function for both, LDLt and LU matrices

Parameters
mumps_the MUMPS interface structure to use.
updated_valueflag to indicate whether matrix values have been updated, if true the matrix values are reevaluated. Is set to false by the routine.
autospcindicates how to deal with numerical singular matrices in the error handler
slength of the solution vector
nrhsnumber of right hand sides to solve for
bright hand side
ldblength of individual right hand sides (>= s).
xsolution vector, needs to be long enough to hold solution for all right hand sides. If b and x are not pointing to the same address, b is copied into x for MUMPS.
ldxlength of individual solution vectors (>= s).