elpa1_compute_private.F90 7.55 KB
Newer Older
1
2
3
4
5
!    This file is part of ELPA.
!
!    The ELPA library was originally created by the ELPA consortium,
!    consisting of the following organizations:
!
6
7
!    - Max Planck Computing and Data Facility (MPCDF), formerly known as
!      Rechenzentrum Garching der Max-Planck-Gesellschaft (RZG),
8
9
10
11
12
!    - Bergische Universität Wuppertal, Lehrstuhl für angewandte
!      Informatik,
!    - Technische Universität München, Lehrstuhl für Informatik mit
!      Schwerpunkt Wissenschaftliches Rechnen ,
!    - Fritz-Haber-Institut, Berlin, Abt. Theorie,
13
!    - Max-Plack-Institut für Mathematik in den Naturwissenschaften,
14
15
16
17
18
19
20
21
22
!      Leipzig, Abt. Komplexe Strukutren in Biologie und Kognition,
!      and
!    - IBM Deutschland GmbH
!
!    This particular source code file contains additions, changes and
!    enhancements authored by Intel Corporation which is not part of
!    the ELPA consortium.
!
!    More information can be found here:
23
!    http://elpa.mpcdf.mpg.de/
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
!
!    ELPA is free software: you can redistribute it and/or modify
!    it under the terms of the version 3 of the license of the
!    GNU Lesser General Public License as published by the Free
!    Software Foundation.
!
!    ELPA is distributed in the hope that it will be useful,
!    but WITHOUT ANY WARRANTY; without even the implied warranty of
!    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
!    GNU Lesser General Public License for more details.
!
!    You should have received a copy of the GNU Lesser General Public License
!    along with ELPA.  If not, see <http://www.gnu.org/licenses/>
!
!    ELPA reflects a substantial effort on the part of the original
!    ELPA consortium, and we ask you to respect the spirit of the
!    license that we chose: i.e., please contribute any changes you
!    may have back to the original ELPA library distribution, and keep
!    any derivatives of ELPA under the same license that we chose for
!    the original distribution, the GNU Lesser General Public License.
!
!
! ELPA1 -- Faster replacements for ScaLAPACK symmetric eigenvalue routines
!
! Copyright of the original code rests with the authors inside the ELPA
! consortium. The copyright of any additional modifications shall rest
! with their original authors, but shall adhere to the licensing terms
! distributed along with the original code in the file "COPYING".

#include "config-f90.h"
Andreas Marek's avatar
Andreas Marek committed
54
55
!> \brief Fortran module which contains the source of ELPA 1stage
module ELPA1_COMPUTE
56
57
58
59
  use elpa_utilities
#ifdef HAVE_DETAILED_TIMINGS
  use timings
#endif
60
  use elpa_mpi
61
62
63
64
  implicit none

  PRIVATE ! set default to private

65
66
67
68
  public :: tridiag_real_double               ! Transform real symmetric matrix to tridiagonal form
  public :: tridiag_real
  public :: trans_ev_real_double              ! Transform real eigenvectors of a tridiagonal matrix back
  public :: trans_ev_real
69

70
  public :: solve_tridi_double
71
  public :: solve_tridi_double_impl
72

73
74
75
  interface tridiag_real
    module procedure tridiag_real_double
  end interface
76

77
78
79
  interface trans_ev_real
    module procedure trans_ev_real_double
  end interface
80

81
82
83
#ifdef WANT_SINGLE_PRECISION_REAL
  public :: tridiag_real_single        ! Transform real single-precision symmetric matrix to tridiagonal form
  public :: trans_ev_real_single       ! Transform real  single-precision eigenvectors of a tridiagonal matrix back
84
  public :: solve_tridi_single
85
  public :: solve_tridi_single_impl
86
#endif
87

88
89
90
91
  public :: tridiag_complex_double            ! Transform complex hermitian matrix to tridiagonal form
  public :: tridiag_complex
  public :: trans_ev_complex_double           ! Transform eigenvectors of a tridiagonal matrix back
  public :: trans_ev_complex
92

93
94
95
  interface tridiag_complex
    module procedure tridiag_complex_double
  end interface
96

97
98
99
  interface trans_ev_complex
    module procedure trans_ev_complex_double
  end interface
100

101
102
103
#ifdef WANT_SINGLE_PRECISION_COMPLEX
  public :: tridiag_complex_single     ! Transform complex single-precision hermitian matrix to tridiagonal form
  public :: trans_ev_complex_single    ! Transform complex single-precision eigenvectors of a tridiagonal matrix back
104
#endif
105

106
107
108
109
110
111
  public :: hh_transform_real_double
  public :: hh_transform_real
  public :: elpa_reduce_add_vectors_real_double
  public :: elpa_reduce_add_vectors_real
  public :: elpa_transpose_vectors_real_double
  public :: elpa_transpose_vectors_real
