Eigenvalue SoLvers for Petaflop-Applications (ELPA) 2025.01.001
Loading...
Searching...
No Matches
elpa_api_math_template.F90
Go to the documentation of this file.
1#if 0
2!
3! Copyright 2017, L. Hüdepohl and A. Marek, MPCDF
4!
5! This file is part of ELPA.
6!
7! The ELPA library was originally created by the ELPA consortium,
8! consisting of the following organizations:
9!
10! - Max Planck Computing and Data Facility (MPCDF), formerly known as
11! Rechenzentrum Garching der Max-Planck-Gesellschaft (RZG),
12! - Bergische Universität Wuppertal, Lehrstuhl für angewandte
13! Informatik,
14! - Technische Universität München, Lehrstuhl für Informatik mit
15! Schwerpunkt Wissenschaftliches Rechnen ,
16! - Fritz-Haber-Institut, Berlin, Abt. Theorie,
17! - Max-Plack-Institut für Mathematik in den Naturwissenschaften,
18! Leipzig, Abt. Komplexe Strukutren in Biologie und Kognition,
19! and
20! - IBM Deutschland GmbH
21!
22! This particular source code file contains additions, changes and
23! enhancements authored by Intel Corporation which is not part of
24! the ELPA consortium.
25!
26! More information can be found here:
27! http://elpa.mpcdf.mpg.de/
28!
29! ELPA is free software: you can redistribute it and/or modify
30! it under the terms of the version 3 of the license of the
31! GNU Lesser General Public License as published by the Free
32! Software Foundation.
33!
34! ELPA is distributed in the hope that it will be useful,
35! but WITHOUT ANY WARRANTY; without even the implied warranty of
36! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37! GNU Lesser General Public License for more details.
38!
39! You should have received a copy of the GNU Lesser General Public License
40! along with ELPA. If not, see <http://www.gnu.org/licenses/>
41!
42! ELPA reflects a substantial effort on the part of the original
43! ELPA consortium, and we ask you to respect the spirit of the
44! license that we chose: i.e., please contribute any changes you
45! may have back to the original ELPA library distribution, and keep
46! any derivatives of ELPA under the same license that we chose for
47! the original distribution, the GNU Lesser General Public License.
48!
49#endif
50
63#if ELPA_IMPL_SUFFIX == d
64
67#endif
68#if ELPA_IMPL_SUFFIX == f
69
72#endif
73#if ELPA_IMPL_SUFFIX == dc
74
77#endif
78#if ELPA_IMPL_SUFFIX == fc
79
82#endif
83
84 abstract interface
85 subroutine elpa_eigenvectors_a_h_a_&
86 &elpa_impl_suffix&
87 &_i(self, a, ev, q, error)
88 use, intrinsic :: iso_c_binding
89 import elpa_t
90 implicit none
91 class(elpa_t) :: self
92
93#ifdef USE_ASSUMED_SIZE
94 math_datatype(kind=c_datatype_kind) :: a(self%local_nrows, *), q(self%local_nrows,*)
95#else
96 math_datatype(kind=c_datatype_kind) :: a(self%local_nrows, self%local_ncols), q(self%local_nrows, self%local_ncols)
97#endif
98 real(kind=c_real_datatype) :: ev(self%na)
99
100#ifdef USE_FORTRAN2008
101 integer, optional :: error
102#else
103 integer :: error
104#endif
105 end subroutine
106 end interface
107
108
121#if ELPA_IMPL_SUFFIX == d
122
125#endif
126#if ELPA_IMPL_SUFFIX == f
127
130#endif
131#if ELPA_IMPL_SUFFIX == dc
132
135#endif
136#if ELPA_IMPL_SUFFIX == fc
137
140#endif
141
142 abstract interface
143 subroutine elpa_eigenvectors_d_ptr_&
144 &elpa_impl_suffix&
145 &_i(self, a, ev, q, error)
146 use, intrinsic :: iso_c_binding
147 import elpa_t
148 implicit none
149 class(elpa_t) :: self
150
151 type(c_ptr) :: a, q, ev
152
153#ifdef USE_FORTRAN2008
154 integer, optional :: error
155#else
156 integer :: error
157#endif
158 end subroutine
159 end interface
160
161
162#ifdef HAVE_SKEWSYMMETRIC
163
175#if ELPA_IMPL_SUFFIX == d
176
179#endif
180#if ELPA_IMPL_SUFFIX == f
181
184#endif
185
186 abstract interface
187 subroutine elpa_skew_eigenvectors_a_h_a_&
188 &elpa_impl_suffix&
189 &_i(self, a, ev, q, error)
190 use, intrinsic :: iso_c_binding
191 import elpa_t
192 implicit none
193 class(elpa_t) :: self
194
195#ifdef USE_ASSUMED_SIZE
196 math_datatype(kind=c_datatype_kind) :: a(self%local_nrows, *), q(self%local_nrows,*)
197#else
198 math_datatype(kind=c_datatype_kind) :: a(self%local_nrows, self%local_ncols), q(self%local_nrows, 2*self%local_ncols)
199#endif
200 real(kind=c_real_datatype) :: ev(self%na)
201
202#ifdef USE_FORTRAN2008
203 integer, optional :: error
204#else
205 integer :: error
206#endif
207 end subroutine
208 end interface
209
210
223#if ELPA_IMPL_SUFFIX == d
224
227#endif
228#if ELPA_IMPL_SUFFIX == f
229
232#endif
233
234 abstract interface
235 subroutine elpa_skew_eigenvectors_d_ptr_&
236 &elpa_impl_suffix&
237 &_i(self, a, ev, q, error)
238 use, intrinsic :: iso_c_binding
239 import elpa_t
240 implicit none
241 class(elpa_t) :: self
242
243 type(c_ptr) :: a, q, ev
244
245#ifdef USE_FORTRAN2008
246 integer, optional :: error
247#else
248 integer :: error
249#endif
250 end subroutine
251 end interface
252
253#endif /* HAVE_SKEWSYMMETRIC */
254
255
268#if ELPA_IMPL_SUFFIX == d
269
271#endif
272#if ELPA_IMPL_SUFFIX == f
273
275#endif
276#if ELPA_IMPL_SUFFIX == dc
277
279#endif
280#if ELPA_IMPL_SUFFIX ==fc
281
283#endif
284
285 abstract interface
286 subroutine elpa_eigenvalues_a_h_a_&
287 &elpa_impl_suffix&
288 &_i(self, a, ev, error)
289 use, intrinsic :: iso_c_binding
290 import elpa_t
291 implicit none
292 class(elpa_t) :: self
293#ifdef USE_ASSUMED_SIZE
294 math_datatype(kind=c_datatype_kind) :: a(self%local_nrows, *)
295#else
296 math_datatype(kind=c_datatype_kind) :: a(self%local_nrows, self%local_ncols)
297#endif
298 real(kind=c_real_datatype) :: ev(self%na)
299
300#ifdef USE_FORTRAN2008
301 integer, optional :: error
302#else
303 integer :: error
304#endif
305 end subroutine
306 end interface
307
308
321#if ELPA_IMPL_SUFFIX == d
322
324#endif
325#if ELPA_IMPL_SUFFIX == f
326
328#endif
329#if ELPA_IMPL_SUFFIX == dc
330
332#endif
333#if ELPA_IMPL_SUFFIX ==fc
334
336#endif
337
338 abstract interface
339 subroutine elpa_eigenvalues_d_ptr_&
340 &elpa_impl_suffix&
341 &_i(self, a, ev, error)
342 use, intrinsic :: iso_c_binding
343 import elpa_t
344 implicit none
345 class(elpa_t) :: self
346 type(c_ptr) :: a, ev
347
348#ifdef USE_FORTRAN2008
349 integer, optional :: error
350#else
351 integer :: error
352#endif
353 end subroutine
354 end interface
355
356
357#ifdef HAVE_SKEWSYMMETRIC
358
370#if ELPA_IMPL_SUFFIX == d
371
373#endif
374#if ELPA_IMPL_SUFFIX == f
375
377#endif
378
379 abstract interface
380 subroutine elpa_skew_eigenvalues_a_h_a_&
381 &elpa_impl_suffix&
382 &_i(self, a, ev, error)
383 use, intrinsic :: iso_c_binding
384 import elpa_t
385 implicit none
386 class(elpa_t) :: self
387#ifdef USE_ASSUMED_SIZE
388 math_datatype(kind=c_datatype_kind) :: a(self%local_nrows, *)
389#else
390 math_datatype(kind=c_datatype_kind) :: a(self%local_nrows, self%local_ncols)
391#endif
392 real(kind=c_real_datatype) :: ev(self%na)
393
394#ifdef USE_FORTRAN2008
395 integer, optional :: error
396#else
397 integer :: error
398#endif
399 end subroutine
400 end interface
401
402
415#if ELPA_IMPL_SUFFIX == d
416
418#endif
419#if ELPA_IMPL_SUFFIX == f
420
422#endif
423
424 abstract interface
425 subroutine elpa_skew_eigenvalues_d_ptr_&
426 &elpa_impl_suffix&
427 &_i(self, a, ev, error)
428 use, intrinsic :: iso_c_binding
429 import elpa_t
430 implicit none
431 class(elpa_t) :: self
432 type(c_ptr) :: a, ev
433
434#ifdef USE_FORTRAN2008
435 integer, optional :: error
436#else
437 integer :: error
438#endif
439 end subroutine
440 end interface
441#endif /* HAVE_SKEWSYMMETRIC */
442
443! _________________________________________________________________________________________________
444
457#if ELPA_IMPL_SUFFIX == d
458
462#endif
463#if ELPA_IMPL_SUFFIX == f
464
468#endif
469#if ELPA_IMPL_SUFFIX == dc
470
474#endif
475#if ELPA_IMPL_SUFFIX == fc
476
480#endif
481
483 abstract interface
484 subroutine elpa_generalized_eigenvectors_a_h_a_&
485 &elpa_impl_suffix&
486 &_i(self, a, b, ev, q, is_already_decomposed, error)
487 use, intrinsic :: iso_c_binding
488 use elpa_constants
489 import elpa_t
490 implicit none
491 class(elpa_t) :: self
492#ifdef USE_ASSUMED_SIZE
493 math_datatype(kind=c_datatype_kind) :: a(self%local_nrows, *), b(self%local_nrows, *), q(self%local_nrows, *)
494#else
495 math_datatype(kind=c_datatype_kind) :: a(self%local_nrows, self%local_ncols), b(self%local_nrows, self%local_ncols), &
496 q(self%local_nrows, self%local_ncols)
497#endif
498 real(kind=c_real_datatype) :: ev(self%na)
499
500 logical :: is_already_decomposed
501 integer, optional :: error
502 end subroutine
503 end interface
504
505
518#if ELPA_IMPL_SUFFIX == d
519
523#endif
524#if ELPA_IMPL_SUFFIX == f
525
529#endif
530#if ELPA_IMPL_SUFFIX == dc
531
535#endif
536#if ELPA_IMPL_SUFFIX == fc
537
541#endif
542
544 abstract interface
545 subroutine elpa_generalized_eigenvectors_d_ptr_&
546 &elpa_impl_suffix&
547 &_i(self, adev, bdev, evdev, qdev, is_already_decomposed, error)
548 use, intrinsic :: iso_c_binding
549 use elpa_constants
550 import elpa_t
551 implicit none
552 class(elpa_t) :: self
553
554 type(c_ptr) :: aDev, bDev, evDev, qDev
555
556 logical :: is_already_decomposed
557 integer, optional :: error
558 end subroutine
559 end interface
560
561! _________________________________________________________________________________________________
562
575#if ELPA_IMPL_SUFFIX == d
576
579#endif
580#if ELPA_IMPL_SUFFIX == f
581
584#endif
585#if ELPA_IMPL_SUFFIX == dc
586
589#endif
590#if ELPA_IMPL_SUFFIX == fc
591
594#endif
595
598 abstract interface
599 subroutine elpa_generalized_eigenvalues_a_h_a_&
600 &elpa_impl_suffix&
601 &_i(self, a, b, ev, is_already_decomposed, error)
602 use, intrinsic :: iso_c_binding
603 use elpa_constants
604 import elpa_t
605 implicit none
606 class(elpa_t) :: self
607#ifdef USE_ASSUMED_SIZE
608 math_datatype(kind=c_datatype_kind) :: a(self%local_nrows, *), b(self%local_nrows, *)
609#else
610 math_datatype(kind=c_datatype_kind) :: a(self%local_nrows, self%local_ncols), b(self%local_nrows, self%local_ncols)
611#endif
612 real(kind=c_real_datatype) :: ev(self%na)
613
614 logical :: is_already_decomposed
615 integer, optional :: error
616 end subroutine
617 end interface
618
619
632#if ELPA_IMPL_SUFFIX == d
633
636#endif
637#if ELPA_IMPL_SUFFIX == f
638
641#endif
642#if ELPA_IMPL_SUFFIX == dc
643
646#endif
647#if ELPA_IMPL_SUFFIX == fc
648
651#endif
652
655 abstract interface
656 subroutine elpa_generalized_eigenvalues_d_ptr_&
657 &elpa_impl_suffix&
658 &_i(self, adev, bdev, evdev, is_already_decomposed, error)
659 use, intrinsic :: iso_c_binding
660 use elpa_constants
661 import elpa_t
662 implicit none
663 class(elpa_t) :: self
664
665 type(c_ptr) :: aDev, bDev, evDev
666
667 logical :: is_already_decomposed
668 integer, optional :: error
669 end subroutine
670 end interface
671
672! _________________________________________________________________________________________________
673
709 abstract interface
710 subroutine elpa_hermitian_multiply_a_h_a_&
711 &elpa_impl_suffix&
712 &_i(self,uplo_a, uplo_c, ncb, a, b, nrows_b, ncols_b, &
713 c, nrows_c, ncols_c, error)
714 use, intrinsic :: iso_c_binding
715 import elpa_t
716 implicit none
717 class(elpa_t) :: self
718 character*1 :: uplo_a, uplo_c
719 integer(kind=c_int), intent(in) :: nrows_b, ncols_b, nrows_c, ncols_c, ncb
720#ifdef USE_ASSUMED_SIZE
721 math_datatype(kind=c_datatype_kind) :: a(self%local_nrows,*), b(nrows_b,*), c(nrows_c,*)
722#else
723 math_datatype(kind=c_datatype_kind) :: a(self%local_nrows,self%local_ncols), b(nrows_b,ncols_b), c(nrows_c,ncols_c)
724#endif
725
726#ifdef USE_FORTRAN2008
727 integer, optional :: error
728#else
729 integer :: error
730#endif
731 end subroutine
732 end interface
733
734
770 abstract interface
771 subroutine elpa_hermitian_multiply_d_ptr_&
772 &elpa_impl_suffix&
773 &_i(self,uplo_a, uplo_c, ncb, a, b, nrows_b, ncols_b, &
774 c, nrows_c, ncols_c, error)
775 use, intrinsic :: iso_c_binding
776 import elpa_t
777 implicit none
778 class(elpa_t) :: self
779 character*1 :: uplo_a, uplo_c
780 integer(kind=c_int), intent(in) :: nrows_b, ncols_b, nrows_c, ncols_c, ncb
781 type(c_ptr) :: a, b, c
782!#ifdef USE_ASSUMED_SIZE
783! MATH_DATATYPE(kind=C_DATATYPE_KIND) :: a(self%local_nrows,*), b(nrows_b,*), c(nrows_c,*)
784!#else
785! MATH_DATATYPE(kind=C_DATATYPE_KIND) :: a(self%local_nrows,self%local_ncols), b(nrows_b,ncols_b), c(nrows_c,ncols_c)
786!#endif
787
788#ifdef USE_FORTRAN2008
789 integer, optional :: error
790#else
791 integer :: error
792#endif
793 end subroutine
794 end interface
795
796! _________________________________________________________________________________________________________________________________
797 ! PETERDEBUG: fix description; add to ELPA docs
833 abstract interface
834 subroutine elpa_pxgemm_multiply_a_h_a_&
835 &elpa_impl_suffix&
836 &_i(self, trans_a, trans_b, ncb, a, b, nrows_b, ncols_b, &
837 c, nrows_c, ncols_c, error)
838 use, intrinsic :: iso_c_binding
839 import elpa_t
840 implicit none
841 class(elpa_t) :: self
842 character*1 :: trans_a, trans_b
843 integer(kind=c_int), intent(in) :: nrows_b, ncols_b, nrows_c, ncols_c, ncb
844#ifdef USE_ASSUMED_SIZE
845 math_datatype(kind=c_datatype_kind) :: a(self%local_nrows,*), b(nrows_b,*), c(nrows_c,*)
846#else
847 math_datatype(kind=c_datatype_kind) :: a(self%local_nrows,self%local_ncols), b(nrows_b,ncols_b), c(nrows_c,ncols_c)
848#endif
849
850#ifdef USE_FORTRAN2008
851 integer, optional :: error
852#else
853 integer :: error
854#endif
855 end subroutine
856 end interface
857
858
894 abstract interface
895 subroutine elpa_pxgemm_multiply_d_ptr_&
896 &elpa_impl_suffix&
897 &_i(self, trans_a, trans_b, ncb, a, b, nrows_b, ncols_b, &
898 c, nrows_c, ncols_c, error)
899 use, intrinsic :: iso_c_binding
900 import elpa_t
901 implicit none
902 class(elpa_t) :: self
903 character*1 :: trans_a, trans_b
904 integer(kind=c_int), intent(in) :: nrows_b, ncols_b, nrows_c, ncols_c, ncb
905 type(c_ptr) :: a, b, c
906!#ifdef USE_ASSUMED_SIZE
907! MATH_DATATYPE(kind=C_DATATYPE_KIND) :: a(self%local_nrows,*), b(nrows_b,*), c(nrows_c,*)
908!#else
909! MATH_DATATYPE(kind=C_DATATYPE_KIND) :: a(self%local_nrows,self%local_ncols), b(nrows_b,ncols_b), c(nrows_c,ncols_c)
910!#endif
911
912#ifdef USE_FORTRAN2008
913 integer, optional :: error
914#else
915 integer :: error
916#endif
917 end subroutine
918 end interface
919
920! _________________________________________________________________________________________________________________________________
921
930#if ELPA_IMPL_SUFFIX == d
931
932#endif
933#if ELPA_IMPL_SUFFIX == f
934
935#endif
936#if ELPA_IMPL_SUFFIX == dc
937
938#endif
939#if ELPA_IMPL_SUFFIX == fc
940
941#endif
942
943 abstract interface
944 subroutine elpa_cholesky_a_h_a_&
945 &elpa_impl_suffix&
946 &_i(self, a, error)
947 use, intrinsic :: iso_c_binding
948 import elpa_t
949 implicit none
950 class(elpa_t) :: self
951#ifdef USE_ASSUMED_SIZE
952 math_datatype(kind=c_datatype_kind) :: a(self%local_nrows,*)
953#else
954 math_datatype(kind=c_datatype_kind) :: a(self%local_nrows,self%local_ncols)
955#endif
956
957#ifdef USE_FORTRAN2008
958 integer, optional :: error
959#else
960 integer :: error
961#endif
962 end subroutine
963 end interface
964
965
974#if ELPA_IMPL_SUFFIX == d
975
976#endif
977#if ELPA_IMPL_SUFFIX == f
978
979#endif
980#if ELPA_IMPL_SUFFIX == dc
981
982#endif
983#if ELPA_IMPL_SUFFIX == fc
984
985#endif
986
987 abstract interface
988 subroutine elpa_cholesky_d_ptr_&
989 &elpa_impl_suffix&
990 &_i(self, a, error)
991 use, intrinsic :: iso_c_binding
992 import elpa_t
993 implicit none
994 class(elpa_t) :: self
995 type(c_ptr) :: a
996
997#ifdef USE_FORTRAN2008
998 integer, optional :: error
999#else
1000 integer :: error
1001#endif
1002 end subroutine
1003 end interface
1004
1005
1006
1015#if ELPA_IMPL_SUFFIX == d
1016
1017#endif
1018#if ELPA_IMPL_SUFFIX == f
1019
1020#endif
1021#if ELPA_IMPL_SUFFIX == dc
1022
1023#endif
1024#if ELPA_IMPL_SUFFIX == fc
1025
1026#endif
1027
1029 abstract interface
1030 subroutine elpa_invert_trm_a_h_a_&
1031 &elpa_impl_suffix&
1032 &_i(self, a, error)
1033 use, intrinsic :: iso_c_binding
1034 import elpa_t
1035 implicit none
1036 class(elpa_t) :: self
1037#ifdef USE_ASSUMED_SIZE
1038 math_datatype(kind=c_datatype_kind) :: a(self%local_nrows,*)
1039#else
1040 math_datatype(kind=c_datatype_kind) :: a(self%local_nrows,self%local_ncols)
1041#endif
1042
1043#ifdef USE_FORTRAN2008
1044 integer, optional :: error
1045#else
1046 integer :: error
1047#endif
1048 end subroutine
1049 end interface
1050
1059#if ELPA_IMPL_SUFFIX == d
1060
1061#endif
1062#if ELPA_IMPL_SUFFIX == f
1063
1064#endif
1065#if ELPA_IMPL_SUFFIX == dc
1066
1067#endif
1068#if ELPA_IMPL_SUFFIX == fc
1069
1070#endif
1071
1073 abstract interface
1074 subroutine elpa_invert_trm_d_ptr_&
1075 &elpa_impl_suffix&
1076 &_i(self, a, error)
1077 use, intrinsic :: iso_c_binding
1078 import elpa_t
1079 implicit none
1080 class(elpa_t) :: self
1081 type(c_ptr) :: a
1082
1083#ifdef USE_FORTRAN2008
1084 integer, optional :: error
1085#else
1086 integer :: error
1087#endif
1088 end subroutine
1089 end interface
1090
1091
1092
1101#if ELPA_IMPL_SUFFIX == d
1102
1106#endif
1107#if ELPA_IMPL_SUFFIX == f
1108
1112#endif
1113
1114 abstract interface
1115 subroutine elpa_solve_tridiagonal_&
1116 &elpa_impl_suffix&
1117 &_i(self, d, e, q, error)
1118 use, intrinsic :: iso_c_binding
1119 import elpa_t
1120 implicit none
1121 class(elpa_t) :: self
1122 real(kind=c_real_datatype) :: d(self%na), e(self%na)
1123#ifdef USE_ASSUMED_SIZE
1124 real(kind=c_real_datatype) :: q(self%local_nrows,*)
1125#else
1126 real(kind=c_real_datatype) :: q(self%local_nrows,self%local_ncols)
1127#endif
1128
1129#ifdef USE_FORTRAN2008
1130 integer, optional :: error
1131#else
1132 integer :: error
1133#endif
1134 end subroutine
1135 end interface
1136
struct elpa_struct * elpa_t
Definition elpa.h:10