Line data Source code
1 : !
2 : ! Copyright 2017, L. Hüdepohl and A. Marek, MPCDF
3 : !
4 : ! This file is part of ELPA.
5 : !
6 : ! The ELPA library was originally created by the ELPA consortium,
7 : ! consisting of the following organizations:
8 : !
9 : ! - Max Planck Computing and Data Facility (MPCDF), formerly known as
10 : ! Rechenzentrum Garching der Max-Planck-Gesellschaft (RZG),
11 : ! - Bergische Universität Wuppertal, Lehrstuhl für angewandte
12 : ! Informatik,
13 : ! - Technische Universität München, Lehrstuhl für Informatik mit
14 : ! Schwerpunkt Wissenschaftliches Rechnen ,
15 : ! - Fritz-Haber-Institut, Berlin, Abt. Theorie,
16 : ! - Max-Plack-Institut für Mathematik in den Naturwissenschaften,
17 : ! Leipzig, Abt. Komplexe Strukutren in Biologie und Kognition,
18 : ! and
19 : ! - IBM Deutschland GmbH
20 : !
21 : ! This particular source code file contains additions, changes and
22 : ! enhancements authored by Intel Corporation which is not part of
23 : ! the ELPA consortium.
24 : !
25 : ! More information can be found here:
26 : ! http://elpa.mpcdf.mpg.de/
27 : !
28 : ! ELPA is free software: you can redistribute it and/or modify
29 : ! it under the terms of the version 3 of the license of the
30 : ! GNU Lesser General Public License as published by the Free
31 : ! Software Foundation.
32 : !
33 : ! ELPA is distributed in the hope that it will be useful,
34 : ! but WITHOUT ANY WARRANTY; without even the implied warranty of
35 : ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 : ! GNU Lesser General Public License for more details.
37 : !
38 : ! You should have received a copy of the GNU Lesser General Public License
39 : ! along with ELPA. If not, see <http://www.gnu.org/licenses/>
40 : !
41 : ! ELPA reflects a substantial effort on the part of the original
42 : ! ELPA consortium, and we ask you to respect the spirit of the
43 : ! license that we chose: i.e., please contribute any changes you
44 : ! may have back to the original ELPA library distribution, and keep
45 : ! any derivatives of ELPA under the same license that we chose for
46 : ! the original distribution, the GNU Lesser General Public License.
47 : !
48 :
49 : ! The ELPA public API
50 :
51 :
52 : !> \mainpage
53 : !> Eigenvalue SoLvers for Petaflop-Applications (ELPA)
54 : !> \par
55 : !> http://elpa.mpcdf.mpg.de
56 : !>
57 : !> \par
58 : !> The ELPA library was originally created by the ELPA consortium,
59 : !> consisting of the following organizations:
60 : !>
61 : !> - Max Planck Computing and Data Facility (MPCDF) formerly known as
62 : !> Rechenzentrum Garching der Max-Planck-Gesellschaft (RZG),
63 : !> - Bergische Universität Wuppertal, Lehrstuhl für angewandte
64 : !> Informatik,
65 : !> - Technische Universität München, Lehrstuhl für Informatik mit
66 : !> Schwerpunkt Wissenschaftliches Rechnen ,
67 : !> - Fritz-Haber-Institut, Berlin, Abt. Theorie,
68 : !> - Max-Plack-Institut für Mathematik in den Naturwissenschaften,
69 : !> Leipzig, Abt. Komplexe Strukutren in Biologie und Kognition,
70 : !> and
71 : !> - IBM Deutschland GmbH
72 : !>
73 : !> Some parts and enhancements of ELPA have been contributed and authored
74 : !> by the Intel Corporation and Nvidia Corporation, which are not part of
75 : !> the ELPA consortium.
76 : !>
77 : !> Maintainance and development of the ELPA library is done by the
78 : !> Max Planck Computing and Data Facility (MPCDF)
79 : !>
80 : !>
81 : !> Futher support of the ELPA library is done by the ELPA-AEO consortium,
82 : !> consisting of the following organizations:
83 : !>
84 : !> - Max Planck Computing and Data Facility (MPCDF) formerly known as
85 : !> Rechenzentrum Garching der Max-Planck-Gesellschaft (RZG),
86 : !> - Bergische Universität Wuppertal, Lehrstuhl für angewandte
87 : !> Informatik,
88 : !> - Technische Universität München, Lehrstuhl für Informatik mit
89 : !> Schwerpunkt Wissenschaftliches Rechnen ,
90 : !> - Technische Universität München, Lehrstuhl für theoretische Chemie,
91 : !> - Fritz-Haber-Institut, Berlin, Abt. Theorie
92 : !>
93 : !>
94 : !> Contributions to the ELPA source have been authored by (in alphabetical order):
95 : !>
96 : !> \author T. Auckenthaler, Volker Blum, A. Heinecke, L. Huedepohl, R. Johanni, Werner Jürgens, Pavel Kus, and A. Marek
97 : !>
98 : !> All the important information is in the \ref elpa_api::elpa_t derived type
99 : !>
100 : !> \brief Abstract definition of the elpa_t type
101 : !>
102 : !>
103 : !> A typical usage of ELPA might look like this:
104 : !>
105 : !> Fortran synopsis
106 : !>
107 : !> \code{.f90}
108 : !> use elpa
109 : !> class(elpa_t), pointer :: elpa
110 : !> integer :: success
111 : !>
112 : !> if (elpa_init(20171201) /= ELPA_OK) then
113 : !> print *, "ELPA API version not supported"
114 : !> stop
115 : !> endif
116 : !> elpa => elpa_allocate()
117 : !>
118 : !> ! set parameters decribing the matrix and it's MPI distribution
119 : !> call elpa%set("na", na, success)
120 : !> call elpa%set("nev", nev, success)
121 : !> call elpa%set("local_nrows", na_rows, success)
122 : !> call elpa%set("local_ncols", na_cols, success)
123 : !> call elpa%set("nblk", nblk, success)
124 : !> call elpa%set("mpi_comm_parent", MPI_COMM_WORLD, success)
125 : !> call elpa%set("process_row", my_prow, success)
126 : !> call elpa%set("process_col", my_pcol, success)
127 : !>
128 : !> succes = elpa%setup()
129 : !>
130 : !> ! if desired, set tunable run-time options
131 : !> call e%set("solver", ELPA_SOLVER_2STAGE, success)
132 : !> \endcode
133 : !> ... set and get all other options that are desired
134 : !> \code{.f90}
135 : !>
136 : !> ! use method solve to solve the eigenvalue problem to obtain eigenvalues
137 : !> ! and eigenvectors
138 : !> ! other possible methods are desribed in \ref elpa_api::elpa_t derived type
139 : !> call e%eigenvectors(a, ev, z, success)
140 : !>
141 : !> ! cleanup
142 : !> call elpa_deallocate(e)
143 : !>
144 : !> call elpa_uninit()
145 : !> \endcode
146 : !>
147 : !>
148 : !> C synopsis
149 : !>
150 : !> \code{.c}
151 : !> #include <elpa/elpa.h>
152 : !>
153 : !> elpa_t handle;
154 : !> int error;
155 : !>
156 : !> if (elpa_init(20171201) != ELPA_OK) {
157 : !> fprintf(stderr, "Error: ELPA API version not supported");
158 : !> exit(1);
159 : !> }
160 : !>
161 : !> handle = elpa_allocate(&error);
162 : !>
163 : !> /* Set parameters the matrix and it's MPI distribution */
164 : !> elpa_set(handle, "na", na, &error);
165 : !> elpa_set(handle, "nev", nev, &error);
166 : !> elpa_set(handle, "local_nrows", na_rows, &error);
167 : !> elpa_set(handle, "local_ncols", na_cols, &error);
168 : !> elpa_set(handle, "nblk", nblk, &error);
169 : !> elpa_set(handle, "mpi_comm_parent", MPI_Comm_c2f(MPI_COMM_WORLD), &error);
170 : !> elpa_set(handle, "process_row", my_prow, &error);
171 : !> elpa_set(handle, "process_col", my_pcol, &error);
172 : !>
173 : !> /* Setup */
174 : !> elpa_setup(handle);
175 : !>
176 : !> /* if desired, set tunable run-time options */
177 : !> elpa_set(handle, "solver", ELPA_SOLVER_2STAGE, &error);
178 : !> \endcode
179 : !> ... set and get all other options that are desired
180 : !> \code{.c}
181 : !>
182 : !> /* use method solve to solve the eigenvalue problem */
183 : !> /* other possible methods are desribed in \ref elpa_api::elpa_t derived type */
184 : !> elpa_eigenvectors(handle, a, ev, z, &error);
185 : !>
186 : !> /* cleanup */
187 : !> elpa_deallocate(handle);
188 : !> elpa_uninit();
189 : !> \endcode
190 : !>
191 : !> \brief Fortran module to use the ELPA library. No other module shoule be used
192 : module elpa
193 : use elpa_constants
194 : use elpa_api
195 :
196 : implicit none
197 : public
198 :
199 : contains
200 :
201 : !> \brief function to allocate an ELPA instance
202 : !> Parameters
203 : !> \details
204 : !> \result obj class(elpa_t), pointer : pointer to allocated object
205 19296 : function elpa_allocate() result(obj)
206 : use elpa_impl
207 : class(elpa_t), pointer :: obj
208 19296 : obj => elpa_impl_allocate()
209 19296 : end function
210 :
211 :
212 : !> \brief function to deallocate an ELPA instance
213 : !> Parameters
214 : !> \details
215 : !> \param obj class(elpa_t), pointer : pointer to the ELPA object to be destroyed and deallocated
216 19296 : subroutine elpa_deallocate(obj)
217 : class(elpa_t), pointer :: obj
218 19296 : call obj%destroy()
219 19296 : deallocate(obj)
220 19296 : end subroutine
221 :
222 :
223 : !> \brief function to deallocate an ELPA autotune instance
224 : !> Parameters
225 : !> \details
226 : !> \param obj class(elpa_autotune_t), pointer : pointer to the autotune object to be destroyed and deallocated
227 0 : subroutine elpa_autotune_deallocate(obj)
228 : class(elpa_autotune_t), pointer :: obj
229 0 : call obj%destroy()
230 0 : deallocate(obj)
231 0 : end subroutine
232 :
233 : end module
|