#include <type_traits>
#include "b2sparse_solver.H"
#include "utils/b2timing.H"
#include "b2blaslapack.H"
#include "b2linalg_solver_slave.H"
#include "utils/b2logging.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. | |
Interaction with the MUMPS linear algebra package.
|
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.
enum b2000::b2linalg::MUMPSICNTL : int |
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.
|
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.
mumps_struct | the MUMPS interface structure to use. |
action | to perform in this MUMPS call. |
|
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.
mumps_struct | the MUMPS interface structure to use. |
|
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.
mumps_struct | the MUMPS interface structure to delete. |
|
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.
mumps_struct | the MUMPS interface structure to fill. |
autospc | indication of whether symmetric numerically singular matrices are to be healed automatically if possible, this parameter is read from the user configuration in dictionary. |
updated | indicates 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. |
s | order of the matrix (number of columns). |
nnz | number of non-zeros in the matrix. |
colind | index array to point to starting points in the list of non-zeroes in CSC formatted sparse matrix for all columns (size s). |
rowind | array of row indices for all non-zeroes in the sparse matrix (size nnz). |
value | pointer to the non-zero matrix entries in the order defined by colind/rowind. |
dictionary | provides the user configuration with settings for the solver. |
|
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.
mumps_struct | the MUMPS interface structure to set up. |
sym | MUMPS_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. |
|
inline |
Decode user configurations for cntl and icntl.
This routine extracts the user configuration for the control fields in the MUMPS interface.
d | is the Dictionary with the user configuration to get the settings from. |
mumps_struct | is the MUMPS interface structure where the control values are to be set. |
Exception | some error in the parsing of the user configuration occured. |
|
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.
info | is a constant int pointer to the constant infog field in the MUMPS interface. |
autospc | is 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. |
SingularMatrixError | autospc is false and matrix is numerically singular, MUMPS itself did not report an error. |
Exception | Some error occured in the factorization and MUMPS returned a negative error code. |
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
mumps_ | the MUMPS interface structure to use. |
updated_value | flag to indicate whether matrix values have been updated, if true the matrix values are reevaluated. Is set to false by the routine. |
autospc | indicates how to deal with numerical singular matrices in the error handler |
s | length of the solution vector |
nrhs | number of right hand sides to solve for |
b | right hand side |
ldb | length of individual right hand sides (>= s). |
x | solution 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. |
ldx | length of individual solution vectors (>= s). |