//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// More...
#include <linear_solver.h>
Public Types | |
enum | Type { Default , Serial , Distributed } |
enum type to specify the solver behaviour. Default - will employ superlu dist if more than 1 processor. Serial - will always try use superlu (serial). Distributed - will always try to use superlu dist. More... | |
Public Member Functions | |
SuperLUSolver () | |
Constructor. Set the defaults. More... | |
SuperLUSolver (const SuperLUSolver &dummy)=delete | |
Broken copy constructor. More... | |
void | operator= (const SuperLUSolver &)=delete |
Broken assignment operator. More... | |
~SuperLUSolver () | |
Destructor, clean up the stored matrices. More... | |
void | enable_computation_of_gradient () |
function to enable the computation of the gradient More... | |
void | disable_resolve () |
Overload disable resolve so that it cleans up memory too. More... | |
void | solve (Problem *const &problem_pt, DoubleVector &result) |
Solver: Takes pointer to problem and returns the results Vector which contains the solution of the linear system defined by the problem's fully assembled Jacobian and residual Vector. More... | |
void | solve (DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &result) |
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the linear system. The function returns the global result Vector. Note: if Delete_matrix_data is true the function matrix_pt->clean_up_memory() will be used to wipe the matrix data. More... | |
void | solve_transpose (Problem *const &problem_pt, DoubleVector &result) |
Solver: Takes pointer to problem and returns the results Vector which contains the solution of the linear system defined by the problem's fully assembled Jacobian and residual Vector. More... | |
void | solve_transpose (DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &result) |
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the linear system. The function returns the global result Vector. Note: if Delete_matrix_data is true the function matrix_pt->clean_up_memory() will be used to wipe the matrix data. More... | |
void | resolve (const DoubleVector &rhs, DoubleVector &result) |
Resolve the system defined by the last assembled jacobian and the specified rhs vector if resolve has been enabled. Note: returns the global result Vector. More... | |
void | resolve_transpose (const DoubleVector &rhs, DoubleVector &result) |
Resolve the (transposed) system defined by the last assembled Jacobian and the specified rhs vector if resolve has been enabled. More... | |
void | enable_doc_stats () |
Enable documentation of solver statistics. More... | |
void | disable_doc_stats () |
Disable documentation of solver statistics. More... | |
double | jacobian_setup_time () const |
returns the time taken to assemble the jacobian matrix and residual vector More... | |
virtual double | linear_solver_solution_time () const |
return the time taken to solve the linear system (needs to be overloaded for each linear solver) More... | |
void | factorise (DoubleMatrixBase *const &matrix_pt) |
Do the factorisation stage Note: if Delete_matrix_data is true the function matrix_pt->clean_up_memory() will be used to wipe the matrix data. More... | |
void | backsub (const DoubleVector &rhs, DoubleVector &result) |
Do the backsubstitution for SuperLU solver Note: returns the global result Vector. More... | |
void | backsub_transpose (const DoubleVector &rhs, DoubleVector &result) |
Do the back-substitution for transposed system of the SuperLU solver Note: Returns the global result Vector. More... | |
void | clean_up_memory () |
Clean up the memory allocated by the solver. More... | |
void | set_solver_type (const Type &t) |
Specify the solve type. Either default, serial or distributed. See enum SuperLU_solver_type for more details. More... | |
void | use_compressed_row_for_superlu_serial () |
Use the compressed row format in superlu serial. More... | |
void | use_compressed_column_for_superlu_serial () |
Use the compressed column format in superlu serial. More... | |
void | enable_delete_matrix_data_in_superlu_dist () |
Set Delete_matrix_data flag. SuperLU_dist needs its own copy of the input matrix, therefore a copy must be made if any matrix used with this solver is to be preserved. If the input matrix can be deleted the flag can be set to true to reduce the amount of memory required, and the matrix data will be wiped using its clean_up_memory() function. Default value is false. More... | |
void | disable_delete_matrix_data_in_superlu_dist () |
Unset Delete_matrix_data flag. SuperLU_dist needs its own copy of the input matrix, therefore a copy must be made if any matrix used with this solver is to be preserved. If the input matrix can be. More... | |
void | enable_row_and_col_permutations_in_superlu_dist () |
Set flag so that SuperLU_DIST is allowed to permute matrix rows and columns during factorisation. This is the default for SuperLU_DIST, and can lead to significantly faster solves. More... | |
void | disable_row_and_col_permutations_in_superlu_dist () |
Set flag so that SuperLU_DIST is not allowed to permute matrix rows and columns during factorisation. More... | |
void | use_global_solve_in_superlu_dist () |
Calling this method will ensure that when the problem based solve interface is used, a global (serial) jacobian will be assembled. Note: calling this function will delete any distributed solve data. More... | |
void | use_distributed_solve_in_superlu_dist () |
Calling this method will ensure that when the problem based solve interface is used, a distributed jacobian will be assembled. Note: calling this function will delete any global solve data. More... | |
double | get_memory_usage_for_lu_factors () |
How much memory do the LU factors take up? In bytes. More... | |
double | get_total_needed_memory () |
How much memory was allocated by SuperLU? In bytes. More... | |
Public Member Functions inherited from oomph::LinearSolver | |
LinearSolver () | |
Empty constructor, initialise the member data. More... | |
LinearSolver (const LinearSolver &dummy)=delete | |
Broken copy constructor. More... | |
void | operator= (const LinearSolver &)=delete |
Broken assignment operator. More... | |
virtual | ~LinearSolver () |
Empty virtual destructor. More... | |
void | enable_doc_time () |
Enable documentation of solve times. More... | |
void | disable_doc_time () |
Disable documentation of solve times. More... | |
bool | is_doc_time_enabled () const |
Is documentation of solve times enabled? More... | |
bool | is_resolve_enabled () const |
Boolean flag indicating if resolves are enabled. More... | |
virtual void | enable_resolve () |
Enable resolve (i.e. store matrix and/or LU decomposition, say) Virtual so it can be overloaded to perform additional tasks. More... | |
virtual void | solve (DoubleMatrixBase *const &matrix_pt, const Vector< double > &rhs, Vector< double > &result) |
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the linear system. More... | |
virtual void | solve_transpose (DoubleMatrixBase *const &matrix_pt, const Vector< double > &rhs, Vector< double > &result) |
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the linear system. More... | |
void | disable_computation_of_gradient () |
function to disable the computation of the gradient required for the globally convergent Newton method More... | |
void | reset_gradient () |
function to reset the size of the gradient before each Newton solve More... | |
void | get_gradient (DoubleVector &gradient) |
function to access the gradient, provided it has been computed More... | |
Public Member Functions inherited from oomph::DistributableLinearAlgebraObject | |
DistributableLinearAlgebraObject () | |
Default constructor - create a distribution. More... | |
DistributableLinearAlgebraObject (const DistributableLinearAlgebraObject &matrix)=delete | |
Broken copy constructor. More... | |
void | operator= (const DistributableLinearAlgebraObject &)=delete |
Broken assignment operator. More... | |
virtual | ~DistributableLinearAlgebraObject () |
Destructor. More... | |
LinearAlgebraDistribution * | distribution_pt () const |
access to the LinearAlgebraDistribution More... | |
unsigned | nrow () const |
access function to the number of global rows. More... | |
unsigned | nrow_local () const |
access function for the num of local rows on this processor. More... | |
unsigned | nrow_local (const unsigned &p) const |
access function for the num of local rows on this processor. More... | |
unsigned | first_row () const |
access function for the first row on this processor More... | |
unsigned | first_row (const unsigned &p) const |
access function for the first row on this processor More... | |
bool | distributed () const |
distribution is serial or distributed More... | |
bool | distribution_built () const |
if the communicator_pt is null then the distribution is not setup then false is returned, otherwise return true More... | |
void | build_distribution (const LinearAlgebraDistribution *const dist_pt) |
setup the distribution of this distributable linear algebra object More... | |
void | build_distribution (const LinearAlgebraDistribution &dist) |
setup the distribution of this distributable linear algebra object More... | |
Static Public Attributes | |
static bool | Suppress_incorrect_rhs_distribution_warning_in_resolve |
Static flag that determines whether the warning about incorrect distribution of RHSs will be printed or not. More... | |
Private Member Functions | |
void | factorise_serial (DoubleMatrixBase *const &matrix_pt) |
factorise method for SuperLU (serial) More... | |
void | backsub_serial (const DoubleVector &rhs, DoubleVector &result) |
backsub method for SuperLU (serial) More... | |
void | backsub_transpose_serial (const DoubleVector &rhs, DoubleVector &result) |
backsub method for SuperLU (serial) More... | |
void | factorise_distributed (DoubleMatrixBase *const &matrix_pt) |
factorise method for SuperLU Dist More... | |
void | backsub_distributed (const DoubleVector &rhs, DoubleVector &result) |
backsub method for SuperLU Dist More... | |
void | backsub_transpose_distributed (const DoubleVector &rhs, DoubleVector &result) |
backsub method for SuperLU Dist More... | |
Private Attributes | |
double | Jacobian_setup_time |
Jacobian setup time. More... | |
double | Solution_time |
Solution time. More... | |
bool | Suppress_solve |
Suppress solve? More... | |
bool | Doc_stats |
Set to true to output statistics (false by default). More... | |
Type | Solver_type |
the solver type. see SuperLU_solver_type for details. More... | |
bool | Using_dist |
boolean flag indicating whether superlu dist is being used More... | |
void * | Serial_f_factors |
Storage for the LU factors as required by SuperLU. More... | |
int | Serial_info |
Info flag for the SuperLU solver. More... | |
unsigned long | Serial_n_dof |
The number of unknowns in the linear system. More... | |
int | Serial_sign_of_determinant_of_matrix |
Sign of the determinant of the matrix. More... | |
bool | Serial_compressed_row_flag |
Use compressed row version? More... | |
bool | Dist_use_global_solver |
Flag that determines whether the MPIProblem based solve function uses the global or distributed version of SuperLU_DIST (default value is false). More... | |
bool | Dist_global_solve_data_allocated |
Flag is true if solve data has been generated for a global matrix. More... | |
bool | Dist_distributed_solve_data_allocated |
Flag is true if solve data has been generated for distributed matrix. More... | |
void * | Dist_solver_data_pt |
Storage for the LU factors and other data required by SuperLU. More... | |
int | Dist_nprow |
Number of rows for the process grid. More... | |
int | Dist_npcol |
Number of columns for the process grid. More... | |
int | Dist_info |
Info flag for the SuperLU solver. More... | |
bool | Dist_allow_row_and_col_permutations |
If true then SuperLU_DIST is allowed to permute matrix rows and columns during factorisation. This is the default for SuperLU_DIST, and can lead to significantly faster solves, but has been known to fail, hence the default value is 0. More... | |
bool | Dist_delete_matrix_data |
Delete_matrix_data flag. SuperLU_dist needs its own copy of the input matrix, therefore a copy must be made if any matrix used with this solver is to be preserved. If the input matrix can be deleted the flag can be set to true to reduce the amount of memory required, and the matrix data will be wiped using its clean_up_memory() function. Default value is false. More... | |
double * | Dist_value_pt |
Pointer for storage of the matrix values required by SuperLU_DIST. More... | |
int * | Dist_index_pt |
Pointer for storage of matrix rows or column indices required by SuperLU_DIST. More... | |
int * | Dist_start_pt |
Pointers for storage of matrix column or row starts. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from oomph::DistributableLinearAlgebraObject | |
void | clear_distribution () |
clear the distribution of this distributable linear algebra object More... | |
Protected Attributes inherited from oomph::LinearSolver | |
bool | Enable_resolve |
Boolean that indicates whether the matrix (or its factors, in the case of direct solver) should be stored so that the resolve function can be used. More... | |
bool | Doc_time |
Boolean flag that indicates whether the time taken. More... | |
bool | Compute_gradient |
flag that indicates whether the gradient required for the globally convergent Newton method should be computed or not More... | |
bool | Gradient_has_been_computed |
flag that indicates whether the gradient was computed or not More... | |
DoubleVector | Gradient_for_glob_conv_newton_solve |
DoubleVector storing the gradient for the globally convergent Newton method. More... | |
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
SuperLU Project Solver class. This is a combined wrapper for both SuperLU and SuperLU Dist. See http://crd.lbl.gov/~xiaoye/SuperLU/ Default Behaviour: If this solver is distributed over more than one processor then SuperLU Dist is used. Member data naming convention: member data associated with the SuperLU Dist solver begins Dist_... and member data associated with the serial SuperLU solver begins Serial_... .
Definition at line 485 of file linear_solver.h.
enum type to specify the solver behaviour. Default - will employ superlu dist if more than 1 processor. Serial - will always try use superlu (serial). Distributed - will always try to use superlu dist.
Enumerator | |
---|---|
Default | |
Serial | |
Distributed |
Definition at line 492 of file linear_solver.h.
|
inline |
Constructor. Set the defaults.
Definition at line 500 of file linear_solver.h.
References Default, Dist_allow_row_and_col_permutations, Dist_delete_matrix_data, Dist_distributed_solve_data_allocated, Dist_global_solve_data_allocated, Dist_index_pt, Dist_solver_data_pt, Dist_start_pt, Dist_use_global_solver, Dist_value_pt, Doc_stats, Serial_compressed_row_flag, Serial_n_dof, Serial_sign_of_determinant_of_matrix, Solver_type, Suppress_solve, and Using_dist.
|
delete |
Broken copy constructor.
|
inline |
Destructor, clean up the stored matrices.
Definition at line 534 of file linear_solver.h.
References clean_up_memory().
void oomph::SuperLUSolver::backsub | ( | const DoubleVector & | rhs, |
DoubleVector & | result | ||
) |
Do the backsubstitution for SuperLU solver Note: returns the global result Vector.
Do the backsubstitution for SuperLUSolver. Note - this method performs no paranoid checks - these are all performed in solve(...) and resolve(...)
Definition at line 2299 of file linear_solver.cc.
References backsub_distributed(), backsub_serial(), and Using_dist.
|
private |
backsub method for SuperLU Dist
Do the backsubstitution for SuperLU solver. Note - this method performs no paranoid checks - these are all performed in solve(...) and resolve(...)
Definition at line 2347 of file linear_solver.cc.
References oomph::LinearAlgebraDistribution::built(), Dist_distributed_solve_data_allocated, Dist_global_solve_data_allocated, Dist_info, Dist_npcol, Dist_nprow, Dist_solver_data_pt, oomph::DistributableLinearAlgebraObject::distribution_built(), oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::LeakCheckNames::doc(), Doc_stats, oomph::LinearAlgebraDistribution::nrow(), oomph::superlu_dist_distributed_matrix(), oomph::superlu_dist_global_matrix(), Suppress_incorrect_rhs_distribution_warning_in_resolve, and oomph::DoubleVector::values_pt().
Referenced by backsub().
|
private |
backsub method for SuperLU (serial)
Do the backsubstitution for SuperLU.
Definition at line 2510 of file linear_solver.cc.
References oomph::DoubleVector::built(), oomph::LinearAlgebraDistribution::distributed(), oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::LeakCheckNames::doc(), Doc_stats, i, oomph::DistributableLinearAlgebraObject::nrow(), Serial_compressed_row_flag, Serial_f_factors, Serial_info, Serial_n_dof, oomph::superlu(), and oomph::DoubleVector::values_pt().
Referenced by backsub().
void oomph::SuperLUSolver::backsub_transpose | ( | const DoubleVector & | rhs, |
DoubleVector & | result | ||
) |
Do the back-substitution for transposed system of the SuperLU solver Note: Returns the global result Vector.
Do the backsubstitution of the transposed system for SuperLUSolver. Note - this method performs no paranoid checks - these are all performed in solve(...) and resolve(...)
Definition at line 2319 of file linear_solver.cc.
References backsub_transpose_distributed(), backsub_transpose_serial(), and Using_dist.
Referenced by resolve_transpose(), and solve_transpose().
|
private |
backsub method for SuperLU Dist
Do the backsubstitution for SuperLU solver. Note - this method performs no paranoid checks - these are all performed in solve(...) and resolve(...)
Definition at line 2490 of file linear_solver.cc.
Referenced by backsub_transpose().
|
private |
backsub method for SuperLU (serial)
Do the backsubstitution for SuperLU.
Definition at line 2600 of file linear_solver.cc.
References oomph::DoubleVector::built(), oomph::LinearAlgebraDistribution::distributed(), oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::LeakCheckNames::doc(), Doc_stats, i, oomph::DistributableLinearAlgebraObject::nrow(), Serial_compressed_row_flag, Serial_f_factors, Serial_info, Serial_n_dof, oomph::superlu(), and oomph::DoubleVector::values_pt().
Referenced by backsub_transpose().
|
virtual |
Clean up the memory allocated by the solver.
Clean up the memory.
Reimplemented from oomph::LinearSolver.
Definition at line 2690 of file linear_solver.cc.
References oomph::DistributableLinearAlgebraObject::clear_distribution(), Dist_distributed_solve_data_allocated, Dist_global_solve_data_allocated, Dist_index_pt, Dist_info, Dist_npcol, Dist_nprow, Dist_solver_data_pt, Dist_start_pt, Dist_value_pt, oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::LeakCheckNames::doc(), Doc_stats, i, oomph::LinearAlgebraDistribution::nrow(), Serial_compressed_row_flag, Serial_f_factors, Serial_info, Serial_n_dof, oomph::superlu(), oomph::superlu_dist_distributed_matrix(), and oomph::superlu_dist_global_matrix().
Referenced by oomph::SuperLUPreconditioner::clean_up_memory(), disable_resolve(), factorise(), factorise_distributed(), factorise_serial(), set_solver_type(), solve(), solve_transpose(), use_distributed_solve_in_superlu_dist(), use_global_solve_in_superlu_dist(), and ~SuperLUSolver().
|
inline |
Unset Delete_matrix_data flag. SuperLU_dist needs its own copy of the input matrix, therefore a copy must be made if any matrix used with this solver is to be preserved. If the input matrix can be.
Definition at line 686 of file linear_solver.h.
References Dist_delete_matrix_data.
|
inline |
Disable documentation of solver statistics.
Definition at line 609 of file linear_solver.h.
References Doc_stats.
Referenced by oomph::SuperLUPreconditioner::disable_doc_stats(), and oomph::SuperLUPreconditioner::SuperLUPreconditioner().
|
inlinevirtual |
Overload disable resolve so that it cleans up memory too.
Reimplemented from oomph::LinearSolver.
Definition at line 549 of file linear_solver.h.
References clean_up_memory(), and oomph::LinearSolver::disable_resolve().
|
inline |
Set flag so that SuperLU_DIST is not allowed to permute matrix rows and columns during factorisation.
Definition at line 701 of file linear_solver.h.
References Dist_allow_row_and_col_permutations.
|
inlinevirtual |
function to enable the computation of the gradient
Reimplemented from oomph::LinearSolver.
Definition at line 540 of file linear_solver.h.
References oomph::LinearSolver::Compute_gradient.
|
inline |
Set Delete_matrix_data flag. SuperLU_dist needs its own copy of the input matrix, therefore a copy must be made if any matrix used with this solver is to be preserved. If the input matrix can be deleted the flag can be set to true to reduce the amount of memory required, and the matrix data will be wiped using its clean_up_memory() function. Default value is false.
Definition at line 678 of file linear_solver.h.
References Dist_delete_matrix_data.
|
inline |
Enable documentation of solver statistics.
Definition at line 603 of file linear_solver.h.
References Doc_stats.
Referenced by oomph::SuperLUPreconditioner::enable_doc_stats().
|
inline |
Set flag so that SuperLU_DIST is allowed to permute matrix rows and columns during factorisation. This is the default for SuperLU_DIST, and can lead to significantly faster solves.
Definition at line 694 of file linear_solver.h.
References Dist_allow_row_and_col_permutations.
void oomph::SuperLUSolver::factorise | ( | DoubleMatrixBase *const & | matrix_pt | ) |
Do the factorisation stage Note: if Delete_matrix_data is true the function matrix_pt->clean_up_memory() will be used to wipe the matrix data.
LU decompose the matrix addressed by matrix_pt by using the SuperLU solver. The resulting matrix factors are stored internally.
Definition at line 1827 of file linear_solver.cc.
References clean_up_memory(), oomph::LinearAlgebraDistribution::communicator_pt(), Default, Distributed, oomph::DistributableLinearAlgebraObject::distribution_pt(), factorise_distributed(), factorise_serial(), oomph::MPI_Helpers::mpi_has_been_initialised(), Solver_type, and Using_dist.
Referenced by oomph::SuperLUPreconditioner::setup(), solve(), and solve_transpose().
|
private |
factorise method for SuperLU Dist
LU decompose the matrix addressed by matrix_pt using the SuperLU_DIST solver. The resulting matrix factors are stored internally.
Definition at line 1872 of file linear_solver.cc.
References oomph::DistributableLinearAlgebraObject::build_distribution(), oomph::CRDoubleMatrix::built(), clean_up_memory(), oomph::CCMatrix< T >::clean_up_memory(), oomph::CRDoubleMatrix::clear(), oomph::CRDoubleMatrix::column_index(), oomph::CCMatrix< T >::column_start(), oomph::MPI_Helpers::communicator_pt(), oomph::LinearAlgebraDistribution::communicator_pt(), Dist_allow_row_and_col_permutations, Dist_delete_matrix_data, Dist_distributed_solve_data_allocated, Dist_global_solve_data_allocated, Dist_index_pt, Dist_info, Dist_npcol, Dist_nprow, Dist_solver_data_pt, Dist_start_pt, Dist_value_pt, oomph::DistributableLinearAlgebraObject::distributed(), oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::LeakCheckNames::doc(), Doc_stats, oomph::DistributableLinearAlgebraObject::first_row(), i, oomph::DoubleMatrixBase::ncol(), oomph::SparseMatrix< T, MATRIX_TYPE >::nnz(), oomph::CRDoubleMatrix::nnz(), oomph::LinearAlgebraDistribution::nrow(), oomph::DistributableLinearAlgebraObject::nrow(), oomph::CRDoubleMatrix::nrow(), oomph::CCDoubleMatrix::nrow(), oomph::DoubleMatrixBase::nrow(), oomph::DistributableLinearAlgebraObject::nrow_local(), oomph::CCMatrix< T >::row_index(), oomph::CRDoubleMatrix::row_start(), oomph::superlu_cr_to_cc(), oomph::superlu_dist_distributed_matrix(), oomph::superlu_dist_global_matrix(), oomph::SparseMatrix< T, MATRIX_TYPE >::value(), and oomph::CRDoubleMatrix::value().
Referenced by factorise().
|
private |
factorise method for SuperLU (serial)
LU decompose the matrix addressed by matrix_pt by using the SuperLU solver. The resulting matrix factors are stored internally.
Definition at line 2168 of file linear_solver.cc.
References clean_up_memory(), oomph::CRDoubleMatrix::column_index(), oomph::CCMatrix< T >::column_start(), oomph::DistributableLinearAlgebraObject::distributed(), oomph::LeakCheckNames::doc(), Doc_stats, i, oomph::DoubleMatrixBase::ncol(), oomph::SparseMatrix< T, MATRIX_TYPE >::nnz(), oomph::CRDoubleMatrix::nnz(), oomph::DoubleMatrixBase::nrow(), oomph::CCMatrix< T >::row_index(), oomph::CRDoubleMatrix::row_start(), Serial_compressed_row_flag, Serial_f_factors, Serial_info, Serial_n_dof, Serial_sign_of_determinant_of_matrix, oomph::CumulativeTimings::start(), oomph::superlu(), oomph::SparseMatrix< T, MATRIX_TYPE >::value(), and oomph::CRDoubleMatrix::value().
Referenced by factorise().
double oomph::SuperLUSolver::get_memory_usage_for_lu_factors | ( | ) |
How much memory do the LU factors take up? In bytes.
How much memory do the LU factors take up? In bytes NOTE: This has been scraped from dQuerySpace(...) in dmemory.c in external_src/oomph_superlu_4.3.
Definition at line 758 of file linear_solver.cc.
References Dist_solver_data_pt, Distributed, oomph::get_lu_factor_memory_usage_in_bytes(), oomph::get_lu_factor_memory_usage_in_bytes_dist(), Serial_f_factors, and Solver_type.
Referenced by oomph::SuperLUPreconditioner::get_memory_usage_for_lu_factors(), and oomph::SuperLUPreconditioner::get_memory_usage_for_superlu().
double oomph::SuperLUSolver::get_total_needed_memory | ( | ) |
How much memory was allocated by SuperLU? In bytes.
How much memory was used in total? In bytes NOTE: This has been scraped from dQuerySpace(...) in dmemory.c in external_src/oomph_superlu_4.3.
Definition at line 786 of file linear_solver.cc.
References Dist_solver_data_pt, Distributed, oomph::get_total_memory_usage_in_bytes(), oomph::get_total_memory_usage_in_bytes_dist(), Serial_f_factors, and Solver_type.
Referenced by oomph::SuperLUPreconditioner::get_memory_usage_for_superlu(), oomph::SuperLUPreconditioner::get_total_memory_needed_for_superlu(), solve(), and solve_transpose().
|
inlinevirtual |
returns the time taken to assemble the jacobian matrix and residual vector
Reimplemented from oomph::LinearSolver.
Definition at line 616 of file linear_solver.h.
References Jacobian_setup_time.
|
inlinevirtual |
return the time taken to solve the linear system (needs to be overloaded for each linear solver)
Reimplemented from oomph::LinearSolver.
Definition at line 623 of file linear_solver.h.
References Solution_time.
|
delete |
Broken assignment operator.
|
virtual |
Resolve the system defined by the last assembled jacobian and the specified rhs vector if resolve has been enabled. Note: returns the global result Vector.
Resolve the system for a given RHS.
Reimplemented from oomph::LinearSolver.
Definition at line 1776 of file linear_solver.cc.
References backsub(), oomph::TimingHelpers::convert_secs_to_formatted_string(), oomph::LinearSolver::Doc_time, oomph::DistributableLinearAlgebraObject::nrow(), oomph::oomph_info, Solution_time, and oomph::TimingHelpers::timer().
Referenced by oomph::SuperLUPreconditioner::preconditioner_solve().
|
virtual |
Resolve the (transposed) system defined by the last assembled Jacobian and the specified rhs vector if resolve has been enabled.
Resolve the (transposed) system for a given RHS.
Reimplemented from oomph::LinearSolver.
Definition at line 1800 of file linear_solver.cc.
References backsub_transpose(), oomph::TimingHelpers::convert_secs_to_formatted_string(), oomph::LinearSolver::Doc_time, oomph::DistributableLinearAlgebraObject::nrow(), oomph::oomph_info, Solution_time, and oomph::TimingHelpers::timer().
Referenced by oomph::SuperLUPreconditioner::preconditioner_solve_transpose().
|
inline |
Specify the solve type. Either default, serial or distributed. See enum SuperLU_solver_type for more details.
Definition at line 646 of file linear_solver.h.
References clean_up_memory(), Solver_type, and t.
|
virtual |
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the linear system. The function returns the global result Vector. Note: if Delete_matrix_data is true the function matrix_pt->clean_up_memory() will be used to wipe the matrix data.
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the linear system. Problem pointer defaults to NULL and can be omitted. The function returns the global result Vector. Note: if Delete_matrix_data is true the function matrix_pt->clean_up_memory() will be used to wipe the matrix data.
Reimplemented from oomph::LinearSolver.
Definition at line 1074 of file linear_solver.cc.
References backsub(), oomph::DistributableLinearAlgebraObject::build_distribution(), oomph::DoubleVector::built(), clean_up_memory(), oomph::TimingHelpers::convert_secs_to_formatted_string(), oomph::LinearAlgebraDistribution::distributed(), oomph::DistributableLinearAlgebraObject::distribution_pt(), Doc_stats, oomph::LinearSolver::Doc_time, oomph::LinearSolver::Enable_resolve, factorise(), get_total_needed_memory(), oomph::DoubleMatrixBase::ncol(), oomph::CRDoubleMatrix::nnz(), oomph::DistributableLinearAlgebraObject::nrow(), oomph::CRDoubleMatrix::nrow(), oomph::DoubleMatrixBase::nrow(), oomph::oomph_info, Solution_time, and oomph::TimingHelpers::timer().
|
virtual |
Solver: Takes pointer to problem and returns the results Vector which contains the solution of the linear system defined by the problem's fully assembled Jacobian and residual Vector.
Implements oomph::LinearSolver.
Definition at line 814 of file linear_solver.cc.
References oomph::DoubleVector::build(), oomph::DistributableLinearAlgebraObject::build_distribution(), oomph::DoubleVector::built(), clean_up_memory(), oomph::Problem::communicator_pt(), oomph::LinearSolver::Compute_gradient, oomph::TimingHelpers::convert_secs_to_formatted_string(), Default, Dist_delete_matrix_data, Dist_use_global_solver, Distributed, oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::LinearSolver::Doc_time, oomph::Problem::get_jacobian(), oomph::LinearSolver::Gradient_for_glob_conv_newton_solve, oomph::LinearSolver::Gradient_has_been_computed, Jacobian_setup_time, oomph::CRDoubleMatrix::multiply_transpose(), oomph::CCDoubleMatrix::multiply_transpose(), oomph::Problem::ndof(), oomph::oomph_info, oomph::DoubleVector::redistribute(), Serial_compressed_row_flag, Serial_sign_of_determinant_of_matrix, oomph::Problem::sign_of_jacobian(), Solver_type, Suppress_solve, and oomph::TimingHelpers::timer().
|
virtual |
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the linear system. The function returns the global result Vector. Note: if Delete_matrix_data is true the function matrix_pt->clean_up_memory() will be used to wipe the matrix data.
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the linear system. Problem pointer defaults to NULL and can be omitted. The function returns the global result Vector. Note: if Delete_matrix_data is true the function matrix_pt->clean_up_memory() will be used to wipe the matrix data.
Reimplemented from oomph::LinearSolver.
Definition at line 1558 of file linear_solver.cc.
References backsub_transpose(), oomph::DistributableLinearAlgebraObject::build_distribution(), oomph::DoubleVector::built(), clean_up_memory(), oomph::TimingHelpers::convert_secs_to_formatted_string(), oomph::LinearAlgebraDistribution::distributed(), oomph::DistributableLinearAlgebraObject::distribution_pt(), Doc_stats, oomph::LinearSolver::Doc_time, oomph::LinearSolver::Enable_resolve, factorise(), get_total_needed_memory(), oomph::DoubleMatrixBase::ncol(), oomph::CRDoubleMatrix::nnz(), oomph::DistributableLinearAlgebraObject::nrow(), oomph::CRDoubleMatrix::nrow(), oomph::DoubleMatrixBase::nrow(), oomph::oomph_info, Solution_time, and oomph::TimingHelpers::timer().
|
virtual |
Solver: Takes pointer to problem and returns the results Vector which contains the solution of the linear system defined by the problem's fully assembled Jacobian and residual Vector.
Reimplemented from oomph::LinearSolver.
Definition at line 1297 of file linear_solver.cc.
References oomph::DoubleVector::build(), oomph::DistributableLinearAlgebraObject::build_distribution(), oomph::DoubleVector::built(), clean_up_memory(), oomph::Problem::communicator_pt(), oomph::LinearSolver::Compute_gradient, oomph::TimingHelpers::convert_secs_to_formatted_string(), Default, Dist_delete_matrix_data, Dist_use_global_solver, Distributed, oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::LinearSolver::Doc_time, oomph::Problem::get_jacobian(), oomph::LinearSolver::Gradient_for_glob_conv_newton_solve, oomph::LinearSolver::Gradient_has_been_computed, Jacobian_setup_time, oomph::CRDoubleMatrix::multiply_transpose(), oomph::CCDoubleMatrix::multiply_transpose(), oomph::Problem::ndof(), oomph::oomph_info, oomph::DoubleVector::redistribute(), Serial_compressed_row_flag, Serial_sign_of_determinant_of_matrix, oomph::Problem::sign_of_jacobian(), Solver_type, Suppress_solve, and oomph::TimingHelpers::timer().
|
inline |
Use the compressed column format in superlu serial.
Definition at line 662 of file linear_solver.h.
References Serial_compressed_row_flag.
|
inline |
Use the compressed row format in superlu serial.
Definition at line 656 of file linear_solver.h.
References Serial_compressed_row_flag.
|
inline |
Calling this method will ensure that when the problem based solve interface is used, a distributed jacobian will be assembled. Note: calling this function will delete any global solve data.
Definition at line 723 of file linear_solver.h.
References clean_up_memory(), and Dist_use_global_solver.
|
inline |
Calling this method will ensure that when the problem based solve interface is used, a global (serial) jacobian will be assembled. Note: calling this function will delete any distributed solve data.
Definition at line 710 of file linear_solver.h.
References clean_up_memory(), and Dist_use_global_solver.
|
private |
If true then SuperLU_DIST is allowed to permute matrix rows and columns during factorisation. This is the default for SuperLU_DIST, and can lead to significantly faster solves, but has been known to fail, hence the default value is 0.
Definition at line 841 of file linear_solver.h.
Referenced by disable_row_and_col_permutations_in_superlu_dist(), enable_row_and_col_permutations_in_superlu_dist(), factorise_distributed(), and SuperLUSolver().
|
private |
Delete_matrix_data flag. SuperLU_dist needs its own copy of the input matrix, therefore a copy must be made if any matrix used with this solver is to be preserved. If the input matrix can be deleted the flag can be set to true to reduce the amount of memory required, and the matrix data will be wiped using its clean_up_memory() function. Default value is false.
Definition at line 849 of file linear_solver.h.
Referenced by disable_delete_matrix_data_in_superlu_dist(), enable_delete_matrix_data_in_superlu_dist(), factorise_distributed(), solve(), solve_transpose(), and SuperLUSolver().
|
private |
Flag is true if solve data has been generated for distributed matrix.
Definition at line 823 of file linear_solver.h.
Referenced by backsub_distributed(), clean_up_memory(), factorise_distributed(), and SuperLUSolver().
|
private |
Flag is true if solve data has been generated for a global matrix.
Definition at line 820 of file linear_solver.h.
Referenced by backsub_distributed(), clean_up_memory(), factorise_distributed(), and SuperLUSolver().
|
private |
Pointer for storage of matrix rows or column indices required by SuperLU_DIST.
Definition at line 856 of file linear_solver.h.
Referenced by clean_up_memory(), factorise_distributed(), and SuperLUSolver().
|
private |
Info flag for the SuperLU solver.
Definition at line 835 of file linear_solver.h.
Referenced by backsub_distributed(), clean_up_memory(), and factorise_distributed().
|
private |
Number of columns for the process grid.
Definition at line 832 of file linear_solver.h.
Referenced by backsub_distributed(), clean_up_memory(), and factorise_distributed().
|
private |
Number of rows for the process grid.
Definition at line 829 of file linear_solver.h.
Referenced by backsub_distributed(), clean_up_memory(), and factorise_distributed().
|
private |
Storage for the LU factors and other data required by SuperLU.
Definition at line 826 of file linear_solver.h.
Referenced by backsub_distributed(), clean_up_memory(), factorise_distributed(), get_memory_usage_for_lu_factors(), get_total_needed_memory(), and SuperLUSolver().
|
private |
Pointers for storage of matrix column or row starts.
Definition at line 860 of file linear_solver.h.
Referenced by clean_up_memory(), factorise_distributed(), and SuperLUSolver().
|
private |
Flag that determines whether the MPIProblem based solve function uses the global or distributed version of SuperLU_DIST (default value is false).
Definition at line 817 of file linear_solver.h.
Referenced by solve(), solve_transpose(), SuperLUSolver(), use_distributed_solve_in_superlu_dist(), and use_global_solve_in_superlu_dist().
|
private |
Pointer for storage of the matrix values required by SuperLU_DIST.
Definition at line 852 of file linear_solver.h.
Referenced by clean_up_memory(), factorise_distributed(), and SuperLUSolver().
|
private |
Set to true to output statistics (false by default).
Definition at line 770 of file linear_solver.h.
Referenced by backsub_distributed(), backsub_serial(), backsub_transpose_serial(), clean_up_memory(), disable_doc_stats(), enable_doc_stats(), factorise_distributed(), factorise_serial(), solve(), solve_transpose(), and SuperLUSolver().
|
private |
Jacobian setup time.
Definition at line 761 of file linear_solver.h.
Referenced by jacobian_setup_time(), solve(), and solve_transpose().
|
private |
Use compressed row version?
Definition at line 794 of file linear_solver.h.
Referenced by backsub_serial(), backsub_transpose_serial(), clean_up_memory(), factorise_serial(), solve(), solve_transpose(), SuperLUSolver(), use_compressed_column_for_superlu_serial(), and use_compressed_row_for_superlu_serial().
|
private |
Storage for the LU factors as required by SuperLU.
Definition at line 782 of file linear_solver.h.
Referenced by backsub_serial(), backsub_transpose_serial(), clean_up_memory(), factorise_serial(), get_memory_usage_for_lu_factors(), and get_total_needed_memory().
|
private |
Info flag for the SuperLU solver.
Definition at line 785 of file linear_solver.h.
Referenced by backsub_serial(), backsub_transpose_serial(), clean_up_memory(), and factorise_serial().
|
private |
The number of unknowns in the linear system.
Definition at line 788 of file linear_solver.h.
Referenced by backsub_serial(), backsub_transpose_serial(), clean_up_memory(), factorise_serial(), and SuperLUSolver().
|
private |
Sign of the determinant of the matrix.
Definition at line 791 of file linear_solver.h.
Referenced by factorise_serial(), solve(), solve_transpose(), and SuperLUSolver().
|
private |
Solution time.
Definition at line 764 of file linear_solver.h.
Referenced by linear_solver_solution_time(), resolve(), resolve_transpose(), solve(), and solve_transpose().
|
private |
the solver type. see SuperLU_solver_type for details.
Definition at line 773 of file linear_solver.h.
Referenced by factorise(), get_memory_usage_for_lu_factors(), get_total_needed_memory(), set_solver_type(), solve(), solve_transpose(), and SuperLUSolver().
|
static |
Static flag that determines whether the warning about incorrect distribution of RHSs will be printed or not.
Static warning to suppress warnings about incorrect distribution of RHS vector. Default is false.
Definition at line 811 of file linear_solver.h.
Referenced by backsub_distributed().
|
private |
Suppress solve?
Definition at line 767 of file linear_solver.h.
Referenced by solve(), solve_transpose(), and SuperLUSolver().
|
private |
boolean flag indicating whether superlu dist is being used
Definition at line 776 of file linear_solver.h.
Referenced by backsub(), backsub_transpose(), factorise(), and SuperLUSolver().