Hex: GPUCGPreconditioner Class Reference

| Hex 2.2 Hydrogen-electron collision solver

Public Member Functions | Data Fields | Protected Attributes
GPUCGPreconditioner Class Reference

KPA-preconditioned CG-preconditioner. More...

`#include <GPUPreconditioner.h>`

Inheritance diagram for GPUCGPreconditioner:
[legend]
Collaboration diagram for GPUCGPreconditioner:
[legend]

## Public Member Functions

| preconditionerRunTimeSelectionDefinitions (GPUCGPreconditioner, "GPU") typedef struct sData
| GPUCGPreconditioner ()
| GPUCGPreconditioner (CommandLine const &cmd, InputFile const &inp, Parallel const &par, AngularBasis const &ang, Bspline const &bspline_inner, Bspline const &bspline_full, Bspline const &bspline_panel_x, Bspline const &bspline_panel_y)
virtual std::string | description () const
| Description of the preconditioner. More...
virtual void | setup ()
| Initialize the preconditioner. More...
virtual void | finish ()
| Clean up memory etc. More...
virtual void | multiply (BlockArray< Complex > const &p, BlockArray< Complex > &q, MatrixSelection::Selection tri) const
| Multiply by the matrix equation. More...
virtual void | precondition (BlockArray< Complex > const &r, BlockArray< Complex > &z) const
| Precondition the equation. More...
Public Member Functions inherited from KPACGPreconditioner
| preconditionerRunTimeSelectionDefinitions (KPACGPreconditioner, "KPA") KPACGPreconditioner()
| KPACGPreconditioner (CommandLine const &cmd, InputFile const &inp, Parallel const &par, AngularBasis const &ang, Bspline const &bspline_inner, Bspline const &bspline_full, Bspline const &bspline_panel_x, Bspline const &bspline_panel_y)
virtual | ~KPACGPreconditioner ()
virtual void | CG_init (int iblock) const
virtual void | CG_prec (int iblock, const cArrayView r, cArrayView z) const
virtual void | CG_exit (int iblock) const
Public Member Functions inherited from CGPreconditioner
| preconditionerRunTimeSelectionDefinitions (CGPreconditioner, "cg") CGPreconditioner()
| CGPreconditioner (CommandLine const &cmd, InputFile const &inp, Parallel const &par, AngularBasis const &ang, Bspline const &bspline_inner, Bspline const &bspline_full, Bspline const &bspline_panel_x, Bspline const &bspline_panel_y)
int | solve_block (int ill, const cArrayView r, cArrayView z) const
virtual void | CG_mmul (int iblock, const cArrayView p, cArrayView q) const
virtual Real | CG_compute_norm (const cArrayView a) const
virtual Complex | CG_scalar_product (const cArrayView a, const cArrayView b) const
virtual void | CG_axby_operation (Complex a, cArrayView x, Complex b, const cArrayView y) const
virtual void | CG_constrain (cArrayView r) const
Public Member Functions inherited from NoPreconditioner
| preconditionerRunTimeSelectionDefinitions (NoPreconditioner, "none") NoPreconditioner()
| NoPreconditioner (CommandLine const &cmd, InputFile const &inp, Parallel const &par, AngularBasis const &ang, Bspline const &bspline_inner, Bspline const &bspline_full, Bspline const &bspline_panel_x, Bspline const &bspline_panel_y)
| ~NoPreconditioner ()
virtual void | update (Real E)
| Update the preconditioner for the next energy. More...
virtual std::pair< int, int > | bstates (Real E, int l1, int l2) const
| Get the number of allowed bound states. More...
virtual void | rhs (BlockArray< Complex > &chi, int ienergy, int instate) const
| Calculate the right-hand side. More...
BlockSymBandMatrix< Complex > | calc_A_block (int ill, int illp, bool twoel=true) const
RadialIntegrals const & | rad_inner () const
RadialIntegrals const & | rad_full () const
RadialIntegrals const & | rad_panel () const
Public Member Functions inherited from PreconditionerBase
| baseClassRunTimeSelectionDefinitions (PreconditionerBase,(CommandLine const &cmd, InputFile const &inp, Parallel const &par, AngularBasis const &ang, Bspline const &bspline_inner, Bspline const &bspline_full, Bspline const &bspline_panel_x, Bspline const &bspline_panel_y)) PreconditionerBase()
| Dummy default constructor needed by the run-time selection. More...
virtual | ~PreconditionerBase ()
| Virtual destructor. More...
virtual void | verbose (bool b)
| Set verbosity level. More...

