elpa1_compute_private.F90 7.42 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

72
73
74
  interface tridiag_real
    module procedure tridiag_real_double
  end interface
75

76
77
78
  interface trans_ev_real
    module procedure trans_ev_real_double
  end interface
79

80
81
82
#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
83
  public :: solve_tridi_single
84
#endif
85

86
87
88
89
  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
90

91
92
93
  interface tridiag_complex
    module procedure tridiag_complex_double
  end interface
94

95
96
97
  interface trans_ev_complex
    module procedure trans_ev_complex_double
  end interface
98

99
100
101
#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
102
#endif
103

104
105
106
107
108
109
  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
110

111
112
113
  interface hh_transform_real
    module procedure hh_transform_real_double
  end interface
114

115
116
117
  interface elpa_reduce_add_vectors_real
    module procedure elpa_reduce_add_vectors_real_double
  end interface
118

119
120
121
  interface elpa_transpose_vectors_real
    module procedure elpa_transpose_vectors_real_double
  end interface
122

123
124
125
126
#ifdef WANT_SINGLE_PRECISION_REAL
  public :: hh_transform_real_single
  public :: elpa_reduce_add_vectors_real_single
  public :: elpa_transpose_vectors_real_single
127
#endif
128

129
130
131
132
133
134
  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
135

136
137
138
  interface hh_transform_complex
    module procedure hh_transform_complex_double
  end interface
139

140
141
142
  interface elpa_reduce_add_vectors_complex
    module procedure elpa_reduce_add_vectors_complex_double
  end interface
143

144
145
146
  interface elpa_transpose_vectors_complex
    module procedure elpa_transpose_vectors_complex_double
  end interface
147

148
149
150
151
#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
152
#endif
153

154
  contains
155

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

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

169
#define REALCASE 1
170
#define SINGLE_PRECISION 1
171
#include "../precision_macros.h"
172

173
174
#include "elpa_transpose_vectors.X90"
#include "elpa_reduce_add_vectors.X90"
175
#undef SINGLE_PRECISION
176
#undef REALCASE
177
#endif
178

179
! double precision
180

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

189
#ifdef WANT_SINGLE_PRECISION_COMPLEX
190

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

199
#endif /* WANT_SINGLE_PRECISION_COMPLEX */
200

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

207
#undef REALCASE
208
#undef DOUBLE_PRECISION
209

210
211
! real single precision
#if defined(WANT_SINGLE_PRECISION_REAL)
212

213
#define REALCASE 1
214
215
#define SINGLE_PRECISION 1

216
#include "../precision_macros.h"
217
218
219
#include "elpa1_compute_template.X90"

#undef REALCASE
220
#undef SINGLE_PRECISION
221
#endif /* WANT_SINGLE_PRECISION_REAL */
222

223
! complex double precision
224
225

#define COMPLEXCASE 1
226
#define DOUBLE_PRECISION 1
227
#include "../precision_macros.h"
228
229
230
#include "elpa1_compute_template.X90"

#undef COMPLEXCASE
231
#undef DOUBLE_PRECISION
232

233
234
! complex single precision
#if defined(WANT_SINGLE_PRECISION_COMPLEX)
235

236
#define COMPLEXCASE 1
237
#define SINGLE_PRECISION 1
238
#include "../precision_macros.h"
239
240
241
#include "elpa1_compute_template.X90"

#undef COMPLEXCASE
242
#undef SINGLE_PRECISION
243

244
#endif /* WANT_SINGLE_PRECISION_COMPLEX */
245
246

end module ELPA1_compute