fortran_scalapack_interfaces.F90 10.9 KB
Newer Older
Andreas Marek's avatar
Andreas Marek committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
!    This file is part of ELPA.
!
!    The ELPA library was originally created by the ELPA consortium,
!    consisting of the following organizations:
!
!    - Rechenzentrum Garching der Max-Planck-Gesellschaft (RZG),
!    - 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,
!    - Max-Plack-Institut für Mathematik in den Naturwissenschaften,
!      Leipzig, Abt. Komplexe Strukutren in Biologie und Kognition,
!      and
!    - IBM Deutschland GmbH
!
!
!    More information can be found here:
Andreas Marek's avatar
Andreas Marek committed
19
!    http://elpa.mpcdf.mpg.de/
Andreas Marek's avatar
Andreas Marek committed
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
!
!    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.
!
! This file was written by A. Marek, MPCDF


44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
  interface 
    subroutine descinit(DESC, M, N, MB, NB, IRSRC, ICSRC, ICTXT, LLD, INFO)
    use precision
    implicit none
    integer(kind=BLAS_KIND) :: DESC(*), M, N, MB, NB, IRSRC, ICSRC, LLD
    integer(kind=BLAS_KIND), intent(inout) :: info
    integer(kind=BLAS_KIND) :: ICTXT
    end subroutine
  end interface

  interface
    subroutine blacs_gridinit(ICONTXT, ORDER, NPROW, NPCOL)
    use precision
    implicit none
    integer(kind=BLAS_KIND) :: ICONTXT
    character(len=1)        :: ORDER
    integer(kind=BLAS_KIND) :: NPROW, NPCOL
    end subroutine
  end interface

64
65
66
67
68
69
70
71
  interface
    subroutine blacs_gridexit(ICONTXT)
    use precision
    implicit none
    integer(kind=BLAS_KIND) :: ICONTXT
    end subroutine
  end interface

72
73
74
75
76
77
78
79
80
  interface
    subroutine blacs_gridinfo(ICONTXT, NPROW, NPCOL, MYPROW, MYPCOL)
    use precision
    implicit none
    integer(kind=BLAS_KIND) :: ICONTXT
    integer(kind=BLAS_KIND), intent(inout) :: NPROW, NPCOL, MYPROW, MYPCOL
    end subroutine
  end interface

Andreas Marek's avatar
Andreas Marek committed
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142

  interface
    function numroc(N, NB, IPROC, ISRCPROC, NPROCS) result(numr)
    use precision
    implicit none
    integer(kind=BLAS_KIND) :: N, NB, IPROC, ISRCPROC, NPROCS, numr
    end function
  end interface


  interface
    subroutine pdgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, IA, JA, DESCA, B, IB, JB, DESCB, BETA, C, IC, JC, DESCC)
    use PRECISION_MODULE
    implicit none
    character               :: TRANSA, TRANSB
    integer(kind=BLAS_KIND) :: M, N, K, IA, JA, DESCA(*), IB, JB, DESCB(*), IC, JC, DESCC(*)
    real(kind=rk8)          :: ALPHA, BETA
    real(kind=rk8)          :: A(*), B(*), C(*)
    end subroutine
  end interface

  interface
    subroutine pdnrm2(N, norm2, x, ix, jx, descx, incx)
    use PRECISION_MODULE
    implicit none
    integer(kind=BLAS_KIND) :: N, ix, jx, descx(*), incx
    real(kind=rk8)          :: norm2, x(*)
    end subroutine
  end interface

  interface
    subroutine pdlaset(UPLO, M, N, ALPHA, BETA, A, IA, JA, DESCA)
    use PRECISION_MODULE
    implicit none
    character               :: UPLO
    integer(kind=BLAS_KIND) :: M, N, IA, JA, DESCA(*)
    real(kind=rk8)          :: ALPHA, BETA
    real(kind=rk8)          :: A(*)
    end subroutine
  end interface

  interface
    subroutine pdtran(M, N, ALPHA, A, IA, JA, DESCA, BETA, C, IC, JC, DESCC)
    use PRECISION_MODULE
    implicit none
    integer(kind=BLAS_KIND) :: M, N, IA, JA, DESCA(*), IC, JC, DESCC(*)
    real(kind=rk8)          :: ALPHA, BETA
    real(kind=rk8)          :: A(*), C(*)
    end subroutine
  end interface

  interface
    function pdlange(NORM, M, N, A, IA, JA, DESCA, WORK) result(norm2)
    use PRECISION_MODULE
    implicit none
    character               :: norm
    integer(kind=BLAS_KIND) :: m, n, ia, ja, desca(*)
    real(kind=rk8)          :: a(*), work(*)
    real(kind=rk8)          :: norm2
    end function
  end interface

