elpa_solve_tridi_impl_public.F90 4.59 KB
Newer Older
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 56
!    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), 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,
!    - 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 <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".
!
! Author: A. Marek, MPCDF



57
#include "../general/sanity.F90"
58 59 60

      use elpa1_compute, solve_tridi_&
                         &PRECISION&
Andreas Marek's avatar
Andreas Marek committed
61 62 63
                         &_private_impl => solve_tridi_&
                         &PRECISION&
                         &_impl
64
      use precision
65
      use elpa_abstract_impl
Andreas Marek's avatar
Andreas Marek committed
66 67 68
#ifdef WITH_OPENMP
      use omp_lib
#endif
69 70

      implicit none
71
      class(elpa_abstract_impl_t), intent(inout) :: obj
72
      integer(kind=ik)         :: na, nev, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols
73
      real(kind=REAL_DATATYPE) :: d(obj%na), e(obj%na)
74
#ifdef USE_ASSUMED_SIZE
75
      real(kind=REAL_DATATYPE) :: q(obj%local_nrows,*)
76
#else
77
      real(kind=REAL_DATATYPE) :: q(obj%local_nrows, obj%local_ncols)
78 79
#endif

80 81
      logical                  :: wantDebug
      logical                  :: success
82

Andreas Marek's avatar
Andreas Marek committed
83
      integer                  :: debug, error
Andreas Marek's avatar
Andreas Marek committed
84
      integer                  :: max_threads
85

86
      call obj%timer%start("elpa_solve_tridi_public_&
Andreas Marek's avatar
Andreas Marek committed
87 88 89 90
      &MATH_DATATYPE&
      &_&
      &PRECISION&
      &")
91 92 93 94 95 96
      na         = obj%na
      nev        = obj%nev
      nblk       = obj%nblk
      ldq        = obj%local_nrows
      matrixCols = obj%local_ncols

Andreas Marek's avatar
Andreas Marek committed
97 98 99 100 101 102
#ifdef WITH_OPENMP
      max_threads=omp_get_num_threads()
#else
      max_threads=1
#endif

Andreas Marek's avatar
Andreas Marek committed
103 104 105 106 107 108 109 110 111 112
      call obj%get("mpi_comm_rows", mpi_comm_rows,error)
      if (error .ne. ELPA_OK) then
        print *,"Problem getting option. Aborting..."
        stop
      endif
      call obj%get("mpi_comm_cols", mpi_comm_cols,error)
      if (error .ne. ELPA_OK) then
        print *,"Problem getting option. Aborting..."
        stop
      endif
113

Andreas Marek's avatar
Andreas Marek committed
114 115 116 117 118
      call obj%get("debug",debug,error)
      if (error .ne. ELPA_OK) then
        print *,"Problem getting option. Aborting..."
        stop
      endif
119
      if (debug == 1) then
120 121 122 123
        wantDebug = .true.
      else
        wantDebug = .false.
      endif
124 125 126 127
      success = .false.

      call solve_tridi_&
      &PRECISION&
128
      &_private_impl(obj, na, nev, d, e, q, ldq, nblk, matrixCols, &
Andreas Marek's avatar
Andreas Marek committed
129 130
               mpi_comm_rows, mpi_comm_cols,.false., wantDebug, success, &
               max_threads)
131

132
      call obj%timer%stop("elpa_solve_tridi_public_&
Andreas Marek's avatar
Andreas Marek committed
133 134 135 136 137 138
      &MATH_DATATYPE&
      &_&
      &PRECISION&
      &")


139 140 141 142 143
#undef REALCASE
#undef COMPLEXCASE
#undef DOUBLE_PRECISION
#undef SINGLE_PRECISION