SolverParametersModule Module

A Module For Storing The Parameters For Iterative Solvers.



Contents


Variables

TypeVisibility AttributesNameInitial
real(kind=NTREAL), public, parameter:: CONVERGENCE_DIFF_CONST =1e-6

The default convergence difference.

integer, public, parameter:: MAX_ITERATIONS_CONST =1000

The default maximum number of iterations.


Interfaces

public interface SolverParameters_t

  • private pure function SolverParameters_init(converge_diff_in, threshold_in, max_iterations_in, be_verbose_in, BalancePermutation_in, dac_base_size_in, dac_base_sparsity_in) result(this)

    Construct a data type which stores iterative solver parameters.

    Arguments

    Type IntentOptional AttributesName
    real(kind=NTREAL), intent(in), optional :: converge_diff_in

    Converge_diff_in the difference between iterations to consider a calculation converged.

    real(kind=NTREAL), intent(in), optional :: threshold_in

    The zero threshold

    integer, intent(in), optional :: max_iterations_in

    The maximum number of iterations to perform

    logical, intent(in), optional :: be_verbose_in

    Whether to print during the calculation (default = False)

    type(Permutation_t), intent(in), optional :: BalancePermutation_in

    For load balancing

    integer, intent(in), optional :: dac_base_size_in

    Base size for the divided and conquer solvers.

    real(kind=NTREAL), intent(in), optional :: dac_base_sparsity_in

    Base sparsity for the divide and conquer solvers.

    Return Value type(SolverParameters_t)


Derived Types

type, public :: SolverParameters_t

A class for passing parameters to an iterative solver.

Components

TypeVisibility AttributesNameInitial
real(kind=NTREAL), public :: converge_diff

When do we consider a calculation converged.

integer, public :: max_iterations

Maximum number of iterations of a solver before termination.

real(kind=NTREAL), public :: threshold

Threshold for sparse multiplication and addition.

logical, public :: be_verbose

If true, the sparse solver prints out information each loop iteration.

logical, public :: do_load_balancing

If true, the sparse solver will try and load balance before calculation.

type(Permutation_t), public :: BalancePermutation

The permutation used for load balancing.

integer, public :: dac_base_size

For the divide and conquer solvers when to switch to a dense solver.

real(kind=NTREAL), public :: dac_base_sparsity

For the divide and conquer solvers when to switch to a dense solver.

Constructor

private pure function SolverParameters_init(converge_diff_in, threshold_in, max_iterations_in, be_verbose_in, BalancePermutation_in, dac_base_size_in, dac_base_sparsity_in)

Construct a data type which stores iterative solver parameters.


Subroutines

public subroutine SetParametersConvergeDiff(this, new_value)

Set the value of the convergence difference.

Arguments

Type IntentOptional AttributesName
type(SolverParameters_t), intent(inout) :: this

The parameter object.

real(kind=NTREAL), intent(in) :: new_value

Value to set it to.

public subroutine SetParametersMaxIterations(this, new_value)

Set the value of the max iterations.

Arguments

Type IntentOptional AttributesName
type(SolverParameters_t), intent(inout) :: this

The parameter object.

integer, intent(in) :: new_value

Value to set it to.

public subroutine SetParametersThreshold(this, new_value)

Set the value of the threshold.

Arguments

Type IntentOptional AttributesName
type(SolverParameters_t), intent(inout) :: this

The parameter object.

real(kind=NTREAL), intent(in) :: new_value

Value to set it to.

public subroutine SetParametersBeVerbose(this, new_value)

Set the value of the verbosity.

Arguments

Type IntentOptional AttributesName
type(SolverParameters_t), intent(inout) :: this

The parameter object.

logical, intent(in) :: new_value

Value to set it to.

public subroutine SetParametersLoadBalance(this, new_value)

Set the value of the load balance.

Arguments

Type IntentOptional AttributesName
type(SolverParameters_t), intent(inout) :: this

The parameter object.

type(Permutation_t), intent(in) :: new_value

Value to set it to.

public subroutine SetParametersDACBaseSize(this, new_value)

Set the value of the divide and conquer base size.

Arguments

Type IntentOptional AttributesName
type(SolverParameters_t), intent(inout) :: this

The parameter object.

integer, intent(in) :: new_value

Value to set it to.

public subroutine SetParametersDACBaseSparsity(this, new_value)

Set the value of the divide and conquer base sparsity.

Arguments

Type IntentOptional AttributesName
type(SolverParameters_t), intent(inout) :: this

The parameter object.

real(kind=NTREAL), intent(in) :: new_value

Value to set it to.

public subroutine PrintParameters(this)

Print out the iterative solver parameter values.

Arguments

Type IntentOptional AttributesName
type(SolverParameters_t), intent(in) :: this

The parameter object.

public subroutine DestructSolverParameters(this)

Cleanup the solver parameters datastructure.

Arguments

Type IntentOptional AttributesName
type(SolverParameters_t), intent(inout) :: this

The parameter object.