elpa2.F90 12.7 KB
 Andreas Marek committed Apr 07, 2017 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 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 54 55 ``````! This file is part of ELPA. ! ! The ELPA library was originally created by the ELPA consortium, ! consisting of the following organizations: ! ! - Max Planck Computing and Data Facility (MPCDF), fomerly known as ! 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 ! ! 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: ! http://elpa.mpcdf.mpg.de/ ! ! 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 ! ! 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. ! ! ! ELPA2 -- 2-stage solver for ELPA ! ! 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". ! ! Author: Andreas Marek, MPCDF #include "config-f90.h" `````` Andreas Marek committed May 24, 2017 56 ``````!> \brief Fortran module which provides the routines to use the 2-stage ELPA solver. Implementation only. Should not be used directly `````` Andreas Marek committed Apr 19, 2017 57 ``````module elpa2_impl `````` Lorenz Huedepohl committed May 16, 2017 58 `````` use elpa_utilities, only : error_unit `````` Pavel Kus committed May 16, 2019 59 60 61 ``````#ifdef HAVE_LIKWID use likwid #endif `````` Andreas Marek committed Apr 07, 2017 62 63 64 `````` implicit none `````` Lorenz Huedepohl committed May 16, 2017 65 `````` private `````` Andreas Marek committed Apr 07, 2017 66 `````` `````` Andreas Marek committed Apr 19, 2017 67 68 `````` public :: elpa_solve_evp_real_2stage_double_impl !< Driver routine for real double-precision 2-stage eigenvalue problem public :: elpa_solve_evp_complex_2stage_double_impl !< Driver routine for complex double-precision 2-stage eigenvalue problem `````` Andreas Marek committed Apr 12, 2017 69 ``````#ifdef WANT_SINGLE_PRECISION_REAL `````` Andreas Marek committed Apr 19, 2017 70 `````` public :: elpa_solve_evp_real_2stage_single_impl !< Driver routine for real single-precision 2-stage eigenvalue problem `````` Andreas Marek committed Apr 12, 2017 71 72 73 ``````#endif #ifdef WANT_SINGLE_PRECISION_COMPLEX `````` Andreas Marek committed Apr 19, 2017 74 `````` public :: elpa_solve_evp_complex_2stage_single_impl !< Driver routine for complex single-precision 2-stage eigenvalue problem `````` Andreas Marek committed Apr 12, 2017 75 ``````#endif `````` Andreas Marek committed Apr 07, 2017 76 77 78 79 80 `````` contains #define REALCASE 1 #define DOUBLE_PRECISION 1 `````` Andreas Marek committed Apr 18, 2017 81 ``````#include "../general/precision_macros.h" `````` Andreas Marek committed Apr 07, 2017 82 ``````!------------------------------------------------------------------------------- `````` Andreas Marek committed Oct 10, 2019 83 ``````!> \brief elpa_solve_evp_real_2stage_double_impl: Fortran function to solve the double-precision real eigenvalue problem with a 2 stage approach `````` Andreas Marek committed Apr 07, 2017 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 ``````!> !> Parameters !> !> \param na Order of matrix a !> !> \param nev Number of eigenvalues needed !> !> \param a(lda,matrixCols) Distributed matrix for which eigenvalues are to be computed. !> Distribution is like in Scalapack. !> The full matrix must be set (not only one half like in scalapack). !> Destroyed on exit (upper and lower half). !> !> \param lda Leading dimension of a !> !> \param ev(na) On output: eigenvalues of a, every processor gets the complete set !> !> \param q(ldq,matrixCols) On output: Eigenvectors of a !> Distribution is like in Scalapack. !> Must be always dimensioned to the full size (corresponding to (na,na)) !> even if only a part of the eigenvalues is needed. !> !> \param ldq Leading dimension of q !> !> \param nblk blocksize of cyclic distribution, must be the same in both directions! !> !> \param matrixCols local columns of matrix a and q !> !> \param mpi_comm_rows MPI communicator for rows !> \param mpi_comm_cols MPI communicator for columns !> \param mpi_comm_all MPI communicator for the total processor set !> `````` Lorenz Huedepohl committed May 18, 2017 115 ``````!> \param kernel specify ELPA2 kernel to use `````` Andreas Marek committed Apr 07, 2017 116 117 118 119 120 121 ``````!> !> \param useQR (optional) use QR decomposition !> \param useGPU (optional) decide whether to use GPUs or not !> !> \result success logical, false if error occured !------------------------------------------------------------------------------- `````` Lorenz Huedepohl committed Aug 03, 2017 122 ``````#include "elpa2_template.F90" `````` Andreas Marek committed Apr 07, 2017 123 124 125 126 127 128 ``````#undef REALCASE #undef DOUBLE_PRECISION #ifdef WANT_SINGLE_PRECISION_REAL #define REALCASE 1 #define SINGLE_PRECISION 1 `````` Andreas Marek committed Apr 18, 2017 129 ``````#include "../general/precision_macros.h" `````` Andreas Marek committed Apr 07, 2017 130 ``````!------------------------------------------------------------------------------- `````` Andreas Marek committed Apr 19, 2017 131 ``````!> \brief elpa_solve_evp_real_2stage_single_impl: Fortran function to solve the single-precision real eigenvalue problem with a 2 stage approach `````` Andreas Marek committed Apr 07, 2017 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 ``````!> !> Parameters !> !> \param na Order of matrix a !> !> \param nev Number of eigenvalues needed !> !> \param a(lda,matrixCols) Distributed matrix for which eigenvalues are to be computed. !> Distribution is like in Scalapack. !> The full matrix must be set (not only one half like in scalapack). !> Destroyed on exit (upper and lower half). !> !> \param lda Leading dimension of a !> !> \param ev(na) On output: eigenvalues of a, every processor gets the complete set !> !> \param q(ldq,matrixCols) On output: Eigenvectors of a !> Distribution is like in Scalapack. !> Must be always dimensioned to the full size (corresponding to (na,na)) !> even if only a part of the eigenvalues is needed. !> !> \param ldq Leading dimension of q !> !> \param nblk blocksize of cyclic distribution, must be the same in both directions! !> !> \param matrixCols local columns of matrix a and q !> !> \param mpi_comm_rows MPI communicator for rows !> \param mpi_comm_cols MPI communicator for columns !> \param mpi_comm_all MPI communicator for the total processor set !> `````` Lorenz Huedepohl committed May 18, 2017 163 ``````!> \param kernel specify ELPA2 kernel to use `````` Andreas Marek committed Apr 07, 2017 164 165 166 167 168 169 ``````!> !> \param useQR (optional) use QR decomposition !> \param useGPU (optional) decide whether GPUs should be used or not !> !> \result success logical, false if error occured !------------------------------------------------------------------------------- `````` Lorenz Huedepohl committed Aug 03, 2017 170 ``````#include "elpa2_template.F90" `````` Andreas Marek committed Apr 07, 2017 171 172 173 174 175 176 177 ``````#undef REALCASE #undef SINGLE_PRECISION #endif /* WANT_SINGLE_PRECISION_REAL */ #define COMPLEXCASE 1 #define DOUBLE_PRECISION 1 `````` Andreas Marek committed Apr 18, 2017 178 ``````#include "../general/precision_macros.h" `````` Andreas Marek committed Apr 19, 2017 179 ``````!> \brief elpa_solve_evp_complex_2stage_double_impl: Fortran function to solve the double-precision complex eigenvalue problem with a 2 stage approach `````` Andreas Marek committed Apr 07, 2017 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 206 207 208 209 210 ``````!> !> Parameters !> !> \param na Order of matrix a !> !> \param nev Number of eigenvalues needed !> !> \param a(lda,matrixCols) Distributed matrix for which eigenvalues are to be computed. !> Distribution is like in Scalapack. !> The full matrix must be set (not only one half like in scalapack). !> Destroyed on exit (upper and lower half). !> !> \param lda Leading dimension of a !> !> \param ev(na) On output: eigenvalues of a, every processor gets the complete set !> !> \param q(ldq,matrixCols) On output: Eigenvectors of a !> Distribution is like in Scalapack. !> Must be always dimensioned to the full size (corresponding to (na,na)) !> even if only a part of the eigenvalues is needed. !> !> \param ldq Leading dimension of q !> !> \param nblk blocksize of cyclic distribution, must be the same in both directions! !> !> \param matrixCols local columns of matrix a and q !> !> \param mpi_comm_rows MPI communicator for rows !> \param mpi_comm_cols MPI communicator for columns !> \param mpi_comm_all MPI communicator for the total processor set !> `````` Lorenz Huedepohl committed May 18, 2017 211 ``````!> \param kernel specify ELPA2 kernel to use `````` Andreas Marek committed Apr 07, 2017 212 213 214 215 ``````!> \param useGPU (optional) decide whether GPUs should be used or not !> !> \result success logical, false if error occured !------------------------------------------------------------------------------- `````` Lorenz Huedepohl committed Aug 03, 2017 216 ``````#include "elpa2_template.F90" `````` Andreas Marek committed Apr 07, 2017 217 218 219 220 221 222 223 ``````#undef COMPLEXCASE #undef DOUBLE_PRECISION #ifdef WANT_SINGLE_PRECISION_COMPLEX #define COMPLEXCASE 1 #define SINGLE_PRECISION 1 `````` Andreas Marek committed Apr 18, 2017 224 ``````#include "../general/precision_macros.h" `````` Andreas Marek committed Apr 07, 2017 225 `````` `````` Andreas Marek committed Apr 19, 2017 226 ``````!> \brief elpa_solve_evp_complex_2stage_single_impl: Fortran function to solve the single-precision complex eigenvalue problem with a 2 stage approach `````` Andreas Marek committed Apr 07, 2017 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 ``````!> !> Parameters !> !> \param na Order of matrix a !> !> \param nev Number of eigenvalues needed !> !> \param a(lda,matrixCols) Distributed matrix for which eigenvalues are to be computed. !> Distribution is like in Scalapack. !> The full matrix must be set (not only one half like in scalapack). !> Destroyed on exit (upper and lower half). !> !> \param lda Leading dimension of a !> !> \param ev(na) On output: eigenvalues of a, every processor gets the complete set !> !> \param q(ldq,matrixCols) On output: Eigenvectors of a !> Distribution is like in Scalapack. !> Must be always dimensioned to the full size (corresponding to (na,na)) !> even if only a part of the eigenvalues is needed. !> !> \param ldq Leading dimension of q !> !> \param nblk blocksize of cyclic distribution, must be the same in both directions! !> !> \param matrixCols local columns of matrix a and q !> !> \param mpi_comm_rows MPI communicator for rows !> \param mpi_comm_cols MPI communicator for columns !> \param mpi_comm_all MPI communicator for the total processor set !> `````` Lorenz Huedepohl committed May 18, 2017 258 259 ``````!> \param kernel specify ELPA2 kernel to use !> \param useGPU (optional) decide whether GPUs should be used or not `````` Andreas Marek committed Apr 07, 2017 260 261 262 ``````!> !> \result success logical, false if error occured !------------------------------------------------------------------------------- `````` Lorenz Huedepohl committed Aug 03, 2017 263 ``````#include "elpa2_template.F90" `````` Andreas Marek committed Apr 07, 2017 264 265 266 267 268 269 ``````#undef COMPLEXCASE #undef SINGLE_PRECISION #endif /* WANT_SINGLE_PRECISION_COMPLEX */ `````` Andreas Marek committed Apr 19, 2017 270 ``end module elpa2_impl``