elpa1.F90 31.5 KB
 Andreas Marek committed May 26, 2014 1 2 ``````! This file is part of ELPA. ! `````` Andreas Marek committed Feb 11, 2015 3 ``````! The ELPA library was originally created by the ELPA consortium, `````` Andreas Marek committed May 26, 2014 4 5 ``````! consisting of the following organizations: ! `````` Andreas Marek committed Feb 11, 2015 6 ``````! - Rechenzentrum Garching der Max-Planck-Gesellschaft (RZG), `````` Andreas Marek committed May 26, 2014 7 8 9 ``````! - Bergische Universität Wuppertal, Lehrstuhl für angewandte ! Informatik, ! - Technische Universität München, Lehrstuhl für Informatik mit `````` Andreas Marek committed Feb 11, 2015 10 11 ``````! Schwerpunkt Wissenschaftliches Rechnen , ! - Fritz-Haber-Institut, Berlin, Abt. Theorie, `````` Andreas Marek committed Aug 04, 2016 12 ``````! - Max-Plack-Institut für Mathematik in den Naturwissenschaften, `````` Andreas Marek committed Feb 11, 2015 13 14 ``````! Leipzig, Abt. Komplexe Strukutren in Biologie und Kognition, ! and `````` Andreas Marek committed May 26, 2014 15 16 ``````! - IBM Deutschland GmbH ! `````` 17 ``````! This particular source code file contains additions, changes and `````` Andreas Marek committed Nov 05, 2015 18 ``````! enhancements authored by Intel Corporation which is not part of `````` 19 ``````! the ELPA consortium. `````` Andreas Marek committed May 26, 2014 20 21 ``````! ! More information can be found here: `````` Andreas Marek committed Dec 11, 2015 22 ``````! http://elpa.mpcdf.mpg.de/ `````` Andreas Marek committed May 26, 2014 23 24 ``````! ! ELPA is free software: you can redistribute it and/or modify `````` Andreas Marek committed Feb 11, 2015 25 26 ``````! it under the terms of the version 3 of the license of the ! GNU Lesser General Public License as published by the Free `````` Andreas Marek committed May 26, 2014 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 ``````! 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. ! ! ! ELPA1 -- Faster replacements for ScaLAPACK symmetric eigenvalue routines `````` Andreas Marek committed Feb 11, 2015 46 ``````! `````` Andreas Marek committed May 26, 2014 47 48 49 50 51 ``````! 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". `````` Andreas Marek committed Dec 10, 2015 52 53 54 ``````!> \mainpage !> Eigenvalue SoLvers for Petaflop-Applications (ELPA) !> \par `````` Andreas Marek committed Dec 11, 2015 55 ``````!> http://elpa.mpcdf.mpg.de `````` Andreas Marek committed Dec 10, 2015 56 57 58 59 60 61 62 63 64 65 66 67 ``````!> !> \par !> The ELPA library was originally created by the ELPA consortium, !> consisting of the following organizations: !> !> - Max Planck Computing and Data Facility (MPCDF) formerly 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, `````` Andreas Marek committed Aug 04, 2016 68 ``````!> - Max-Plack-Institut für Mathematik in den Naturwissenschaften, `````` Andreas Marek committed Dec 10, 2015 69 70 71 72 73 74 75 76 77 78 79 ``````!> Leipzig, Abt. Komplexe Strukutren in Biologie und Kognition, !> and !> - IBM Deutschland GmbH !> !> Some parts and enhancements of ELPA have been contributed and authored !> by the Intel Corporation which is not part of the ELPA consortium. !> !> Contributions to the ELPA source have been authored by (in alphabetical order): !> !> \author T. Auckenthaler, Volker Blum, A. Heinecke, L. Huedepohl, R. Johanni, Werner Jürgens, and A. Marek `````` Andreas Marek committed May 26, 2014 80 `````` `````` Andreas Marek committed Dec 10, 2015 81 ``````#include "config-f90.h" `````` Andreas Marek committed Mar 18, 2016 82 `````` `````` Andreas Marek committed Dec 10, 2015 83 ``````!> \brief Fortran module which provides the routines to use the one-stage ELPA solver `````` Andreas Marek committed May 26, 2014 84 ``````module ELPA1 `````` Andreas Marek committed Nov 01, 2016 85 `````` use, intrinsic :: iso_c_binding `````` Andreas Marek committed Feb 11, 2015 86 `````` use elpa_utilities `````` Andreas Marek committed Jun 10, 2016 87 `````` use elpa1_auxiliary `````` Pavel Kus committed Nov 22, 2016 88 `````` use elpa1_utilities `````` Andreas Marek committed Feb 26, 2016 89 `````` `````` Andreas Marek committed May 26, 2014 90 91 92 `````` implicit none ! The following routines are public: `````` Andreas Marek committed Jun 16, 2016 93 `````` private `````` Andreas Marek committed May 26, 2014 94 `````` `````` Andreas Marek committed Nov 11, 2016 95 96 97 `````` public :: get_elpa_row_col_comms !< old, deprecated interface, will be deleted. Use elpa_get_communicators instead public :: get_elpa_communicators !< Sets MPI row/col communicators; OLD and deprecated interface, will be deleted. Use elpa_get_communicators instead public :: elpa_get_communicators !< Sets MPI row/col communicators as needed by ELPA `````` Andreas Marek committed May 26, 2014 98 `````` `````` Andreas Marek committed Nov 11, 2016 99 100 101 102 103 `````` public :: solve_evp_real !< old, deprecated interface: Driver routine for real double-precision eigenvalue problem DO NOT USE. Will be deleted at some point public :: elpa_solve_evp_real_1stage_double !< Driver routine for real double-precision 1-stage eigenvalue problem public :: solve_evp_real_1stage !< Driver routine for real double-precision eigenvalue problem public :: solve_evp_real_1stage_double !< Driver routine for real double-precision eigenvalue problem `````` Andreas Marek committed Mar 18, 2016 104 ``````#ifdef WANT_SINGLE_PRECISION_REAL `````` Andreas Marek committed Nov 11, 2016 105 106 107 `````` public :: solve_evp_real_1stage_single !< Driver routine for real single-precision eigenvalue problem public :: elpa_solve_evp_real_1stage_single !< Driver routine for real single-precision 1-stage eigenvalue problem `````` Andreas Marek committed Mar 18, 2016 108 ``````#endif `````` Andreas Marek committed Nov 11, 2016 109 110 111 112 `````` public :: solve_evp_complex !< old, deprecated interface: Driver routine for complex double-precision eigenvalue problem DO NOT USE. Will be deleted at some point public :: elpa_solve_evp_complex_1stage_double !< Driver routine for complex 1-stage eigenvalue problem public :: solve_evp_complex_1stage !< Driver routine for complex double-precision eigenvalue problem public :: solve_evp_complex_1stage_double !< Driver routine for complex double-precision eigenvalue problem `````` Andreas Marek committed Mar 18, 2016 113 ``````#ifdef WANT_SINGLE_PRECISION_COMPLEX `````` Andreas Marek committed Nov 11, 2016 114 115 `````` public :: solve_evp_complex_1stage_single !< Driver routine for complex single-precision eigenvalue problem public :: elpa_solve_evp_complex_1stage_single !< Driver routine for complex 1-stage eigenvalue problem `````` Andreas Marek committed Mar 18, 2016 116 ``````#endif `````` Andreas Marek committed May 26, 2014 117 `````` `````` Andreas Marek committed Jun 16, 2016 118 119 `````` ! imported from elpa1_auxilliary `````` Andreas Marek committed Jul 07, 2016 120 121 `````` public :: elpa_mult_at_b_real_double !< Multiply double-precision real matrices A**T * B public :: mult_at_b_real !< old, deprecated interface to multiply double-precision real matrices A**T * B DO NOT USE `````` Andreas Marek committed Jun 16, 2016 122 `````` `````` Andreas Marek committed Jul 07, 2016 123 124 `````` public :: elpa_mult_ah_b_complex_double !< Multiply double-precision complex matrices A**H * B public :: mult_ah_b_complex !< old, deprecated interface to multiply double-preicion complex matrices A**H * B DO NOT USE `````` Andreas Marek committed Jun 16, 2016 125 `````` `````` Andreas Marek committed Jul 07, 2016 126 127 `````` public :: elpa_invert_trm_real_double !< Invert double-precision real triangular matrix public :: invert_trm_real !< old, deprecated interface to invert double-precision real triangular matrix DO NOT USE `````` Andreas Marek committed Jun 29, 2016 128 `````` `````` Andreas Marek committed Jul 07, 2016 129 130 `````` public :: elpa_invert_trm_complex_double !< Invert double-precision complex triangular matrix public :: invert_trm_complex !< old, deprecated interface to invert double-precision complex triangular matrix DO NOT USE `````` Andreas Marek committed Jun 29, 2016 131 `````` `````` Andreas Marek committed Jul 07, 2016 132 133 `````` public :: elpa_cholesky_real_double !< Cholesky factorization of a double-precision real matrix public :: cholesky_real !< old, deprecated interface to do Cholesky factorization of a double-precision real matrix DO NOT USE `````` Andreas Marek committed Jun 29, 2016 134 `````` `````` Andreas Marek committed Jul 07, 2016 135 136 `````` public :: elpa_cholesky_complex_double !< Cholesky factorization of a double-precision complex matrix public :: cholesky_complex !< old, deprecated interface to do Cholesky factorization of a double-precision complex matrix DO NOT USE `````` Andreas Marek committed Jun 29, 2016 137 `````` `````` Andreas Marek committed Jul 07, 2016 138 `````` public :: elpa_solve_tridi_double !< Solve a double-precision tridiagonal eigensystem with divide and conquer method `````` Andreas Marek committed Jun 16, 2016 139 `````` `````` Andreas Marek committed Jul 07, 2016 140 141 142 143 144 145 146 147 148 149 150 151 ``````#ifdef WANT_SINGLE_PRECISION_REAL public :: elpa_mult_at_b_real_single !< Multiply single-precision real matrices A**T * B public :: elpa_invert_trm_real_single !< Invert single-precision real triangular matrix public :: elpa_cholesky_real_single !< Cholesky factorization of a single-precision real matrix public :: elpa_solve_tridi_single !< Solve a single-precision tridiagonal eigensystem with divide and conquer method #endif #ifdef WANT_SINGLE_PRECISION_COMPLEX public :: elpa_mult_ah_b_complex_single !< Multiply single-precision complex matrices A**H * B public :: elpa_invert_trm_complex_single !< Invert single-precision complex triangular matrix public :: elpa_cholesky_complex_single !< Cholesky factorization of a single-precision complex matrix #endif `````` Andreas Marek committed Jun 16, 2016 152 `````` `````` Andreas Marek committed May 26, 2014 153 154 `````` ! Timing results, set by every call to solve_evp_xxx `````` Andreas Marek committed Feb 11, 2016 155 156 157 `````` real(kind=c_double), public :: time_evp_fwd !< time for forward transformations (to tridiagonal form) real(kind=c_double), public :: time_evp_solve !< time for solving the tridiagonal system real(kind=c_double), public :: time_evp_back !< time for back transformations of eigenvectors `````` Andreas Marek committed May 26, 2014 158 `````` `````` Andreas Marek committed Dec 10, 2015 159 `````` logical, public :: elpa_print_times = .false. !< Set elpa_print_times to .true. for explicit timing outputs `````` Andreas Marek committed May 26, 2014 160 161 `````` `````` Andreas Marek committed Nov 01, 2016 162 ``````!> \brief get_elpa_row_col_comms: old, deprecated interface, will be deleted. Use "elpa_get_communicators" `````` Andreas Marek committed Jun 14, 2016 163 ``````!> \details `````` Andreas Marek committed Dec 16, 2015 164 165 166 167 168 169 170 171 172 173 174 175 ``````!> The interface and variable definition is the same as in "elpa_get_communicators" !> \param mpi_comm_global Global communicator for the calculations (in) !> !> \param my_prow Row coordinate of the calling process in the process grid (in) !> !> \param my_pcol Column coordinate of the calling process in the process grid (in) !> !> \param mpi_comm_rows Communicator for communicating within rows of processes (out) !> !> \param mpi_comm_cols Communicator for communicating within columns of processes (out) !> \result mpierr integer error value of mpi_comm_split function interface get_elpa_row_col_comms `````` Andreas Marek committed Nov 24, 2016 176 `````` module procedure elpa_get_communicators `````` Andreas Marek committed Dec 16, 2015 177 178 `````` end interface `````` Andreas Marek committed Nov 11, 2016 179 180 181 182 183 184 185 186 187 188 189 190 191 192 ``````!> \brief elpa_get_communicators: Fortran interface to set the communicators needed by ELPA !> \details !> The interface and variable definition is the same as in "elpa_get_communicators" !> \param mpi_comm_global Global communicator for the calculations (in) !> !> \param my_prow Row coordinate of the calling process in the process grid (in) !> !> \param my_pcol Column coordinate of the calling process in the process grid (in) !> !> \param mpi_comm_rows Communicator for communicating within rows of processes (out) !> !> \param mpi_comm_cols Communicator for communicating within columns of processes (out) !> \result mpierr integer error value of mpi_comm_split function `````` Andreas Marek committed Nov 24, 2016 193 194 `````` interface get_elpa_communicators module procedure elpa_get_communicators `````` Andreas Marek committed Oct 29, 2016 195 196 `````` end interface `````` 197 ``````!> \brief solve_evp_real: old, deprecated Fortran function to solve the real eigenvalue problem with 1-stage solver. Will be deleted at some point. Better use "solve_evp_real_1stage" or "elpa_solve_evp_real" `````` Andreas Marek committed Dec 16, 2015 198 ``````!> `````` Andreas Marek committed Jun 14, 2016 199 ``````!> \details `````` Andreas Marek committed Jul 07, 2016 200 ``````!> The interface and variable definition is the same as in "elpa_solve_evp_real_1stage_double" `````` Andreas Marek committed Dec 16, 2015 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 ``````! Parameters ! !> \param na Order of matrix a !> !> \param nev Number of eigenvalues needed. !> The smallest nev eigenvalues/eigenvectors are calculated. !> !> \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 distributed number of matrix columns !> !> \param mpi_comm_rows MPI-Communicator for rows !> \param mpi_comm_cols MPI-Communicator for columns !> !> \result success interface solve_evp_real `````` Andreas Marek committed Nov 24, 2016 235 `````` module procedure elpa_solve_evp_real_1stage_double `````` Andreas Marek committed Mar 18, 2016 236 237 238 `````` end interface interface solve_evp_real_1stage `````` Andreas Marek committed Nov 24, 2016 239 `````` module procedure elpa_solve_evp_real_1stage_double `````` Andreas Marek committed Dec 16, 2015 240 241 `````` end interface `````` Andreas Marek committed Nov 11, 2016 242 ``````!> \brief elpa_solve_evp_real_1stage_double: Fortran function to solve the real eigenvalue problem with 1-stage solver. This is called by "elpa_solve_evp_real" `````` Andreas Marek committed Dec 16, 2015 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 ``````!> ! Parameters ! !> \param na Order of matrix a !> !> \param nev Number of eigenvalues needed. !> The smallest nev eigenvalues/eigenvectors are calculated. !> !> \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 distributed number of matrix columns !> !> \param mpi_comm_rows MPI-Communicator for rows !> \param mpi_comm_cols MPI-Communicator for columns !> !> \result success `````` Andreas Marek committed Nov 24, 2016 275 276 277 278 279 280 `````` !interface elpa_solve_evp_real_1stage_double ! module procedure solve_evp_real_1stage_double !end interface interface solve_evp_real_1stage_double module procedure elpa_solve_evp_real_1stage_double `````` Andreas Marek committed Nov 11, 2016 281 `````` end interface `````` Andreas Marek committed Dec 16, 2015 282 283 `````` `````` Andreas Marek committed Nov 11, 2016 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 ``````!> \brief solve_evp_complex: old, deprecated Fortran function to solve the complex eigenvalue problem with 1-stage solver. will be deleted at some point. Better use "solve_evp_complex_1stage" or "elpa_solve_evp_complex" !> !> \details !> The interface and variable definition is the same as in "elpa_solve_evp_complex_1stage_double" ! Parameters ! !> \param na Order of matrix a !> !> \param nev Number of eigenvalues needed. !> The smallest nev eigenvalues/eigenvectors are calculated. !> !> \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 distributed number of matrix columns !> !> \param mpi_comm_rows MPI-Communicator for rows !> \param mpi_comm_cols MPI-Communicator for columns !> !> \result success `````` Andreas Marek committed Dec 16, 2015 319 `````` interface solve_evp_complex `````` Andreas Marek committed Nov 24, 2016 320 `````` module procedure elpa_solve_evp_complex_1stage_double `````` Andreas Marek committed Mar 18, 2016 321 `````` end interface `````` Andreas Marek committed Nov 24, 2016 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 ``````!> \brief solve_evp_complex: old, deprecated Fortran function to solve the complex eigenvalue problem with 1-stage solver. will be deleted at some point. Better use "solve_evp_complex_1stage" or "elpa_solve_evp_complex" !> !> \details !> The interface and variable definition is the same as in "elpa_solve_evp_complex_1stage_double" ! Parameters ! !> \param na Order of matrix a !> !> \param nev Number of eigenvalues needed. !> The smallest nev eigenvalues/eigenvectors are calculated. !> !> \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 distributed number of matrix columns !> !> \param mpi_comm_rows MPI-Communicator for rows !> \param mpi_comm_cols MPI-Communicator for columns !> !> \result success `````` Andreas Marek committed Mar 18, 2016 357 `````` interface solve_evp_complex_1stage `````` Andreas Marek committed Nov 24, 2016 358 `````` module procedure elpa_solve_evp_complex_1stage_double `````` Andreas Marek committed Dec 16, 2015 359 360 `````` end interface `````` Andreas Marek committed Nov 24, 2016 361 ``````!> \brief solve_evp_complex_1stage_double: Fortran function to solve the complex eigenvalue problem with 1-stage solver. This is called by "elpa_solve_evp_complex" `````` Andreas Marek committed Nov 11, 2016 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 ``````!> ! Parameters ! !> \param na Order of matrix a !> !> \param nev Number of eigenvalues needed. !> The smallest nev eigenvalues/eigenvectors are calculated. !> !> \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 distributed number of matrix columns !> !> \param mpi_comm_rows MPI-Communicator for rows !> \param mpi_comm_cols MPI-Communicator for columns !> !> \result success `````` Andreas Marek committed Nov 24, 2016 394 395 `````` interface solve_evp_complex_1stage_double module procedure elpa_solve_evp_complex_1stage_double `````` Andreas Marek committed Nov 11, 2016 396 397 398 `````` end interface #ifdef WANT_SINGLE_PRECISION_REAL `````` Andreas Marek committed Nov 24, 2016 399 ``````!> \brief solve_evp_real_1stage_single: Fortran function to solve the real single-precision eigenvalue problem with 1-stage solver `````` Andreas Marek committed Nov 11, 2016 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 ``````!> ! Parameters ! !> \param na Order of matrix a !> !> \param nev Number of eigenvalues needed. !> The smallest nev eigenvalues/eigenvectors are calculated. !> !> \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 distributed number of matrix columns !> !> \param mpi_comm_rows MPI-Communicator for rows !> \param mpi_comm_cols MPI-Communicator for columns !> !> \result success `````` Andreas Marek committed Nov 24, 2016 433 434 `````` interface solve_evp_real_1stage_single module procedure elpa_solve_evp_real_1stage_single `````` Andreas Marek committed Nov 11, 2016 435 436 437 438 `````` end interface #endif #ifdef WANT_SINGLE_PRECISION_COMPLEX `````` Andreas Marek committed Nov 24, 2016 439 ``````!> \brief solve_evp_complex_1stage_single: Fortran function to solve the complex single-precision eigenvalue problem with 1-stage solver `````` Andreas Marek committed Nov 11, 2016 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 ``````!> ! Parameters ! !> \param na Order of matrix a !> !> \param nev Number of eigenvalues needed. !> The smallest nev eigenvalues/eigenvectors are calculated. !> !> \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 distributed number of matrix columns !> !> \param mpi_comm_rows MPI-Communicator for rows !> \param mpi_comm_cols MPI-Communicator for columns `````` Andreas Marek committed Nov 24, 2016 470 471 ``````!> \param mpi_comm_all global MPI communicator !> \param useGPU `````` Andreas Marek committed Nov 11, 2016 472 473 ``````!> !> \result success `````` Andreas Marek committed Nov 24, 2016 474 475 ``````interface solve_evp_complex_1stage_single module procedure elpa_solve_evp_complex_1stage_single `````` Andreas Marek committed Nov 11, 2016 476 477 478 479 ``````end interface #endif `````` Andreas Marek committed May 26, 2014 480 481 482 483 484 485 486 487 488 489 ``````contains !------------------------------------------------------------------------------- ! All ELPA routines need MPI communicators for communicating within ! rows or columns of processes, these are set here. ! mpi_comm_rows/mpi_comm_cols can be free'd with MPI_Comm_free if not used any more. ! ! Parameters ! `````` Andreas Marek committed Dec 10, 2015 490 491 492 493 494 495 496 497 498 499 500 501 ``````!> \param mpi_comm_global Global communicator for the calculations (in) !> !> \param my_prow Row coordinate of the calling process in the process grid (in) !> !> \param my_pcol Column coordinate of the calling process in the process grid (in) !> !> \param mpi_comm_rows Communicator for communicating within rows of processes (out) !> !> \param mpi_comm_cols Communicator for communicating within columns of processes (out) !> \result mpierr integer error value of mpi_comm_split function `````` Andreas Marek committed Nov 24, 2016 502 ``````function elpa_get_communicators(mpi_comm_global, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols) result(mpierr) `````` Andreas Marek committed Nov 01, 2016 503 `````` ! use precision `````` Lorenz Huedepohl committed May 24, 2016 504 `````` use elpa_mpi `````` Andreas Marek committed Nov 01, 2016 505 `````` use iso_c_binding `````` Andreas Marek committed May 26, 2014 506 507 `````` implicit none `````` Andreas Marek committed Nov 01, 2016 508 509 `````` integer(kind=c_int), intent(in) :: mpi_comm_global, my_prow, my_pcol integer(kind=c_int), intent(out) :: mpi_comm_rows, mpi_comm_cols `````` Andreas Marek committed May 26, 2014 510 `````` `````` Andreas Marek committed Nov 01, 2016 511 `````` integer(kind=c_int) :: mpierr `````` Andreas Marek committed May 26, 2014 512 513 514 515 516 517 518 519 520 `````` ! mpi_comm_rows is used for communicating WITHIN rows, i.e. all processes ! having the same column coordinate share one mpi_comm_rows. ! So the "color" for splitting is my_pcol and the "key" is my row coordinate. ! Analogous for mpi_comm_cols call mpi_comm_split(mpi_comm_global,my_pcol,my_prow,mpi_comm_rows,mpierr) call mpi_comm_split(mpi_comm_global,my_prow,my_pcol,mpi_comm_cols,mpierr) `````` Andreas Marek committed Nov 24, 2016 521 ``````end function elpa_get_communicators `````` Andreas Marek committed May 26, 2014 522 523 `````` `````` Andreas Marek committed Nov 24, 2016 524 ``````!> \brief elpa_solve_evp_real_1stage_double: Fortran function to solve the real double-precision eigenvalue problem with 1-stage solver `````` Andreas Marek committed Dec 10, 2015 525 ``````!> `````` Andreas Marek committed May 26, 2014 526 527 ``````! Parameters ! `````` Andreas Marek committed Dec 10, 2015 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 ``````!> \param na Order of matrix a !> !> \param nev Number of eigenvalues needed. !> The smallest nev eigenvalues/eigenvectors are calculated. !> !> \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 distributed number of matrix columns !> !> \param mpi_comm_rows MPI-Communicator for rows !> \param mpi_comm_cols MPI-Communicator for columns `````` Andreas Marek committed Nov 24, 2016 555 556 ``````!> \param mpi_comm_all global MPI communicator !> \param useGPU use GPU version (.true. or .false.) `````` Andreas Marek committed Dec 10, 2015 557 558 559 ``````!> !> \result success `````` Andreas Marek committed Mar 31, 2017 560 561 ``````#define REALCASE 1 #define DOUBLE_PRECISION 1 `````` Andreas Marek committed Apr 06, 2017 562 ``````#include "../precision_macros.h" `````` Andreas Marek committed Mar 31, 2017 563 564 565 ``````#include "elpa1_template.X90" #undef REALCASE #undef DOUBLE_PRECISION `````` Andreas Marek committed Mar 18, 2016 566 567 `````` #ifdef WANT_SINGLE_PRECISION_REAL `````` Andreas Marek committed Nov 24, 2016 568 ``````!> \brief elpa_solve_evp_real_1stage_single: Fortran function to solve the real single-precision eigenvalue problem with 1-stage solver `````` Andreas Marek committed Mar 18, 2016 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 ``````!> ! Parameters ! !> \param na Order of matrix a !> !> \param nev Number of eigenvalues needed. !> The smallest nev eigenvalues/eigenvectors are calculated. !> !> \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 distributed number of matrix columns !> !> \param mpi_comm_rows MPI-Communicator for rows !> \param mpi_comm_cols MPI-Communicator for columns `````` Andreas Marek committed Nov 24, 2016 599 600 ``````!> \param mpi_comm_all global MPI commuicator !> \param useGPU `````` Andreas Marek committed Mar 18, 2016 601 602 603 ``````!> !> \result success `````` Andreas Marek committed Mar 31, 2017 604 ``````#define REALCASE 1 `````` Andreas Marek committed Mar 31, 2017 605 ``````#define SINGLE_PRECISION 1 `````` Andreas Marek committed Apr 06, 2017 606 ``````#include "../precision_macros.h" `````` Andreas Marek committed Mar 31, 2017 607 608 ``````#include "elpa1_template.X90" #undef REALCASE `````` Andreas Marek committed Mar 31, 2017 609 ``````#undef SINGLE_PRECISION `````` Andreas Marek committed Mar 18, 2016 610 ``````#endif /* WANT_SINGLE_PRECISION_REAL */ `````` Andreas Marek committed May 26, 2014 611 `````` `````` Andreas Marek committed Nov 24, 2016 612 ``````!> \brief elpa_solve_evp_complex_1stage_double: Fortran function to solve the complex double-precision eigenvalue problem with 1-stage solver `````` Andreas Marek committed Dec 10, 2015 613 ``````!> `````` Andreas Marek committed May 26, 2014 614 615 ``````! Parameters ! `````` Andreas Marek committed Dec 10, 2015 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 ``````!> \param na Order of matrix a !> !> \param nev Number of eigenvalues needed. !> The smallest nev eigenvalues/eigenvectors are calculated. !> !> \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 distributed number of matrix columns !> !> \param mpi_comm_rows MPI-Communicator for rows !> \param mpi_comm_cols MPI-Communicator for columns `````` Andreas Marek committed Nov 24, 2016 643 644 ``````!> \param mpi_comm_all global MPI Communicator !> \param useGPU use GPU version (.true. or .false.) `````` Andreas Marek committed Dec 10, 2015 645 646 ``````!> !> \result success `````` Andreas Marek committed Mar 31, 2017 647 648 ``````#define COMPLEXCASE 1 #define DOUBLE_PRECISION 1 `````` Andreas Marek committed Apr 06, 2017 649 ``````#include "../precision_macros.h" `````` Andreas Marek committed Mar 31, 2017 650 651 652 ``````#include "elpa1_template.X90" #undef DOUBLE_PRECISION #undef COMPLEXCASE `````` Andreas Marek committed Mar 18, 2016 653 654 655 656 `````` #ifdef WANT_SINGLE_PRECISION_COMPLEX `````` Andreas Marek committed Nov 24, 2016 657 ``````!> \brief elpa_solve_evp_complex_1stage_single: Fortran function to solve the complex single-precision eigenvalue problem with 1-stage solver `````` Andreas Marek committed Mar 18, 2016 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 ``````!> ! Parameters ! !> \param na Order of matrix a !> !> \param nev Number of eigenvalues needed. !> The smallest nev eigenvalues/eigenvectors are calculated. !> !> \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 distributed number of matrix columns !> !> \param mpi_comm_rows MPI-Communicator for rows !> \param mpi_comm_cols MPI-Communicator for columns `````` Andreas Marek committed Nov 24, 2016 688 689 ``````!> \param mpi_comm_all global MPI communicator !> \param useGPU `````` Andreas Marek committed Mar 18, 2016 690 691 692 ``````!> !> \result success `````` Andreas Marek committed Mar 31, 2017 693 ``````#define COMPLEXCASE 1 `````` Andreas Marek committed Mar 31, 2017 694 ``````#define SINGLE_PRECISION `````` Andreas Marek committed Apr 06, 2017 695 ``````#include "../precision_macros.h" `````` Andreas Marek committed Mar 31, 2017 696 697 ``````#include "elpa1_template.X90" #undef COMPLEXCASE `````` Andreas Marek committed Mar 31, 2017 698 ``````#undef SINGLE_PRECISION `````` Andreas Marek committed Mar 18, 2016 699 ``````#endif /* WANT_SINGLE_PRECISION_COMPLEX */ `````` Andreas Marek committed May 26, 2014 700 701 `````` end module ELPA1``````