## Data Fields

| Data

## Protected Attributes

cl_platform_id | platform_
cl_device_id | device_
cl_context | context_
cl_command_queue | queue_
cl_program | program_
std::size_t | Nlocal_
std::size_t | blocksize_
cl_mem_flags | smallDataFlags_
cl_mem_flags | largeDataFlags_
cl_kernel | mabt_
cl_kernel | mml1_
cl_kernel | mml2_dcpl_
cl_kernel | mml2_cpld_
cl_kernel | mml2_dcpl_offset_
cl_kernel | mml2_cpld_offset_
cl_kernel | axby_
cl_kernel | norm_
cl_kernel | spro_
cl_kernel | krdv_
clArray< Complex > | tmp_
clArray< Complex > | tmA_
clArray< Real > | nrm_
clArrayView< Complex > | t_inner_a_
clArrayView< Complex > | t_inner_p_
clArrayView< Complex > | S_inner_a_
clArrayView< Complex > | D_inner_a_
clArrayView< Complex > | Mm1_inner_a_
clArrayView< Complex > | Mm2_inner_a_
clArrayView< Complex > | S_inner_p_
clArrayView< Complex > | D_inner_p_
clArrayView< Complex > | Mm1_inner_p_
clArrayView< Complex > | Mm2_inner_p_
std::vector< clArrayView< Complex > > | M_L_inner_a_
std::vector< clArrayView< Complex > > | M_mLm1_inner_a_
std::vector< clArrayView< Complex > > | M_L_inner_p_
std::vector< clArrayView< Complex > > | M_mLm1_inner_p_
std::vector< clArrayView< LU_int_t > > | R_coupled_p_
std::vector< clArrayView< LU_int_t > > | R_coupled_i_
std::vector< clArrayView< Complex > > | R_coupled_x_
cl_short | nsrcseg_
cl_short | ndstseg_
Protected Attributes inherited from KPACGPreconditioner
iArray | refcount_atom_
iArray | refcount_proj_
cArrays | workspace_
Protected Attributes inherited from CGPreconditioner
iArray | n_
std::size_t | us_axby_
std::size_t | us_mmul_
std::size_t | us_norm_
std::size_t | us_prec_
std::size_t | us_spro_
Protected Attributes inherited from NoPreconditioner
Real | E_
CommandLine const * | cmd_
Parallel const * | par_
InputFile const * | inp_
AngularBasis const * | ang_
std::vector< BlockSymBandMatrix< Complex > > | A_blocks_
std::vector< std::vector< SymBandMatrix< Complex > > > | B1_blocks_
std::vector< std::vector< SymBandMatrix< Complex > > > | B2_blocks_
std::vector< CooMatrix< LU_int_t, Complex > > | Cu_blocks_
std::vector< CooMatrix< LU_int_t, Complex > > | Cl_blocks_
std::vector< BlockSymBandMatrix< Complex > > | E_blocks_
std::vector< CooMatrix< LU_int_t, Complex > > | Fu_blocks_
std::vector< CooMatrix< LU_int_t, Complex > > | Fl_blocks_
int | max_n_
std::vector< std::pair< int, int > > | Nchan_
RadialIntegrals * | rad_inner_
RadialIntegrals * | rad_full_
RadialIntegrals * | rad_panel_
std::array< Array< cArrays >, 2 > | Xp_
std::array< Array< cArrays >, 2 > | Sp_
std::array< cArrays, 2 > | Eb_
std::array< std::vector< HlData >, 2 > | Hl_
std::shared_ptr< LUft > | luS_
Protected Attributes inherited from PreconditionerBase
bool | verbose_

