TABLE OF CONTENTS


ABINIT/m_xgTools [ Modules ]

[ Top ] [ Modules ]

NAME

  m_xgTools

FUNCTION

 This is a module to manage and help developer with 2D arrays for low level routines.
 Particularly, it manages memory for allocations and deallocations (see xg_routines),
 It handles MPI, complex and real values (*8 kind only) automatically.
 It is also possible to build sub-block of an array and work on it very easily (see xgBlock_routines)
 Several routines are also available for performing blas/lapack which again
 manage the type and MPI (and openmp if needed)
 Almost all routines are timed by abinit timers
 This is a starting point and has to be improved/developed
 An example of how to use those types and routines can be found in
 30_diago/m_lobpcg2.F90. This is a full rewrite of LOBPCG algorithm which uses
 only these types to perfom calculations.

COPYRIGHT

  Copyright (C) 2016-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

NOTES

PARENTS

CHILDREN

SOURCE

 33 #if defined HAVE_CONFIG_H
 34 #include "config.h"
 35 #endif
 36 
 37 #include "abi_common.h"
 38 
 39 module m_xg
 40 
 41   use m_errors
 42   use m_abicore
 43 
 44   use defs_basis, only : std_err, std_out
 45   use m_time,     only: timab
 46   use m_xmpi,     only : xmpi_sum
 47 
 48 
 49   implicit none
 50 
 51   private
 52 
 53   integer, parameter, public :: SPACE_R = 1
 54   integer, parameter, public :: SPACE_C = 2
 55   integer, parameter, public :: SPACE_CR = 3
 56 
 57   integer, parameter :: tim_potrf = 1670
 58   integer, parameter :: tim_trsm  = 1671
 59   integer, parameter :: tim_gemm  = 1672
 60   integer, parameter :: tim_set   = 1673
 61   integer, parameter :: tim_get   = 1674
 62   integer, parameter :: tim_heev  = 1675
 63   integer, parameter :: tim_heevd = 1676
 64   integer, parameter :: tim_hpev  = 1677
 65   integer, parameter :: tim_hpevd = 1678
 66   integer, parameter :: tim_hegv  = 1679
 67   integer, parameter :: tim_hegvx = 1680
 68   integer, parameter :: tim_hegvd = 1681
 69   integer, parameter :: tim_hpgv  = 1682
 70   integer, parameter :: tim_hpgvx = 1683
 71   integer, parameter :: tim_hpgvd = 1684
 72   integer, parameter :: tim_copy  = 1685
 73   integer, parameter :: tim_cshift= 1686
 74   integer, parameter :: tim_pack  = 1687
 75 
 76   integer, save, private :: lrwork = 0
 77   integer, save, private :: lcwork = 0
 78   integer, save, private :: liwork = 0
 79   integer, allocatable,  save, private :: iwork(:)
 80   double precision, allocatable, save, private :: rwork(:)
 81   complex(kind= 8), allocatable, save, private :: cwork(:)
 82 
 83   type, public :: xgBlock_t
 84     integer, private :: space
 85     integer, private :: rows
 86     integer, private :: LDim
 87     integer, private :: cols
 88     character, public :: trans
 89     character, public :: normal
 90     integer, private :: spacedim_comm
 91     double precision, pointer, private :: vecR(:,:) => null()
 92     complex(kind=8) , pointer, private :: vecC(:,:) => null()
 93   end type xgBlock_t
 94 
 95   type, public :: xg_t
 96     integer, private :: space
 97     integer, private :: rows
 98     integer, private :: cols
 99     character, public :: trans
100     character, public :: normal
101     integer, private :: spacedim_comm
102     double precision, allocatable, private :: vecR(:,:)
103     complex(kind=8) , allocatable, private :: vecC(:,:)
104     type(xgBlock_t), public :: self
105   end type xg_t
106 
107   interface xgBlock_gemm
108     module procedure xgBlock_gemmR
109     module procedure xgBlock_gemmC
110   end interface
111 
112   interface xgBlock_colwiseMul
113     module procedure xgBlock_colwiseMulR
114     module procedure xgBlock_colwiseMulC
115   end interface
116 
117   interface xgBlock_trsm
118     module procedure xgBlock_trsmR
119     module procedure xgBlock_trsmC
120   end interface
121 
122   interface xgBlock_scale
123     module procedure xgBlock_scaleR
124     module procedure xgBlock_scaleC
125   end interface
126 
127   interface checkResize
128     module procedure checkResizeI
129     module procedure checkResizeR
130     module procedure checkResizeC
131   end interface
132 
133   public :: space
134   public :: cols
135   private :: getClocR
136   private :: getClocC
137   private :: checkResize
138 
139   public :: xg_init
140   public :: xg_set
141   public :: xg_get
142   public :: xg_setBlock
143   public :: xg_free
144 
145   public :: xgBlock_setBlock
146   public :: xgBlock_set
147   public :: xgBlock_map
148   public :: xgBlock_reverseMap
149   public :: xgBlock_get
150   public :: xgBlock_copy
151   public :: xgBlock_pack
152   public :: xgBlock_getSize
153 
154   public :: xgBlock_potrf
155   public :: xgBlock_trsm
156 
157   public :: xgBlock_heev
158   public :: xgBlock_heevd
159 
160   public :: xgBlock_hpev
161   public :: xgBlock_hpevd
162 
163   public :: xgBlock_hegv
164   public :: xgBlock_hegvx
165   public :: xgBlock_hegvd
166 
167   public :: xgBlock_hpgv
168   public :: xgBlock_hpgvx
169   public :: xgBlock_hpgvd
170 
171   public :: xgBlock_gemm
172   public :: xgBlock_add
173   public :: xgBlock_cshift
174   public :: xgBlock_colwiseNorm2
175   public :: xgBlock_colwiseCaxmy
176   public :: xgBlock_colwiseMul
177   public :: xgBlock_scale
178 
179   public :: xgBlock_zero
180   public :: xgBlock_one
181   public :: xgBlock_diagonal
182   public :: xgBlock_diagonalOnly
183 
184   public :: xgBlock_average
185   public :: xgBlock_deviation
186 
187   public :: xgBlock_reshape
188   public :: xgBlock_print
189   public :: xg_finalize
190 
191 
192   contains

