aFSAI
This class is used to manage the adaptive FSAI preconditioner for SPD. More…
#include "aFSAI.h"
Inherits from Preconditioner, MatrixProd
Inherited by aFSAI_CPU
Public Functions
| Name | |
|---|---|
| virtual void | Prepare_MxV(const iReg nRHS) Prepares the preconditioner application to a vector (DDMat). |
| virtual void | UndoPrepare_MxV() Undo the data structure necessary for MxV. |
| virtual void | MxV(DDMat & RHS, DDMat & SOL, bool Barrier_flag) Applies the preconditioner to a vetor (DDMat): prec(A9 * RHS = SOL. |
| virtual void | MxM(DSMat & Mat, DSMat & PrecMat) Applies the preconditioner to a matrix (DSMat). |
| void | MxM_double(DSMat & Mat, DSMat & PrecMat) Applies the doble preconditioner to a matrix (DSMat). |
| void | LowLeft_MxM(DSMat & Mat, DSMat & PrecMat) Applies the lower FSAI factor to the left of an input matrix (DSMat). |
| void | LowRight_MxM(DSMat & Mat, DSMat & PrecMat) Applies the lower FSAI factor to the right of an input matrix (DSMat). |
| void | UppLeft_MxM(DSMat & Mat, DSMat & PrecMat) Applies the upper FSAI factor to the left of an input matrix (DSMat). |
| void | UppRight_MxM(DSMat & Mat, DSMat & PrecMat) Applies the upper FSAI factor to the right of an input matrix (DSMat). |
| virtual iReg | get_nrows() const Retrieve the number of rows. |
| virtual iExt | Get_nnz() const Returns an estimate of the number of non-zeroes of the preconditioner application. |
| DSMat * | get_MatGL() Get FSAI factor (lower part). |
| DSMat * | get_MatGU() Get FSAI factor transposed (upper part). |
| DSMat * | get_MatGL2() Get second FSAI factor (lower part). |
| DSMat * | get_MatGU2() Get second FSAI factor transposed (upper part). |
| virtual long int | Get_FlopEst() const Returns an estimate of the number of FLOPS needed to perform the preconditioner application. |
| virtual void | Set_Parameters(const void * params) Sets the aFSAI parameters. |
| void | SetParms_from_XML(xml_document & input_xml) Sets the aFSAI parameters from the XML input file. |
| virtual void | DumpAllParms(FILE * ofile) const Dumps all of the FSAI parameters. |
| virtual void | Print_ASCII(const string & filename) const Prints the Operator in ASCII format. |
| void | Print_GL(const string & filename) const Prints the GL part of the preconditioner. |
| void | Print_GU(const string & filename) const Prints the GU part of the preconditioner. |
| void | Print_GL2(const string & filename) const Prints the second GL part of the preconditioner. |
| void | Print_GU2(const string & filename) const Prints the second GU part of the preconditioner. |
| aFSAI() Constructs the object. |
|
| aFSAI & | operator=(aFSAI const & other) Copy operator. |
| void | print_OperStats(FILE * ofile) Prints aFSAI info. |
| void | print_Times(FILE * ofile) Prints the times needed to compute the aFSAI. |
| int | Set_default() Sets default configuration for cfd problems. |
| int | Set_CompType(const int CompType) Sets the computation type. |
| int | Set_GatherType(const int GatherType) Sets the gathering type. |
| int | Set_BPowerDistK(const int BPowerDistK) Sets the power used to build aFSAI. |
| int | Set_nstep(const int nstep) Sets the number of steps used to build aFSAI (adaptive). |
| int | Set_step_size(const int step_size) Sets the number of entries added for each row at each step (adaptive). |
| int | Set_epsilon(const double epsilon) Sets the exit tolerance used in the adaptive procedure (adaptive). |
| int | Set_tau_pref(const double tau_pref) Sets the pre-filtering Drop tolerance (static). |
| int | Set_pow_patt(const int pow_patt) Sets the power of the static pattern (static). |
| int | Set_nnzr_max(const int nnzr_max) Sets the maximum number of non-zeros per row (static). |
| int | Set_tau_posf(const double tau_posf) Sets the post-filtering Drop tolerance (static). |
| int | Set_tau_double(const double tau_double) Sets the filtering tolerance for double FSAI. |
| void | setDefaultParameters() Set default parameters. |
| virtual | ~aFSAI() =0 Deletes the object. |
| virtual void | copy(MatrixProd const & other) =0 Copy operator. |
| virtual void | Compute(MatrixProd & Mat, DDMat *restrict V0 =nullptr) =0 Computes the FSAI preconditioner in a distributed memory environment. |
| virtual void | Compute(DSMat & mat_A, DDMat *restrict V0 =nullptr) =0 Computes the preconditioner in a distributed memory environment. |
| virtual bool | isOnGPU() const =0 Check if the matrix is on GPU. |
Protected Functions
| Name | |
|---|---|
| virtual iGlo | Get_Globalnrows_inner() const Retrieve the global number of rows. |
| virtual bool | Check_inner() const |
| void | copy_aFSAI(aFSAI const & other) Copy members. |
Protected Attributes
| Name | |
|---|---|
| aFSAI_params | params aFSAI parameters. |
| DSMat * | MatGL FSAI factor (lower part). |
| DSMat * | MatGU FSAI factor transposed (upper part). |
| DSMat * | MatGL2 second FSAI factor (lower part). |
| DSMat * | MatGU2 sencond FSAI factor transposed (upper part). |
| DDMat * | scrMxV scratch DDMat for FSAI application. |
| struct aFSAI_OperInfo | OperInfo Operator information. |
| struct aFSAI_TimeInfo | TimeInfo Set-up wall time of the aFSAI components. |
Additional inherited members
Public Functions inherited from Preconditioner
| Name | |
|---|---|
| virtual | ~Preconditioner() =0 Deletes the object. |
Protected Functions inherited from Preconditioner
| Name | |
|---|---|
| void | copy_Preconditioner(Preconditioner const & other) Copy members. |
Public Functions inherited from MatrixProd
| Name | |
|---|---|
| bool | get_Prepared_flag() const Get flag for MxV prepare. |
| iReg | get_nRHS_prep() const Get the number of rhs the matrix is prepared for. |
| iGlo | Get_Globalnrows() const Retrieve the global number of rows using internal variable. |
| iGlo | Get_Globalnrows() Retrieve the global number of rows using internal variable. |
| void | set_Prepared_flag(const bool input_Prepared_flag) Get flag for MxV prepare. |
| bool | Check() Checks that the MatrixProd instance has been correctly constructed. |
| virtual | ~MatrixProd() =0 Deletes the object. |
Protected Functions inherited from MatrixProd
| Name | |
|---|---|
| void | copy_MatrixProd(MatrixProd const & other) Copy members. |
Protected Attributes inherited from MatrixProd
| Name | |
|---|---|
| iGlo | glob_nrows total number of rows (matrix size). |
| bool | Prepared_flag flag for MxV prepare. |
| iReg | nRHS_prep number of rhs the matrix is prepared for |
Detailed Description
class aFSAI;
This class is used to manage the adaptive FSAI preconditioner for SPD.
class aFSAI.
Public Functions Documentation
function Prepare_MxV
virtual void Prepare_MxV(
const iReg nRHS
)
Prepares the preconditioner application to a vector (DDMat).
Parameters:
- nRHS number of Right Hand Sides.
Reimplements: Preconditioner::Prepare_MxV
function UndoPrepare_MxV
virtual void UndoPrepare_MxV()
Undo the data structure necessary for MxV.
Reimplements: Preconditioner::UndoPrepare_MxV
function MxV
virtual void MxV(
DDMat & RHS,
DDMat & SOL,
bool Barrier_flag
)
Applies the preconditioner to a vetor (DDMat): prec(A9 * RHS = SOL.
Parameters:
- RHS vector that multiplies the Preconditioner.
- SOL vector where result is stored.
- Barrier_flag if true global Barrier is called before return.
Reimplements: Preconditioner::MxV
function MxM
virtual void MxM(
DSMat & Mat,
DSMat & PrecMat
)
Applies the preconditioner to a matrix (DSMat).
Parameters:
- Mat system matrix.
- PrecMat.
Reimplements: Preconditioner::MxM
function MxM_double
void MxM_double(
DSMat & Mat,
DSMat & PrecMat
)
Applies the doble preconditioner to a matrix (DSMat).
Parameters:
- Mat system matrix.
- PrecMat.
function LowLeft_MxM
void LowLeft_MxM(
DSMat & Mat,
DSMat & PrecMat
)
Applies the lower FSAI factor to the left of an input matrix (DSMat).
Parameters:
- Mat system matrix.
- PrecMat.
function LowRight_MxM
void LowRight_MxM(
DSMat & Mat,
DSMat & PrecMat
)
Applies the lower FSAI factor to the right of an input matrix (DSMat).
Parameters:
- Mat system matrix.
- PrecMat.
function UppLeft_MxM
void UppLeft_MxM(
DSMat & Mat,
DSMat & PrecMat
)
Applies the upper FSAI factor to the left of an input matrix (DSMat).
Parameters:
- Mat system matrix.
- PrecMat.
function UppRight_MxM
void UppRight_MxM(
DSMat & Mat,
DSMat & PrecMat
)
Applies the upper FSAI factor to the right of an input matrix (DSMat).
Parameters:
- Mat system matrix.
- PrecMat.
function get_nrows
virtual iReg get_nrows() const
Retrieve the number of rows.
Reimplements: Preconditioner::get_nrows
function Get_nnz
virtual iExt Get_nnz() const
Returns an estimate of the number of non-zeroes of the preconditioner application.
Reimplements: Preconditioner::Get_nnz
function get_MatGL
DSMat * get_MatGL()
Get FSAI factor (lower part).
function get_MatGU
DSMat * get_MatGU()
Get FSAI factor transposed (upper part).
function get_MatGL2
DSMat * get_MatGL2()
Get second FSAI factor (lower part).
function get_MatGU2
DSMat * get_MatGU2()
Get second FSAI factor transposed (upper part).
function Get_FlopEst
virtual long int Get_FlopEst() const
Returns an estimate of the number of FLOPS needed to perform the preconditioner application.
Reimplements: Preconditioner::Get_FlopEst
function Set_Parameters
virtual void Set_Parameters(
const void * params
)
Sets the aFSAI parameters.
Parameters:
- params input parameters.
Reimplements: Preconditioner::Set_Parameters
function SetParms_from_XML
void SetParms_from_XML(
xml_document & input_xml
)
Sets the aFSAI parameters from the XML input file.
Parameters:
- input_xml
function DumpAllParms
virtual void DumpAllParms(
FILE * ofile
) const
Dumps all of the FSAI parameters.
Reimplements: Preconditioner::DumpAllParms
function Print_ASCII
virtual void Print_ASCII(
const string & filename
) const
Prints the Operator in ASCII format.
Reimplements: Preconditioner::Print_ASCII
function Print_GL
void Print_GL(
const string & filename
) const
Prints the GL part of the preconditioner.
function Print_GU
void Print_GU(
const string & filename
) const
Prints the GU part of the preconditioner.
function Print_GL2
void Print_GL2(
const string & filename
) const
Prints the second GL part of the preconditioner.
function Print_GU2
void Print_GU2(
const string & filename
) const
Prints the second GU part of the preconditioner.
function aFSAI
aFSAI()
Constructs the object.
function operator=
aFSAI & operator=(
aFSAI const & other
)
Copy operator.
function print_OperStats
void print_OperStats(
FILE * ofile
)
Prints aFSAI info.
Parameters:
- *ofile output file.
function print_Times
void print_Times(
FILE * ofile
)
Prints the times needed to compute the aFSAI.
Parameters:
- *ofile output file.
function Set_default
int Set_default()
Sets default configuration for cfd problems.
Return: 0 → no errors 1 → wrong input data
function Set_CompType
int Set_CompType(
const int CompType
)
Sets the computation type.
Return: 0 → no errors 1 → wrong input data
function Set_GatherType
int Set_GatherType(
const int GatherType
)
Sets the gathering type.
Return: 0 → no errors 1 → wrong input data
function Set_BPowerDistK
int Set_BPowerDistK(
const int BPowerDistK
)
Sets the power used to build aFSAI.
Return: 0 → no errors 1 → wrong input data
function Set_nstep
int Set_nstep(
const int nstep
)
Sets the number of steps used to build aFSAI (adaptive).
Return: 0 → no errors 1 → wrong input data
function Set_step_size
int Set_step_size(
const int step_size
)
Sets the number of entries added for each row at each step (adaptive).
Return: 0 → no errors 1 → wrong input data
function Set_epsilon
int Set_epsilon(
const double epsilon
)
Sets the exit tolerance used in the adaptive procedure (adaptive).
Return: 0 → no errors 1 → wrong input data
function Set_tau_pref
int Set_tau_pref(
const double tau_pref
)
Sets the pre-filtering Drop tolerance (static).
Return: 0 → no errors 1 → wrong input data
function Set_pow_patt
int Set_pow_patt(
const int pow_patt
)
Sets the power of the static pattern (static).
Return: 0 → no errors 1 → wrong input data
function Set_nnzr_max
int Set_nnzr_max(
const int nnzr_max
)
Sets the maximum number of non-zeros per row (static).
Return: 0 → no errors 1 → wrong input data
function Set_tau_posf
int Set_tau_posf(
const double tau_posf
)
Sets the post-filtering Drop tolerance (static).
Return: 0 → no errors 1 → wrong input data
function Set_tau_double
int Set_tau_double(
const double tau_double
)
Sets the filtering tolerance for double FSAI.
Return: > 0 → represents the average non-zeroes per row to retain <= 0 → represents just a filtering tolerance (abs value)
function setDefaultParameters
void setDefaultParameters()
Set default parameters.
Parameters:
- paramsOut aFSAI parameters
function ~aFSAI
virtual ~aFSAI() =0
Deletes the object.
function copy
virtual void copy(
MatrixProd const & other
) =0
Copy operator.
Reimplements: Preconditioner::copy
Reimplemented by: aFSAI_CPU::copy
function Compute
virtual void Compute(
MatrixProd & Mat,
DDMat *__restrict__ V0 =nullptr
) =0
Computes the FSAI preconditioner in a distributed memory environment.
Parameters:
- Mat system matrix.
Reimplements: Preconditioner::Compute
Reimplemented by: aFSAI_CPU::Compute
function Compute
virtual void Compute(
DSMat & mat_A,
DDMat *__restrict__ V0 =nullptr
) =0
Computes the preconditioner in a distributed memory environment.
Parameters:
- mat_A system matrix.
Reimplements: Preconditioner::Compute
Reimplemented by: aFSAI_CPU::Compute
function isOnGPU
virtual bool isOnGPU() const =0
Check if the matrix is on GPU.
Reimplements: Preconditioner::isOnGPU
Reimplemented by: aFSAI_CPU::isOnGPU
Protected Functions Documentation
function Get_Globalnrows_inner
virtual iGlo Get_Globalnrows_inner() const
Retrieve the global number of rows.
Reimplements: Preconditioner::Get_Globalnrows_inner
function Check_inner
virtual bool Check_inner() const
Reimplements: Preconditioner::Check_inner
Internal check of consistency of the aFSAI instance.
function copy_aFSAI
void copy_aFSAI(
aFSAI const & other
)
Copy members.
Protected Attributes Documentation
variable params
aFSAI_params params;
aFSAI parameters.
variable MatGL
DSMat * MatGL = nullptr;
FSAI factor (lower part).
variable MatGU
DSMat * MatGU = nullptr;
FSAI factor transposed (upper part).
variable MatGL2
DSMat * MatGL2 = nullptr;
second FSAI factor (lower part).
variable MatGU2
DSMat * MatGU2 = nullptr;
sencond FSAI factor transposed (upper part).
variable scrMxV
DDMat * scrMxV = nullptr;
scratch DDMat for FSAI application.
variable OperInfo
struct aFSAI_OperInfo OperInfo;
Operator information.
variable TimeInfo
struct aFSAI_TimeInfo TimeInfo;
Set-up wall time of the aFSAI components.
Updated on 19 November 2024 at 10:20:48 CET