143
144
145
146
147
148
149
150
151
  interface
    subroutine pdgenr2d(m, n, a, ia, ja, desca, b, ib, jb, descb, ictxt) 
    use PRECISION_MODULE
    implicit none
    integer(kind=BLAS_KIND) :: m, n, ia, ja, desca(*), ib, jb, descb(*)
    real(kind=rk8)          :: a(*), b(*)
    integer(kind=BLAS_KIND) :: ictxt
    end subroutine
  end interface
Andreas Marek's avatar
Andreas Marek committed
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205


  interface
    subroutine psgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, IA, JA, DESCA, B, IB, JB, DESCB, BETA, C, IC, JC, DESCC)
    use PRECISION_MODULE
    implicit none
    character               :: TRANSA, TRANSB
    integer(kind=BLAS_KIND) :: M, N, K, IA, JA, DESCA(*), IB, JB, DESCB(*), IC, JC, DESCC(*)
    real(kind=rk4)          :: ALPHA, BETA
    real(kind=rk4)          :: A(*), B(*), C(*)
    end subroutine
  end interface

  interface
    subroutine psnrm2(N, norm2, x, ix, jx, descx, incx)
    use PRECISION_MODULE
    implicit none
    integer(kind=BLAS_KIND) :: N, ix, jx, descx(*), incx
    real(kind=rk4)          :: norm2, x(*)
    end subroutine
  end interface

  interface
    subroutine pslaset(UPLO, M, N, ALPHA, BETA, A, IA, JA, DESCA)
    use PRECISION_MODULE
    implicit none
    character               :: UPLO
    integer(kind=BLAS_KIND) :: M, N, IA, JA, DESCA(*)
    real(kind=rk4)          :: ALPHA, BETA
    real(kind=rk4)          :: A(*)
    end subroutine
  end interface

  interface
    subroutine pstran(M, N, ALPHA, A, IA, JA, DESCA, BETA, C, IC, JC, DESCC)
    use PRECISION_MODULE
    implicit none
    integer(kind=BLAS_KIND) :: M, N, IA, JA, DESCA(*), IC, JC, DESCC(*)
    real(kind=rk4)          :: ALPHA, BETA
    real(kind=rk4)          :: A(*), C(*)
    end subroutine
  end interface

  interface
    function pslange(NORM, M, N, A, IA, JA, DESCA, WORK) result(norm2)
    use PRECISION_MODULE
    implicit none
    character               :: norm
    integer(kind=BLAS_KIND) :: m, n, ia, ja, desca(*)
    real(kind=rk4)          :: a(*), work(*)
    real(kind=rk4)          :: norm2
    end function
  end interface

206
207
208
209
210
211
212
213
214
215
  interface
    subroutine psgenr2d(m, n, a, ia, ja, desca, b, ib, jb, descb, ictxt) 
    use PRECISION_MODULE
    implicit none
    integer(kind=BLAS_KIND) :: m, n, ia, ja, desca(*), ib, jb, descb(*)
    real(kind=rk8)          :: a(*), b(*)
    integer(kind=BLAS_KIND) :: ictxt
    end subroutine
  end interface

Andreas Marek's avatar
Andreas Marek committed
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
  interface
    subroutine pzgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, IA, JA, DESCA, B, IB, JB, DESCB, BETA, C, IC, JC, DESCC)
    use PRECISION_MODULE
    implicit none
    character               :: TRANSA, TRANSB
    integer(kind=BLAS_KIND) :: M, N, K, IA, JA, DESCA(*), IB, JB, DESCB(*), IC, JC, DESCC(*)
    complex(kind=ck8)       :: ALPHA, BETA
    complex(kind=ck8)       :: A(*), B(*), C(*)
    end subroutine
  end interface

  interface
    subroutine pzdotc(N, DOTC, X, ix, jx, descx, incx, Y, iy, jy, descy, incy)
    use PRECISION_MODULE
    implicit none
    integer(kind=BLAS_KIND) :: N, ix, jx, descx(*), incx, iy, jy, descy(*), incy
    complex(kind=ck8)       :: DOTC
    complex(kind=ck8)       :: X(*), Y(*)
    end subroutine
  end interface

  interface
    subroutine pzlaset(UPLO, M, N, ALPHA, BETA, A, IA, JA, DESCA)
    use PRECISION_MODULE
    implicit none
    character               :: UPLO
    integer(kind=BLAS_KIND) :: M, N, IA, JA, DESCA(*)
    complex(kind=ck8)       :: ALPHA, BETA
    complex(kind=ck8)       :: A(*)
    end subroutine
  end interface

  interface
    subroutine pztranc(M, N, ALPHA, A, IA, JA, DESCA, BETA, C, IC, JC, DESCC)
    use PRECISION_MODULE
    implicit none
    integer(kind=BLAS_KIND) :: M, N, IA, JA, DESCA(*), IC, JC, DESCC(*)
    complex(kind=ck8)       :: ALPHA, BETA
    complex(kind=ck8)       :: A(*), C(*)
    end subroutine
  end interface

  interface
    function pzlange(NORM, M, N, A, IA, JA, DESCA, WORK) result(norm2)
    use PRECISION_MODULE
    implicit none
    character               :: norm
    integer(kind=BLAS_KIND) :: m, n, ia, ja, desca(*)