m_xg/checkResizeC [ Functions ]

[ Top ] [ Functions ]

NAME

 checkResizeC

m_xg/checkResizeI [ Functions ]

[ Top ] [ Functions ]

NAME

 checkResizeI

m_xg/checkResizeR [ Functions ]

[ Top ] [ Functions ]

NAME

 checkResizeR

m_xg/cols [ Functions ]

[ Top ] [ Functions ]

NAME

 cols

m_xg/getClocC [ Functions ]

[ Top ] [ Functions ]

NAME

 getClocC

m_xg/getClocR [ Functions ]

[ Top ] [ Functions ]

NAME

 getClocR

m_xg/space [ Functions ]

[ Top ] [ Functions ]

NAME

 space

m_xg/xg_finalize [ Functions ]

[ Top ] [ Functions ]

NAME

 xg_finalize

m_xg/xg_free [ Functions ]

[ Top ] [ Functions ]

NAME

 xg_free

m_xg/xg_get [ Functions ]

[ Top ] [ Functions ]

NAME

 xg_get

m_xg/xg_init [ Functions ]

[ Top ] [ Functions ]

NAME

 xg_init

m_xg/xg_set [ Functions ]

[ Top ] [ Functions ]

NAME

 xg_set

m_xg/xg_setBlock [ Functions ]

[ Top ] [ Functions ]

NAME

 xg_setBlock

m_xg/xgBlock_add [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_add

m_xg/xgBlock_average [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_average

m_xg/xgBlock_colwiseCaxmy [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_colwiseCaxmy

m_xg/xgBlock_colwiseMulC [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_colwiseMulC

m_xg/xgBlock_colwiseMulR [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_colwiseMulR

m_xg/xgBlock_colwiseNorm2 [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_colwiseNorm2

m_xg/xgBlock_copy [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_copy

m_xg/xgBlock_cshift [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_cshift

m_xg/xgBlock_deviation [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_deviation

m_xg/xgBlock_diagonal [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_diagonal

m_xg/xgBlock_diagonalOnly [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_diagonalOnly

m_xg/xgBlock_gemmC [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_gemmC

m_xg/xgBlock_gemmR [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_gemmR

m_xg/xgBlock_get [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_get

m_xg/xgBlock_getSize [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_getSize

m_xg/xgBlock_heev [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_heev

m_xg/xgBlock_heevd [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_heevd

m_xg/xgBlock_hegvd [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_hegvd

m_xg/xgBlock_hegvx [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_hegvx

m_xg/xgBlock_hgev [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_hgev

m_xg/xgBlock_hpev [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_hpev

m_xg/xgBlock_hpevd [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_hpevd

m_xg/xgBlock_hpgv [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_hpgv

m_xg/xgBlock_hpgvd [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_hpgvd

m_xg/xgBlock_hpgvx [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_hpgvx

m_xg/xgBlock_map [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_map

m_xg/xgBlock_one [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_one

m_xg/xgBlock_pack [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_pack

m_xg/xgBlock_potrf [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_potrf

m_xg/xgBlock_print [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_print

m_xg/xgBlock_reshape [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_reshape

m_xg/xgBlock_reverseMap [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_reverseMap

m_xg/xgBlock_scaleC [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_scaleC

m_xg/xgBlock_scaleR [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_scaleR

m_xg/xgBlock_set [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_set

m_xg/xgBlock_setBlock [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_setBlock

m_xg/xgBlock_trsmC [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_trsmC

m_xg/xgBlock_trsmR [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_trsmR

m_xg/xgBlock_zero [ Functions ]

[ Top ] [ Functions ]

NAME

 xgBlock_zero