## Additional Inherited Members

Protected Member Functions inherited from KPACGPreconditioner
void | lock_kpa_access () const
void | unlock_kpa_access () const

## Detailed Description

This nested preconditioner simplifies the Hamiltonian matrix by omitting electron-electron interaction. The block of the matrix can then be written as a sum of simple Kronecker products

\[ \mathsf{A} = E\mathsf{S}\otimes\mathsf{S} - \mathsf{H}_1\otimes\mathsf{S} - \mathsf{S}\otimes\mathsf{H}_2 \,, \]

which can be easily diagonalized (only diagonalization of the small matrices are needed) and so also inverted, which we need for solution of the equations.

## Constructor & Destructor Documentation

## ◆ GPUCGPreconditioner() [1/2]

GPUCGPreconditioner::GPUCGPreconditioner | ( |  | ) |

inline

## ◆ GPUCGPreconditioner() [2/2]

GPUCGPreconditioner::GPUCGPreconditioner | ( | CommandLine const & | cmd,
|  | InputFile const & | inp,
|  | Parallel const & | par,
|  | AngularBasis const & | ang,
|  | Bspline const & | bspline_inner,
|  | Bspline const & | bspline_full,
|  | Bspline const & | bspline_panel_x,
|  | Bspline const & | bspline_panel_y
| ) |  |

inline

## Member Function Documentation

## ◆ description()

std::string GPUCGPreconditioner::description | ( |  | ) | const

virtual

Simple documentation of the preconditioner.

Reimplemented from KPACGPreconditioner.

## ◆ finish()

void GPUCGPreconditioner::finish | ( |  | ) |

virtual

This function is called when the preconditioner will no longer be used to release resources. To re-enable the same preconditioner then would require a new call to setup.

Reimplemented from KPACGPreconditioner.

## ◆ multiply()

void GPUCGPreconditioner::multiply | ( | BlockArray< Complex > const & | p,
|  | BlockArray< Complex > & | q,
|  | MatrixSelection::Selection | tri
| ) |  | const

virtual

This function implements matrix multiplication by the matrix of the set of equations that is to be solved.

Reimplemented from NoPreconditioner.

## ◆ precondition()

void GPUCGPreconditioner::precondition | ( | BlockArray< Complex > const & | r,
|  | BlockArray< Complex > & | z
| ) |  | const

virtual

This function preconditions the equation, solving the preconditioner equation

\[ \mathbf{M}\mathbf{z} = \mathbf{r} \ . \]

It may use the MPI environment.

Reimplemented from CGPreconditioner.

## ◆ preconditionerRunTimeSelectionDefinitions()

GPUCGPreconditioner::preconditionerRunTimeSelectionDefinitions | ( | GPUCGPreconditioner | ,
|  | "GPU" |
| ) |  |

inline

Link the structure to a disk file.

Try to load data from a disk file.

Save data to disk.

One-electron hamiltonian diagonalization.

Diagonal parts of one-electron hamiltonians.

Filename.

## ◆ setup()

void GPUCGPreconditioner::setup | ( |  | ) |

virtual

This function contains all computation intensive preparations for the preconditioner, e.g. computation of radial integrals. It may use only SMP environment.

Reimplemented from KPACGPreconditioner.

## Field Documentation

## ◆ axby_

cl_kernel GPUCGPreconditioner::axby_

protected

## ◆ blocksize_

std::size_t GPUCGPreconditioner::blocksize_

protected

## ◆ context_

cl_context GPUCGPreconditioner::context_

protected

## ◆ D_inner_a_

clArrayView<Complex> GPUCGPreconditioner::D_inner_a_

protected

## ◆ D_inner_p_

clArrayView<Complex> GPUCGPreconditioner::D_inner_p_

protected

## ◆ Data

GPUCGPreconditioner::Data

## ◆ device_

cl_device_id GPUCGPreconditioner::device_

protected

## ◆ krdv_

cl_kernel GPUCGPreconditioner::krdv_

protected

## ◆ largeDataFlags_