264
265
266
    complex(kind=ck8)       :: a(*)
    real(kind=rk8)          ::work(*)
    real(kind=rk8)          :: norm2
Andreas Marek's avatar
Andreas Marek committed
267
268
269
    end function
  end interface

270
271
272
273
274
275
276
277
278
279
  interface
    subroutine pzgenr2d(m, n, a, ia, ja, desca, b, ib, jb, descb, ictxt) 
    use PRECISION_MODULE
    implicit none
    integer(kind=BLAS_KIND) :: m, n, ia, ja, desca(*), ib, jb, descb(*)
    complex(kind=ck8)       :: a(*), b(*)
    integer(kind=BLAS_KIND) :: ictxt
    end subroutine
  end interface

Andreas Marek's avatar
Andreas Marek committed
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
  interface
    subroutine pcgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, IA, JA, DESCA, B, IB, JB, DESCB, BETA, C, IC, JC, DESCC)
    use PRECISION_MODULE
    implicit none
    character               :: TRANSA, TRANSB
    integer(kind=BLAS_KIND) :: M, N, K, IA, JA, DESCA(*), IB, JB, DESCB(*), IC, JC, DESCC(*)
    complex(kind=ck4)       :: ALPHA, BETA
    complex(kind=ck4)       :: A(*), B(*), C(*)
    end subroutine
  end interface

  interface
    subroutine pcdotc(N, DOTC, X, ix, jx, descx, incx, Y, iy, jy, descy, incy)
    use PRECISION_MODULE
    implicit none
    integer(kind=BLAS_KIND) :: N, ix, jx, descx(*), incx, iy, jy, descy(*), incy
    complex(kind=ck4)       :: DOTC
    complex(kind=ck4)       :: X(*), Y(*)
    end subroutine
  end interface

  interface
    subroutine pclaset(UPLO, M, N, ALPHA, BETA, A, IA, JA, DESCA)
    use PRECISION_MODULE
    implicit none
    character               :: UPLO
    integer(kind=BLAS_KIND) :: M, N, IA, JA, DESCA(*)
    complex(kind=ck4)       :: ALPHA, BETA
    complex(kind=ck4)       :: A(*)
    end subroutine
  end interface

  interface
    subroutine pctranc(M, N, ALPHA, A, IA, JA, DESCA, BETA, C, IC, JC, DESCC)
    use PRECISION_MODULE
    implicit none
    integer(kind=BLAS_KIND) :: M, N, IA, JA, DESCA(*), IC, JC, DESCC(*)
    complex(kind=ck4)       :: ALPHA, BETA
    complex(kind=ck4)       :: A(*), C(*)
    end subroutine
  end interface

  interface
    function pclange(NORM, M, N, A, IA, JA, DESCA, WORK) result(norm2)
    use PRECISION_MODULE
    implicit none
    character               :: norm
    integer(kind=BLAS_KIND) :: m, n, ia, ja, desca(*)
328
329
330
    complex(kind=ck4)       :: a(*)
    real(kind=rk4)          ::work(*)
    real(kind=rk4)          :: norm2
Andreas Marek's avatar
Andreas Marek committed
331
332
333
    end function
  end interface

334
335
336
337
338
339
340
341
342
  interface
    subroutine pcgenr2d(m, n, a, ia, ja, desca, b, ib, jb, descb, ictxt) 
    use PRECISION_MODULE
    implicit none
    integer(kind=BLAS_KIND) :: m, n, ia, ja, desca(*), ib, jb, descb(*)
    complex(kind=ck4)       :: a(*), b(*)
    integer(kind=BLAS_KIND) :: ictxt
    end subroutine
  end interface