112

113
114
115
  interface hh_transform_real
    module procedure hh_transform_real_double
  end interface
116

117
118
119
  interface elpa_reduce_add_vectors_real
    module procedure elpa_reduce_add_vectors_real_double
  end interface
120

121
122
123
  interface elpa_transpose_vectors_real
    module procedure elpa_transpose_vectors_real_double
  end interface
124

125
126
127
128
#ifdef WANT_SINGLE_PRECISION_REAL
  public :: hh_transform_real_single
  public :: elpa_reduce_add_vectors_real_single
  public :: elpa_transpose_vectors_real_single
129
#endif
130

131
132
133
134
135
136
  public :: hh_transform_complex_double
  public :: hh_transform_complex
  public :: elpa_reduce_add_vectors_complex_double
  public :: elpa_reduce_add_vectors_complex
  public :: elpa_transpose_vectors_complex_double
  public :: elpa_transpose_vectors_complex
137

138
139
140
  interface hh_transform_complex
    module procedure hh_transform_complex_double
  end interface
141

142
143
144
  interface elpa_reduce_add_vectors_complex
    module procedure elpa_reduce_add_vectors_complex_double
  end interface
145

146
147
148
  interface elpa_transpose_vectors_complex
    module procedure elpa_transpose_vectors_complex_double
  end interface
149

150
151
152
153
#ifdef WANT_SINGLE_PRECISION_COMPLEX
  public :: hh_transform_complex_single
  public :: elpa_reduce_add_vectors_complex_single
  public :: elpa_transpose_vectors_complex_single
Andreas Marek's avatar
Andreas Marek committed
154
#endif
155

156
  contains
157

158
159
160
! real double precision first
#define DOUBLE_PRECISION_REAL 1
#define REALCASE 1
161
#define DOUBLE_PRECISION 1
162
#include "../general/precision_macros.h"
163

164
165
#include "elpa_transpose_vectors.X90"
#include "elpa_reduce_add_vectors.X90"
166
#undef DOUBLE_PRECISION
167
#undef REALCASE
168
169
! single precision
#ifdef WANT_SINGLE_PRECISION_REAL
170

171
#define REALCASE 1
172
#define SINGLE_PRECISION 1
173
#include "../general/precision_macros.h"
174

175
176
#include "elpa_transpose_vectors.X90"
#include "elpa_reduce_add_vectors.X90"
177
#undef SINGLE_PRECISION
178
#undef REALCASE
179
#endif
180

181
! double precision
182

183
#define COMPLEXCASE 1
184
#define DOUBLE_PRECISION 1
185
#include "../general/precision_macros.h"
186
187
188
#include "elpa_transpose_vectors.X90"
#include "elpa_reduce_add_vectors.X90"
#undef COMPLEXCASE
189
#undef DOUBLE_PRECISION
190

191
#ifdef WANT_SINGLE_PRECISION_COMPLEX
192

193
#define COMPLEXCASE 1
194
#define SINGLE_PRECISION 1
195
#include "../general/precision_macros.h"
196
197
198
#include "elpa_transpose_vectors.X90"
#include "elpa_reduce_add_vectors.X90"
#undef COMPLEXCASE
199
#undef SINGLE_PRECISION
200

201
#endif /* WANT_SINGLE_PRECISION_COMPLEX */
202

203
! real double precision
204
#define REALCASE 1
205
#define DOUBLE_PRECISION 1
206
#include "../general/precision_macros.h"
207
#include "elpa1_compute_template.X90"
208

209
#undef REALCASE
210
#undef DOUBLE_PRECISION
211

212
213
! real single precision
#if defined(WANT_SINGLE_PRECISION_REAL)
214

215
#define REALCASE 1
216
217
#define SINGLE_PRECISION 1

218
#include "../general/precision_macros.h"
219
220
221
#include "elpa1_compute_template.X90"

#undef REALCASE
222
#undef SINGLE_PRECISION
223
#endif /* WANT_SINGLE_PRECISION_REAL */
224

225
! complex double precision
226
227

#define COMPLEXCASE 1
228
#define DOUBLE_PRECISION 1
229
#include "../general/precision_macros.h"
230
231
232
#include "elpa1_compute_template.X90"

#undef COMPLEXCASE
233
#undef DOUBLE_PRECISION
234

235
236
! complex single precision
#if defined(WANT_SINGLE_PRECISION_COMPLEX)
237

238
#define COMPLEXCASE 1
239
#define SINGLE_PRECISION 1
240
#include "../general/precision_macros.h"
241
242
243
#include "elpa1_compute_template.X90"

#undef COMPLEXCASE
244
#undef SINGLE_PRECISION
245

246
#endif /* WANT_SINGLE_PRECISION_COMPLEX */
247
248

end module ELPA1_compute