cl_mem_flags GPUCGPreconditioner::largeDataFlags_

protected

## ◆ M_L_inner_a_

std::vector<clArrayView<Complex> > GPUCGPreconditioner::M_L_inner_a_

protected

## ◆ M_L_inner_p_

std::vector<clArrayView<Complex> > GPUCGPreconditioner::M_L_inner_p_

protected

## ◆ M_mLm1_inner_a_

std::vector<clArrayView<Complex> > GPUCGPreconditioner::M_mLm1_inner_a_

protected

## ◆ M_mLm1_inner_p_

std::vector<clArrayView<Complex> > GPUCGPreconditioner::M_mLm1_inner_p_

protected

## ◆ mabt_

cl_kernel GPUCGPreconditioner::mabt_

protected

## ◆ Mm1_inner_a_

clArrayView<Complex> GPUCGPreconditioner::Mm1_inner_a_

protected

## ◆ Mm1_inner_p_

clArrayView<Complex> GPUCGPreconditioner::Mm1_inner_p_

protected

## ◆ Mm2_inner_a_

clArrayView<Complex> GPUCGPreconditioner::Mm2_inner_a_

protected

## ◆ Mm2_inner_p_

clArrayView<Complex> GPUCGPreconditioner::Mm2_inner_p_

protected

## ◆ mml1_

cl_kernel GPUCGPreconditioner::mml1_

protected

## ◆ mml2_cpld_

cl_kernel GPUCGPreconditioner::mml2_cpld_

protected

## ◆ mml2_cpld_offset_

cl_kernel GPUCGPreconditioner::mml2_cpld_offset_

protected

## ◆ mml2_dcpl_

cl_kernel GPUCGPreconditioner::mml2_dcpl_

protected

## ◆ mml2_dcpl_offset_

cl_kernel GPUCGPreconditioner::mml2_dcpl_offset_

protected

## ◆ ndstseg_

cl_short GPUCGPreconditioner::ndstseg_

protected

## ◆ Nlocal_

std::size_t GPUCGPreconditioner::Nlocal_

protected

## ◆ norm_

cl_kernel GPUCGPreconditioner::norm_

protected

## ◆ nrm_

clArray<Real> GPUCGPreconditioner::nrm_

mutableprotected

## ◆ nsrcseg_

cl_short GPUCGPreconditioner::nsrcseg_

protected

## ◆ platform_

cl_platform_id GPUCGPreconditioner::platform_

protected

## ◆ program_

cl_program GPUCGPreconditioner::program_

protected

## ◆ queue_

cl_command_queue GPUCGPreconditioner::queue_

protected

## ◆ R_coupled_i_

std::vector<clArrayView<LU_int_t> > GPUCGPreconditioner::R_coupled_i_

protected

## ◆ R_coupled_p_

std::vector<clArrayView<LU_int_t> > GPUCGPreconditioner::R_coupled_p_

protected

## ◆ R_coupled_x_

std::vector<clArrayView<Complex> > GPUCGPreconditioner::R_coupled_x_

protected

## ◆ S_inner_a_

clArrayView<Complex> GPUCGPreconditioner::S_inner_a_

protected

## ◆ S_inner_p_

clArrayView<Complex> GPUCGPreconditioner::S_inner_p_

protected

## ◆ smallDataFlags_

cl_mem_flags GPUCGPreconditioner::smallDataFlags_

protected

## ◆ spro_

cl_kernel GPUCGPreconditioner::spro_

protected

## ◆ t_inner_a_

clArrayView<Complex> GPUCGPreconditioner::t_inner_a_

protected

## ◆ t_inner_p_

clArrayView<Complex> GPUCGPreconditioner::t_inner_p_

protected

## ◆ tmA_

clArray<Complex> GPUCGPreconditioner::tmA_

mutableprotected

## ◆ tmp_

clArray<Complex> GPUCGPreconditioner::tmp_

mutableprotected

The documentation for this class was generated from the following files:

- src/preconditioners/GPUPreconditioner.h
- src/preconditioners/GPUPreconditioner.cpp