Line data Source code
1 : !--------------------------------------------------------------------------------------------------!
2 : ! CP2K: A general program to perform molecular dynamics simulations !
3 : ! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4 : ! !
5 : ! SPDX-License-Identifier: GPL-2.0-or-later !
6 : !--------------------------------------------------------------------------------------------------!
7 :
8 : ! **************************************************************************************************
9 : !> \brief builds the global input section for cp2k
10 : !> \par History
11 : !> 06.2004 created [fawzi]
12 : !> 03.2014 moved to separate file [Ole Schuett]
13 : !> 10.2016 update seed input [Matthias Krack]
14 : !> \author fawzi
15 : ! **************************************************************************************************
16 : MODULE input_cp2k_global
17 : USE bibliography, ONLY: Ceriotti2014,&
18 : Frigo2005,&
19 : Schonherr2014
20 : USE cp_blacs_env, ONLY: BLACS_GRID_COL,&
21 : BLACS_GRID_ROW,&
22 : BLACS_GRID_SQUARE
23 : USE cp_cfm_elpa, ONLY: elpa_c_kernel_descriptions,&
24 : elpa_c_kernel_ids,&
25 : elpa_c_kernel_names
26 : USE cp_dbcsr_cp2k_link, ONLY: create_dbcsr_section
27 : USE cp_fm_cholesky, ONLY: FM_CHOLESKY_TYPE_DEFAULT,&
28 : FM_CHOLESKY_TYPE_DLAF,&
29 : FM_CHOLESKY_TYPE_SCALAPACK
30 : USE cp_fm_diag, ONLY: FM_DIAG_TYPE_CUSOLVER,&
31 : FM_DIAG_TYPE_DEFAULT,&
32 : FM_DIAG_TYPE_DLAF,&
33 : FM_DIAG_TYPE_ELPA,&
34 : FM_DIAG_TYPE_SCALAPACK
35 : USE cp_fm_elpa, ONLY: elpa_kernel_descriptions,&
36 : elpa_kernel_ids,&
37 : elpa_kernel_names,&
38 : elpa_one_stage,&
39 : elpa_print,&
40 : elpa_qr
41 : USE cp_fm_struct, ONLY: cp_fm_struct_get_ncol_block,&
42 : cp_fm_struct_get_nrow_block
43 : USE cp_output_handling, ONLY: add_last_numeric,&
44 : cp_print_key_section_create,&
45 : debug_print_level,&
46 : high_print_level,&
47 : low_print_level,&
48 : medium_print_level,&
49 : silent_print_level
50 : USE grid_api, ONLY: GRID_BACKEND_AUTO,&
51 : GRID_BACKEND_CPU,&
52 : GRID_BACKEND_DGEMM,&
53 : GRID_BACKEND_GPU,&
54 : GRID_BACKEND_REF
55 : USE input_constants, ONLY: &
56 : bsse_run, callgraph_all, callgraph_master, callgraph_none, cell_opt_run, debug_run, &
57 : do_atom, do_band, do_cosma, do_cp2k, do_dgemm_blas, do_dgemm_spla, do_farming, &
58 : do_fft_fftw3, do_fft_sg, do_opt_basis, do_optimize_input, do_scalapack, do_swarm, do_tamc, &
59 : do_test, do_tree_mc, do_tree_mc_ana, driver_run, ehrenfest, energy_force_run, energy_run, &
60 : fftw_plan_estimate, fftw_plan_exhaustive, fftw_plan_measure, fftw_plan_patient, gaussian, &
61 : geo_opt_run, linear_response_run, mimic_run, mol_dyn_run, mon_car_run, mtlr_run, negf_run, &
62 : none_run, pint_run, real_time_propagation, tree_mc_run, vib_anal
63 : USE input_keyword_types, ONLY: keyword_create,&
64 : keyword_release,&
65 : keyword_type
66 : USE input_section_types, ONLY: section_add_keyword,&
67 : section_add_subsection,&
68 : section_create,&
69 : section_release,&
70 : section_type
71 : USE input_val_types, ONLY: char_t,&
72 : integer_t,&
73 : logical_t
74 : USE integral_library_types, ONLY: library_libint,&
75 : library_native
76 : USE kinds, ONLY: dp
77 : USE string_utilities, ONLY: s2a
78 : USE timings, ONLY: default_timings_level
79 : #include "./base/base_uses.f90"
80 :
81 : IMPLICIT NONE
82 : PRIVATE
83 :
84 : LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .TRUE.
85 : CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_global'
86 :
87 : PUBLIC :: create_global_section
88 :
89 : CONTAINS
90 :
91 : ! **************************************************************************************************
92 : !> \brief section to hold global settings for the whole program
93 : !> \param section the section to be created
94 : !> \author fawzi
95 : ! **************************************************************************************************
96 16766 : SUBROUTINE create_global_section(section)
97 : TYPE(section_type), POINTER :: section
98 :
99 : INTEGER :: default_dgemm
100 : TYPE(keyword_type), POINTER :: keyword
101 : TYPE(section_type), POINTER :: print_key, sub_section
102 :
103 16766 : NULLIFY (print_key)
104 16766 : CPASSERT(.NOT. ASSOCIATED(section))
105 : CALL section_create(section, __LOCATION__, name="GLOBAL", &
106 : description="Section with general information on which kind "// &
107 : "of simulation to perform and parameters for the whole PROGRAM", &
108 16766 : n_keywords=7, n_subsections=1, repeats=.FALSE.)
109 :
110 16766 : NULLIFY (keyword)
111 : CALL keyword_create(keyword, __LOCATION__, name="BLACS_GRID", &
112 : description="how to distribute the processors on the 2d grid needed "// &
113 : "by BLACS (and thus SCALAPACK)", usage="BLACS_GRID SQUARE", &
114 : default_i_val=BLACS_GRID_SQUARE, enum_c_vals=s2a("SQUARE", "ROW", "COLUMN"), &
115 : enum_desc=s2a("Distribution by matrix blocks", "Distribution by matrix rows", &
116 : "Distribution by matrix columns"), &
117 16766 : enum_i_vals=[BLACS_GRID_SQUARE, BLACS_GRID_ROW, BLACS_GRID_COL])
118 16766 : CALL section_add_keyword(section, keyword)
119 16766 : CALL keyword_release(keyword)
120 :
121 : CALL keyword_create(keyword, __LOCATION__, name="BLACS_REPEATABLE", &
122 : description="Use a topology for BLACS collectives that is guaranteed to be repeatable "// &
123 : "on homogeneous architectures", &
124 : usage="BLACS_REPEATABLE", &
125 16766 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
126 16766 : CALL section_add_keyword(section, keyword)
127 16766 : CALL keyword_release(keyword)
128 :
129 : CALL keyword_create(keyword, __LOCATION__, name="PREFERRED_DIAG_LIBRARY", &
130 : description="Specifies the diagonalization library to be used. If not available, "// &
131 : "the ScaLAPACK library is used. Complex (k-point) matrices use ELPA only when it is "// &
132 : "requested explicitly", &
133 : usage="PREFERRED_DIAG_LIBRARY ELPA", &
134 : enum_i_vals=[FM_DIAG_TYPE_ELPA, &
135 : FM_DIAG_TYPE_SCALAPACK, &
136 : FM_DIAG_TYPE_SCALAPACK, &
137 : FM_DIAG_TYPE_CUSOLVER, &
138 : FM_DIAG_TYPE_DLAF], &
139 : enum_c_vals=s2a("ELPA", "ScaLAPACK", "SL", "CUSOLVER", "DLAF"), &
140 : enum_desc=s2a("ELPA library", &
141 : "ScaLAPACK library", &
142 : "ScaLAPACK library (shorthand)", &
143 : "cuSOLVER (CUDA GPU library)", &
144 : "DLA-Future (CUDA/HIP GPU library)"), &
145 16766 : default_i_val=FM_DIAG_TYPE_DEFAULT)
146 16766 : CALL section_add_keyword(section, keyword)
147 16766 : CALL keyword_release(keyword)
148 :
149 : CALL keyword_create(keyword, __LOCATION__, name="DIRECT_GENERALIZED_DIAGONALIZATION", &
150 : description="Request direct generalized eigenvalue problem diagonalization "// &
151 : "without a CP2K-side Cholesky reduction in supported dense matrix paths. "// &
152 : "The eigensolver is still selected by PREFERRED_DIAG_LIBRARY.", &
153 : usage="DIRECT_GENERALIZED_DIAGONALIZATION", &
154 16766 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
155 16766 : CALL section_add_keyword(section, keyword)
156 16766 : CALL keyword_release(keyword)
157 :
158 : CALL keyword_create(keyword, __LOCATION__, name="PREFERRED_CHOLESKY_LIBRARY", &
159 : description="Specifies Cholesky decomposition library to be used. If not available, "// &
160 : "the ScaLAPACK library is used", &
161 : usage="PREFERRED_CHOLESKY_LIBRARY DLAF", &
162 : enum_i_vals=[FM_CHOLESKY_TYPE_SCALAPACK, &
163 : FM_CHOLESKY_TYPE_SCALAPACK, &
164 : FM_CHOLESKY_TYPE_DLAF], &
165 : enum_c_vals=s2a("ScaLAPACK", "SL", "DLAF"), &
166 : enum_desc=s2a("ScaLAPACK library", &
167 : "ScaLAPACK library (shorthand)", &
168 : "DLA-Future (CUDA/HIP GPU library)"), &
169 16766 : default_i_val=FM_CHOLESKY_TYPE_DEFAULT)
170 16766 : CALL section_add_keyword(section, keyword)
171 16766 : CALL keyword_release(keyword)
172 :
173 : #if defined(__SPLA) && defined(__OFFLOAD_GEMM)
174 : default_dgemm = do_dgemm_spla
175 : #else
176 16766 : default_dgemm = do_dgemm_blas
177 : #endif
178 : CALL keyword_create(keyword, __LOCATION__, name="PREFERRED_DGEMM_LIBRARY", &
179 : description="Specifies the DGEMM library to be used. If not available, "// &
180 : "the BLAS routine is used. This keyword affects some DGEMM calls in the WFC code and turns on their "// &
181 : "acceleration with SpLA. This keyword affects only local DGEMM calls, not the calls to PDGEMM "// &
182 : "(see keyword FM%TYPE_OF_MATRIX_MULTIPLICATION).", &
183 : usage="PREFERRED_DGEMM_LIBRARY SPLA", &
184 : default_i_val=default_dgemm, &
185 : enum_i_vals=[do_dgemm_spla, do_dgemm_blas], &
186 : enum_c_vals=s2a("SPLA", "BLAS"), &
187 16766 : enum_desc=s2a("SPLA library", "BLAS library"))
188 16766 : CALL section_add_keyword(section, keyword)
189 16766 : CALL keyword_release(keyword)
190 :
191 : CALL keyword_create(keyword, __LOCATION__, name="EPS_CHECK_DIAG", &
192 : description="Check that the orthonormality of the eigenvectors after a diagonalization "// &
193 : "fulfills the specified numerical accuracy. A negative threshold value disables the check.", &
194 : usage="EPS_CHECK_DIAG 1.0E-14", &
195 16766 : default_r_val=-1.0_dp)
196 16766 : CALL section_add_keyword(section, keyword)
197 16766 : CALL keyword_release(keyword)
198 :
199 : CALL keyword_create(keyword, __LOCATION__, name="ELPA_KERNEL", &
200 : description="Specifies the kernel to be used when ELPA is in use for real "// &
201 : "symmetric matrices", &
202 : default_i_val=elpa_kernel_ids(1), &
203 : enum_i_vals=elpa_kernel_ids, &
204 : enum_c_vals=elpa_kernel_names, &
205 16766 : enum_desc=elpa_kernel_descriptions)
206 16766 : CALL section_add_keyword(section, keyword)
207 16766 : CALL keyword_release(keyword)
208 :
209 : CALL keyword_create(keyword, __LOCATION__, name="ELPA_COMPLEX_KERNEL", &
210 : description="Specifies the kernel to be used when ELPA is in use for complex "// &
211 : "Hermitian matrices (k-points)", &
212 : default_i_val=elpa_c_kernel_ids(1), &
213 : enum_i_vals=elpa_c_kernel_ids, &
214 : enum_c_vals=elpa_c_kernel_names, &
215 16766 : enum_desc=elpa_c_kernel_descriptions)
216 16766 : CALL section_add_keyword(section, keyword)
217 16766 : CALL keyword_release(keyword)
218 :
219 : CALL keyword_create(keyword, __LOCATION__, name="ELPA_NEIGVEC_MIN", &
220 : description="Minimum number of eigenvectors for the use of the eigensolver from "// &
221 : "the ELPA library. The eigensolver from the ScaLAPACK library is used as fallback "// &
222 : "for all smaller cases", &
223 : usage="ELPA_NEIGVEC_MIN 32", &
224 16766 : default_i_val=MIN(cp_fm_struct_get_nrow_block(), cp_fm_struct_get_ncol_block()))
225 16766 : CALL section_add_keyword(section, keyword)
226 16766 : CALL keyword_release(keyword)
227 :
228 : CALL keyword_create(keyword, __LOCATION__, name="ELPA_QR", &
229 : description="For ELPA, enable a blocked QR step when reducing the input matrix "// &
230 : "to banded form before diagonalization. Requires ELPA version 201505 or newer and "// &
231 : "is automatically deactivated otherwise. QR is activated only when the matrix size "// &
232 : "is suitable. Keyword ELPA_PRINT helps identify suitable cases. Can accelerate "// &
233 : "diagonalization for suitable matrices.", &
234 : usage="ELPA_QR", &
235 16766 : default_l_val=elpa_qr, lone_keyword_l_val=.TRUE.)
236 16766 : CALL section_add_keyword(section, keyword)
237 16766 : CALL keyword_release(keyword)
238 :
239 : CALL keyword_create(keyword, __LOCATION__, name="ELPA_ONE_STAGE", &
240 : description="For ELPA, enable the one-stage solver (instead of the two-stage solver). "// &
241 : "Please note, ELPA_QR and ELPA_KERNEL settings may be ignored.", &
242 : usage="ELPA_ONE_STAGE", &
243 16766 : default_l_val=elpa_one_stage, lone_keyword_l_val=.TRUE.)
244 16766 : CALL section_add_keyword(section, keyword)
245 16766 : CALL keyword_release(keyword)
246 :
247 : CALL keyword_create(keyword, __LOCATION__, name="ELPA_PRINT", &
248 : description="Controls the printing of ELPA diagonalization information. "// &
249 : "Useful for testing purposes, especially together with keyword ELPA_QR.", &
250 16766 : usage="ELPA_PRINT", default_l_val=elpa_print, lone_keyword_l_val=.TRUE.)
251 16766 : CALL section_add_keyword(section, keyword)
252 16766 : CALL keyword_release(keyword)
253 :
254 : CALL keyword_create(keyword, __LOCATION__, name="DLAF_NEIGVEC_MIN", &
255 : description="Minimum number of eigenvectors for the use of the eigensolver from "// &
256 : "the DLA-Future library. The eigensolver from the ScaLAPACK library is used as fallback "// &
257 : "for all smaller cases", &
258 : usage="DLAF_NEIGVEC_MIN 512", &
259 16766 : default_i_val=1024)
260 16766 : CALL section_add_keyword(section, keyword)
261 16766 : CALL keyword_release(keyword)
262 :
263 : CALL keyword_create(keyword, __LOCATION__, name="DLAF_CHOLESKY_N_MIN", &
264 : description="Minimum matrix size for the use of the Cholesky decomposition from "// &
265 : "the DLA-Future library. The Cholesky decomposition from the ScaLAPACK library is used as fallback "// &
266 : "for all smaller cases", &
267 : usage="DLAF_CHOLESKY_N_MIN 512", &
268 16766 : default_i_val=1024)
269 16766 : CALL section_add_keyword(section, keyword)
270 16766 : CALL keyword_release(keyword)
271 :
272 : CALL keyword_create( &
273 : keyword, __LOCATION__, name="PREFERRED_FFT_LIBRARY", &
274 : description="Specifies the FFT library which should be preferred. "// &
275 : "If it is not available, use FFTW3 if this is linked in, if FFTW3 is not available use FFTSG. "// &
276 : "Improved performance with FFTW3 can be obtained specifying a proper value for FFTW_PLAN_TYPE. "// &
277 : "Contrary to earlier CP2K versions, all libraries will result in the same grids, "// &
278 : "i.e. the subset of grids which all FFT libraries can transform. "// &
279 : "See EXTENDED_FFT_LENGTHS if larger FFTs or grids that more precisely match a given cutoff are needed, "// &
280 : "or older results need to be reproduced. "// &
281 : "FFTW3 is often (close to) optimal, and well tested with CP2K.", &
282 : usage="PREFERRED_FFT_LIBRARY FFTW3", &
283 : citations=[Frigo2005], &
284 : default_i_val=do_fft_fftw3, &
285 : enum_i_vals=[do_fft_sg, do_fft_fftw3, do_fft_fftw3], &
286 : enum_c_vals=s2a("FFTSG", "FFTW3", "FFTW"), &
287 : enum_desc=s2a("Stefan Goedecker's FFT (FFTSG), always available, "// &
288 : "will be used in case a FFT library is specified and not available.", &
289 : "a fast portable FFT library. Recommended. "// &
290 : "See also the FFTW_PLAN_TYPE, and FFTW_WISDOM_FILE_NAME keywords.", &
291 33532 : "Same as FFTW3 (for compatibility with CP2K 2.3)"))
292 16766 : CALL section_add_keyword(section, keyword)
293 16766 : CALL keyword_release(keyword)
294 :
295 16766 : NULLIFY (sub_section)
296 : CALL section_create(sub_section, __LOCATION__, name="preferred_integral_library", &
297 : description="Selects the implementation of individual Gaussian integral operations.", &
298 16766 : n_keywords=2, n_subsections=0, repeats=.FALSE.)
299 :
300 : CALL keyword_create(keyword, __LOCATION__, name="COULOMB_2C", &
301 : description="Library used for two-center Coulomb integrals (Coulomb_2c).", &
302 : usage="COULOMB_2C NATIVE", &
303 : enum_c_vals=s2a("NATIVE", "LIBINT"), &
304 : enum_i_vals=[library_native, library_libint], &
305 : enum_desc=s2a("Use CP2K's native implementation.", &
306 : "Use the Libint implementation."), &
307 16766 : default_i_val=library_native)
308 16766 : CALL section_add_keyword(sub_section, keyword)
309 16766 : CALL keyword_release(keyword)
310 :
311 : CALL keyword_create(keyword, __LOCATION__, name="COULOMB_3C", &
312 : description="Library used for three-center Coulomb integrals (Coulomb_3c).", &
313 : usage="COULOMB_3C NATIVE", &
314 : enum_c_vals=s2a("NATIVE", "LIBINT"), &
315 : enum_i_vals=[library_native, library_libint], &
316 : enum_desc=s2a("Use CP2K's native implementation.", &
317 : "Use the Libint implementation."), &
318 16766 : default_i_val=library_native)
319 16766 : CALL section_add_keyword(sub_section, keyword)
320 16766 : CALL keyword_release(keyword)
321 :
322 16766 : CALL section_add_subsection(section, sub_section)
323 16766 : CALL section_release(sub_section)
324 :
325 : CALL keyword_create(keyword, __LOCATION__, name="FFTW_WISDOM_FILE_NAME", &
326 : description="The name of the file that contains wisdom (pre-planned FFTs) for use with FFTW3. "// &
327 : "Using wisdom can significantly speed up the FFTs (see the FFTW homepage for details). "// &
328 : "Note that wisdom is not transferable between different computer (architectures). "// &
329 : "Wisdom can be generated using the fftw-wisdom tool that is part of the fftw installation. "// &
330 : "cp2k/tools/cp2k-wisdom is a script that contains some additional info, and can help "// &
331 : "to generate a useful default for /etc/fftw/wisdom or particular values for a given simulation.", &
332 16766 : usage="FFTW_WISDOM_FILE_NAME wisdom.dat", default_lc_val="/etc/fftw/wisdom")
333 16766 : CALL section_add_keyword(section, keyword)
334 16766 : CALL keyword_release(keyword)
335 :
336 : CALL keyword_create(keyword, __LOCATION__, name="FFTW_PLAN_TYPE", &
337 : description="FFTW can have improved performance if it is allowed to plan with "// &
338 : "explicit measurements which strategy is best for a given FFT. "// &
339 : "While a plan based on measurements is generally faster, "// &
340 : "differences in machine load will lead to different plans for the same input file, "// &
341 : "and thus numerics for the FFTs will be slightly different from run to run. "// &
342 : "PATIENT planning is recommended for long ab initio MD runs.", &
343 : usage="FFTW_PLAN_TYPE PATIENT", &
344 : citations=[Frigo2005], &
345 : default_i_val=fftw_plan_estimate, &
346 : enum_i_vals=[fftw_plan_estimate, fftw_plan_measure, fftw_plan_patient, fftw_plan_exhaustive], &
347 : enum_c_vals=s2a("ESTIMATE", &
348 : "MEASURE", &
349 : "PATIENT", &
350 : "EXHAUSTIVE"), &
351 : enum_desc=s2a("Quick estimate, no runtime measurements.", &
352 : "Quick measurement, somewhat faster FFTs.", &
353 : "Measurements trying a wider range of possibilities.", &
354 33532 : "Measurements trying all possibilities - use with caution."))
355 16766 : CALL section_add_keyword(section, keyword)
356 16766 : CALL keyword_release(keyword)
357 :
358 : CALL keyword_create(keyword, __LOCATION__, name="EXTENDED_FFT_LENGTHS", &
359 : description="Use fft library specific values for the allows number of points in FFTs. "// &
360 : "The default is to use the internal FFT lengths. For external fft libraries this may "// &
361 : "create an error at the external library level, because the length provided by cp2k is "// &
362 : "not supported by the external library. In this case switch on this keyword "// &
363 : "to obtain, with certain fft libraries, lengths matching the external fft library lengths, or "// &
364 : "larger allowed grids, or grids that more precisely match a given cutoff. "// &
365 : "IMPORTANT NOTE: in this case, the actual grids used in CP2K depends on the FFT library. "// &
366 : "A change of FFT library must therefore be considered equivalent to a change of basis, "// &
367 : "which implies a change of total energy.", &
368 : usage="EXTENDED_FFT_LENGTHS", &
369 16766 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
370 16766 : CALL section_add_keyword(section, keyword)
371 16766 : CALL keyword_release(keyword)
372 :
373 : CALL keyword_create(keyword, __LOCATION__, name="FFT_POOL_SCRATCH_LIMIT", &
374 : description="Limits the memory usage of the FFT scratch pool, potentially reducing efficiency a bit", &
375 16766 : usage="FFT_POOL_SCRATCH_LIMIT {INTEGER}", default_i_val=15)
376 16766 : CALL section_add_keyword(section, keyword)
377 16766 : CALL keyword_release(keyword)
378 :
379 : CALL keyword_create(keyword, __LOCATION__, name="ALLTOALL_SGL", &
380 : description="All-to-all communication (FFT) should use single precision", &
381 : usage="ALLTOALL_SGL YES", &
382 16766 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
383 16766 : CALL section_add_keyword(section, keyword)
384 16766 : CALL keyword_release(keyword)
385 :
386 : CALL keyword_create(keyword, __LOCATION__, name="PRINT_LEVEL", &
387 : variants=["IOLEVEL"], &
388 : description="How much output is written out.", &
389 : usage="PRINT_LEVEL HIGH", &
390 : default_i_val=medium_print_level, enum_c_vals= &
391 : s2a("SILENT", "LOW", "MEDIUM", "HIGH", "DEBUG"), &
392 : enum_desc=s2a("Almost no output", &
393 : "Little output", "Quite some output", "Lots of output", &
394 : "Everything is written out, useful for debugging purposes only"), &
395 : enum_i_vals=[silent_print_level, low_print_level, medium_print_level, &
396 33532 : high_print_level, debug_print_level])
397 16766 : CALL section_add_keyword(section, keyword)
398 16766 : CALL keyword_release(keyword)
399 :
400 : CALL keyword_create( &
401 : keyword, __LOCATION__, name="PROGRAM_NAME", &
402 : variants=["PROGRAM"], &
403 : description="Which program should be run", &
404 : usage="PROGRAM_NAME {STRING}", &
405 : enum_c_vals=s2a("ATOM", "FARMING", "TEST", "CP2K", "OPTIMIZE_INPUT", "OPTIMIZE_BASIS", "TMC", "MC_ANALYSIS", "SWARM"), &
406 : enum_desc=s2a("Runs single atom calculations", &
407 : "Runs N independent jobs in a single run", &
408 : "Do some benchmarking and testing", &
409 : "Runs one of the CP2K package", &
410 : "A tool to optimize parameters in a CP2K input", &
411 : "A tool to create a MOLOPT or ADMM basis for a given set"// &
412 : " of training structures", &
413 : "Runs Tree Monte Carlo algorithm using additional input file(s)", &
414 : "Runs (Tree) Monte Carlo trajectory file analysis", &
415 : "Runs swarm based calculation"), &
416 : enum_i_vals=[do_atom, do_farming, do_test, do_cp2k, do_optimize_input, &
417 : do_opt_basis, do_tree_mc, do_tree_mc_ana, do_swarm], &
418 33532 : default_i_val=do_cp2k)
419 16766 : CALL section_add_keyword(section, keyword)
420 16766 : CALL keyword_release(keyword)
421 :
422 : CALL keyword_create(keyword, __LOCATION__, name="PROJECT_NAME", &
423 : variants=["PROJECT"], &
424 : description="Name of the project (used to build the name of the "// &
425 : "trajectory, and other files generated by the program)", &
426 : usage="PROJECT_NAME {STRING}", &
427 33532 : default_c_val="PROJECT")
428 16766 : CALL section_add_keyword(section, keyword)
429 16766 : CALL keyword_release(keyword)
430 :
431 : CALL keyword_create(keyword, __LOCATION__, name="OUTPUT_FILE_NAME", &
432 : description="Name of the output file. "// &
433 : "Relevant only if automatically started (through farming for example). "// &
434 : "If empty uses the project name as basis for it.", &
435 16766 : usage="OUTPUT_FILE_NAME {filename}", default_lc_val="")
436 16766 : CALL section_add_keyword(section, keyword)
437 16766 : CALL keyword_release(keyword)
438 :
439 : CALL keyword_create( &
440 : keyword, __LOCATION__, name="RUN_TYPE", &
441 : description="Selects the top-level task CP2K should run, such as an energy, "// &
442 : "energy-and-force, molecular dynamics, geometry optimization, or response calculation.", &
443 : usage="RUN_TYPE MD", &
444 : default_i_val=energy_force_run, &
445 : citations=[Ceriotti2014, Schonherr2014], &
446 : enum_c_vals=s2a("NONE", "ENERGY", "ENERGY_FORCE", "MD", "GEO_OPT", &
447 : "MC", "DEBUG", "BSSE", "LR", "PINT", "VIBRATIONAL_ANALYSIS", &
448 : "BAND", "CELL_OPT", "WFN_OPT", "WAVEFUNCTION_OPTIMIZATION", &
449 : "MOLECULAR_DYNAMICS", "GEOMETRY_OPTIMIZATION", "MONTECARLO", &
450 : "LINEAR_RESPONSE", "NORMAL_MODES", "RT_PROPAGATION", &
451 : "EHRENFEST_DYN", "TAMC", "TMC", "DRIVER", "NEGF", "MIMIC", "RTP", &
452 : "MTLR"), &
453 : enum_i_vals=[none_run, energy_run, energy_force_run, mol_dyn_run, &
454 : geo_opt_run, mon_car_run, debug_run, &
455 : bsse_run, linear_response_run, pint_run, vib_anal, do_band, &
456 : cell_opt_run, energy_run, energy_run, mol_dyn_run, geo_opt_run, &
457 : mon_car_run, linear_response_run, &
458 : vib_anal, real_time_propagation, ehrenfest, do_tamc, tree_mc_run, &
459 : driver_run, negf_run, mimic_run, real_time_propagation, mtlr_run], &
460 : enum_desc=s2a("Perform no tasks", "Computes energy", "Computes energy and forces", &
461 : "Molecular Dynamics", "Geometry Optimization", "Monte Carlo", &
462 : "Performs a Debug analysis", "Basis set superposition error", "Linear Response", &
463 : "Path integral", "Vibrational analysis", "Band methods", &
464 : "Cell optimization. Both cell vectors and atomic positions are optimised.", &
465 : "Alias for ENERGY", "Alias for ENERGY", "Alias for MD", "Alias for GEO_OPT", &
466 : "Alias for MC", "Alias for LR", "Alias for VIBRATIONAL_ANALYSIS", &
467 : "Real Time propagation run (fixed ionic positions)", &
468 : "Ehrenfest dynamics (using real time propagation of the wavefunction)", &
469 : "Temperature Accelerated Monte Carlo (TAMC)", &
470 : "Tree Monte Carlo (TMC), a pre-sampling MC algorithm", &
471 : "i-PI driver mode", &
472 : "Non-equilibrium Green's function method", &
473 : "Run as a client in a simulation through the MiMiC framework", &
474 : "Alias for RT_PROPAGATION", &
475 50298 : "Minimum tracking linear response calculation for Hubbard U and Hund's J"))
476 16766 : CALL section_add_keyword(section, keyword)
477 16766 : CALL keyword_release(keyword)
478 :
479 : CALL keyword_create(keyword, __LOCATION__, name="WALLTIME", &
480 : variants=["WALLTI"], &
481 : description="Maximum execution time for this run. Time in seconds or in HH:MM:SS.", &
482 33532 : usage="WALLTIME {real} or {HH:MM:SS}", default_lc_val="")
483 16766 : CALL section_add_keyword(section, keyword)
484 16766 : CALL keyword_release(keyword)
485 :
486 : CALL keyword_create(keyword, __LOCATION__, name="ECHO_INPUT", &
487 : description="If the input should be echoed to the output with all the "// &
488 : "defaults made explicit", &
489 16766 : usage="ECHO_INPUT NO", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
490 16766 : CALL section_add_keyword(section, keyword)
491 16766 : CALL keyword_release(keyword)
492 :
493 : CALL keyword_create(keyword, __LOCATION__, name="ECHO_ALL_HOSTS", &
494 : description="Echo a list of hostname and pid for all MPI processes.", &
495 16766 : usage="ECHO_ALL_HOSTS NO", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
496 16766 : CALL section_add_keyword(section, keyword)
497 16766 : CALL keyword_release(keyword)
498 :
499 : CALL keyword_create(keyword, __LOCATION__, name="ENABLE_MPI_IO", &
500 : description="Enable MPI parallelization for all supported I/O routines "// &
501 : "Currently, only cube file writer/reader routines use MPI I/O. Disabling "// &
502 : "this flag might speed up calculations dominated by I/O.", &
503 16766 : usage="ENABLE_MPI_IO FALSE", default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
504 16766 : CALL section_add_keyword(section, keyword)
505 16766 : CALL keyword_release(keyword)
506 :
507 : CALL keyword_create(keyword, __LOCATION__, name="TRACE", &
508 : description="If a debug trace of the execution of the program should be written", &
509 : usage="TRACE", &
510 16766 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
511 16766 : CALL section_add_keyword(section, keyword)
512 16766 : CALL keyword_release(keyword)
513 :
514 : CALL keyword_create(keyword, __LOCATION__, name="TRACE_MASTER", &
515 : description="For parallel TRACEd runs: only the master node writes output.", &
516 : usage="TRACE_MASTER", &
517 16766 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
518 16766 : CALL section_add_keyword(section, keyword)
519 16766 : CALL keyword_release(keyword)
520 :
521 : CALL keyword_create( &
522 : keyword, __LOCATION__, name="TRACE_MAX", &
523 : description="Limit the total number a given subroutine is printed in the trace. Accounting is not influenced.", &
524 16766 : usage="TRACE_MAX 100", default_i_val=HUGE(0))
525 16766 : CALL section_add_keyword(section, keyword)
526 16766 : CALL keyword_release(keyword)
527 :
528 : CALL keyword_create( &
529 : keyword, __LOCATION__, name="TRACE_ROUTINES", &
530 : description="A list of routines to trace. If left empty all routines are traced. Accounting is not influenced.", &
531 : usage="TRACE_ROUTINES {routine_name1} {routine_name2} ...", type_of_var=char_t, &
532 16766 : n_var=-1)
533 16766 : CALL section_add_keyword(section, keyword)
534 16766 : CALL keyword_release(keyword)
535 :
536 : CALL keyword_create( &
537 : keyword, __LOCATION__, name="FLUSH_SHOULD_FLUSH", &
538 : description="Flush output regularly, enabling this option might degrade performance significantly on certain machines.", &
539 : usage="FLUSH_SHOULD_FLUSH", &
540 16766 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
541 16766 : CALL section_add_keyword(section, keyword)
542 16766 : CALL keyword_release(keyword)
543 :
544 : CALL keyword_create(keyword, __LOCATION__, name="CALLGRAPH", &
545 : description="At the end of the run write a callgraph to file, "// &
546 : "which contains detailed timing informations. "// &
547 : "This callgraph can be viewed e.g. with the open-source program kcachegrind.", &
548 : usage="CALLGRAPH {NONE|MASTER|ALL}", &
549 : default_i_val=CALLGRAPH_NONE, lone_keyword_i_val=CALLGRAPH_MASTER, &
550 : enum_c_vals=s2a("NONE", "MASTER", "ALL"), &
551 : enum_desc=s2a("No callgraph gets written", &
552 : "Only the master process writes his callgraph", &
553 : "All processes write their callgraph (into a separate files)."), &
554 16766 : enum_i_vals=[CALLGRAPH_NONE, CALLGRAPH_MASTER, CALLGRAPH_ALL])
555 16766 : CALL section_add_keyword(section, keyword)
556 16766 : CALL keyword_release(keyword)
557 :
558 : CALL keyword_create(keyword, __LOCATION__, name="CALLGRAPH_FILE_NAME", &
559 : description="Name of the callgraph file, which is written at the end of the run. "// &
560 : "If not specified the project name will be used as filename.", &
561 16766 : usage="CALLGRAPH_FILE_NAME {filename}", default_lc_val="")
562 16766 : CALL section_add_keyword(section, keyword)
563 16766 : CALL keyword_release(keyword)
564 :
565 : CALL keyword_create(keyword, __LOCATION__, name="SEED", &
566 : description="Initial seed for the global (pseudo)random number generator "// &
567 : "to create a stream of normally Gaussian distributed random numbers. "// &
568 : "Exactly 1 or 6 positive integer values are expected. A single value is "// &
569 : "replicated to fill up the full seed array with 6 numbers.", &
570 : n_var=-1, &
571 : type_of_var=integer_t, &
572 : usage="SEED {INTEGER} .. {INTEGER}", &
573 16766 : default_i_vals=[2000])
574 16766 : CALL section_add_keyword(section, keyword)
575 16766 : CALL keyword_release(keyword)
576 :
577 : CALL keyword_create(keyword, __LOCATION__, name="SAVE_MEM", &
578 : description="Some sections of the input structure are deallocated when not needed,"// &
579 : " and reallocated only when used. This reduces the required maximum memory.", &
580 : usage="SAVE_MEM", &
581 16766 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
582 16766 : CALL section_add_keyword(section, keyword)
583 16766 : CALL keyword_release(keyword)
584 :
585 : CALL cp_print_key_section_create(print_key, __LOCATION__, "TIMINGS", description= &
586 : "Controls the printing of the timing report at the end of CP2K execution", &
587 16766 : print_level=silent_print_level, filename="__STD_OUT__")
588 :
589 : CALL keyword_create(keyword, __LOCATION__, name="THRESHOLD", &
590 : description="Specify % of CPUTIME above which the contribution will be inserted in the"// &
591 : " final timing report (e.g. 0.02 = 2%)", &
592 : usage="THRESHOLD {REAL}", &
593 16766 : default_r_val=0.02_dp)
594 16766 : CALL section_add_keyword(print_key, keyword)
595 16766 : CALL keyword_release(keyword)
596 :
597 : CALL keyword_create(keyword, __LOCATION__, name="SORT_BY_SELF_TIME", &
598 : description="Sort the final timing report by the average self (exclusive) time instead of the "// &
599 : "total (inclusive) time of a routine", &
600 : usage="SORT_BY_SELF_TIME on", &
601 16766 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
602 16766 : CALL section_add_keyword(print_key, keyword)
603 16766 : CALL keyword_release(keyword)
604 :
605 : CALL keyword_create(keyword, __LOCATION__, name="REPORT_MAXLOC", &
606 : description="Report the rank with the slowest maximum self timing."// &
607 : " Can be used to debug hard- or software."// &
608 : " Also enables ECHO_ALL_HOSTS to link rank to hostname.", &
609 : usage="REPORT_MAXLOC on", &
610 16766 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
611 16766 : CALL section_add_keyword(print_key, keyword)
612 16766 : CALL keyword_release(keyword)
613 :
614 : CALL keyword_create(keyword, __LOCATION__, name="TIME_MPI", &
615 : description="Include message_passing calls in the timing report (useful with CALLGRAPH).", &
616 : usage="TIME_MPI .FALSE.", &
617 16766 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
618 16766 : CALL section_add_keyword(print_key, keyword)
619 16766 : CALL keyword_release(keyword)
620 :
621 : CALL keyword_create(keyword, __LOCATION__, name="TIMINGS_LEVEL", &
622 : description="Specify the level of timings report. "// &
623 : "Possible values are: 0 (report only CP2K root timer), 1 (all timers).", &
624 : usage="TIMINGS_LEVEL 1", &
625 16766 : default_i_val=default_timings_level, lone_keyword_i_val=default_timings_level)
626 16766 : CALL section_add_keyword(print_key, keyword)
627 16766 : CALL keyword_release(keyword)
628 :
629 16766 : CALL section_add_subsection(section, print_key)
630 16766 : CALL section_release(print_key)
631 :
632 : CALL cp_print_key_section_create(print_key, __LOCATION__, "REFERENCES", description= &
633 : "Controls the printing of the references relevant to the calculations performed", &
634 16766 : print_level=silent_print_level, filename="__STD_OUT__")
635 16766 : CALL section_add_subsection(section, print_key)
636 16766 : CALL section_release(print_key)
637 :
638 : CALL cp_print_key_section_create(print_key, __LOCATION__, "PROGRAM_RUN_INFO", &
639 : description="controls the printing of initialization controlled by the global section", &
640 16766 : print_level=silent_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
641 16766 : CALL section_add_subsection(section, print_key)
642 16766 : CALL section_release(print_key)
643 :
644 : CALL cp_print_key_section_create(print_key, __LOCATION__, "PRINT", description= &
645 : "controls the printing of physical and mathematical constants", &
646 16766 : print_level=medium_print_level, filename="__STD_OUT__")
647 :
648 : CALL keyword_create(keyword, __LOCATION__, name="BASIC_DATA_TYPES", &
649 : description="Controls the printing of the basic data types.", &
650 16766 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
651 16766 : CALL section_add_keyword(print_key, keyword)
652 16766 : CALL keyword_release(keyword)
653 : CALL keyword_create(keyword, __LOCATION__, name="physcon", &
654 : description="if the printkey is active prints the physical constants", &
655 16766 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
656 16766 : CALL section_add_keyword(print_key, keyword)
657 16766 : CALL keyword_release(keyword)
658 : CALL keyword_create(keyword, __LOCATION__, name="SPHERICAL_HARMONICS", &
659 : description="if the printkey is active prints the spherical harmonics", &
660 16766 : default_i_val=-1, type_of_var=integer_t)
661 16766 : CALL section_add_keyword(print_key, keyword)
662 16766 : CALL keyword_release(keyword)
663 : CALL keyword_create(keyword, __LOCATION__, name="RNG_MATRICES", &
664 : description="Prints the transformation matrices used by the random number generator", &
665 : default_l_val=.FALSE., &
666 16766 : lone_keyword_l_val=.TRUE.)
667 16766 : CALL section_add_keyword(print_key, keyword)
668 16766 : CALL keyword_release(keyword)
669 : CALL keyword_create(keyword, __LOCATION__, name="RNG_CHECK", &
670 : description="Performs a check of the global (pseudo)random "// &
671 : "number generator (RNG) and prints the result", &
672 : default_l_val=.FALSE., &
673 16766 : lone_keyword_l_val=.TRUE.)
674 16766 : CALL section_add_keyword(print_key, keyword)
675 16766 : CALL keyword_release(keyword)
676 : CALL keyword_create(keyword, __LOCATION__, name="GLOBAL_GAUSSIAN_RNG", &
677 : description="Prints the initial status of the global Gaussian "// &
678 : "(pseudo)random number stream which is mostly used for "// &
679 : "the velocity initialization", &
680 : default_l_val=.FALSE., &
681 16766 : lone_keyword_l_val=.TRUE.)
682 16766 : CALL section_add_keyword(print_key, keyword)
683 16766 : CALL keyword_release(keyword)
684 :
685 16766 : CALL section_add_subsection(section, print_key)
686 16766 : CALL section_release(print_key)
687 16766 : NULLIFY (sub_section)
688 : ! FM section
689 16766 : CALL create_fm_section(sub_section)
690 16766 : CALL section_add_subsection(section, sub_section)
691 16766 : CALL section_release(sub_section)
692 : ! DBCSR options
693 16766 : CALL create_dbcsr_section(sub_section)
694 16766 : CALL section_add_subsection(section, sub_section)
695 16766 : CALL section_release(sub_section)
696 : ! FM diagonalization redistribution rules
697 16766 : CALL create_fm_diag_rules_section(sub_section)
698 16766 : CALL section_add_subsection(section, sub_section)
699 16766 : CALL section_release(sub_section)
700 : ! Grid library
701 16766 : CALL create_grid_section(sub_section)
702 16766 : CALL section_add_subsection(section, sub_section)
703 16766 : CALL section_release(sub_section)
704 :
705 16766 : END SUBROUTINE create_global_section
706 :
707 : ! **************************************************************************************************
708 : !> \brief Creates the dbcsr section for configuring FM
709 : !> \param section ...
710 : !> \date 2011-04-05
711 : !> \author Florian Schiffmann
712 : ! **************************************************************************************************
713 16766 : SUBROUTINE create_fm_section(section)
714 : TYPE(section_type), POINTER :: section
715 :
716 : INTEGER :: default_matmul
717 : TYPE(keyword_type), POINTER :: keyword
718 :
719 16766 : CPASSERT(.NOT. ASSOCIATED(section))
720 : CALL section_create(section, __LOCATION__, name="FM", &
721 : description="Configuration options for the full matrices.", &
722 16766 : n_keywords=1, n_subsections=0, repeats=.FALSE.)
723 :
724 16766 : NULLIFY (keyword)
725 :
726 : CALL keyword_create(keyword, __LOCATION__, name="NROW_BLOCKS", &
727 : description="Defines the number of rows per scalapack block in "// &
728 : "the creation of block cyclic dense matrices. "// &
729 : "Use an internal default if zero or negative.", &
730 16766 : default_i_val=cp_fm_struct_get_nrow_block())
731 16766 : CALL section_add_keyword(section, keyword)
732 16766 : CALL keyword_release(keyword)
733 :
734 : CALL keyword_create(keyword, __LOCATION__, name="NCOL_BLOCKS", &
735 : description="Defines the number of columns per scalapack block in "// &
736 : "the creation of vlock cyclic dense matrices. "// &
737 : "Use an internal default if zero or negative.", &
738 16766 : default_i_val=cp_fm_struct_get_ncol_block())
739 16766 : CALL section_add_keyword(section, keyword)
740 16766 : CALL keyword_release(keyword)
741 :
742 : CALL keyword_create(keyword, __LOCATION__, name="FORCE_BLOCK_SIZE", &
743 : description="Ensure for small matrices that the layout is compatible "// &
744 : "with bigger ones, i.e. no subdivision is performed (can break LAPACK).", &
745 : usage="FORCE_BLOCK_SIZE", &
746 16766 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
747 16766 : CALL section_add_keyword(section, keyword)
748 16766 : CALL keyword_release(keyword)
749 :
750 : #if defined(__COSMA)
751 16766 : default_matmul = do_cosma
752 : #else
753 : default_matmul = do_scalapack
754 : #endif
755 :
756 : CALL keyword_create(keyword, __LOCATION__, name="TYPE_OF_MATRIX_MULTIPLICATION", &
757 : description="Allows to switch between scalapack pxgemm and COSMA pxgemm. "// &
758 : "COSMA reduces the communication costs but increases the memory demands. "// &
759 : "The performance of Scalapack's pxgemm on GPU's depends "// &
760 : "crucially on the BLOCK_SIZES. Make sure optimized kernels are available.", &
761 : default_i_val=default_matmul, &
762 : enum_i_vals=[do_scalapack, do_scalapack, do_cosma], &
763 : enum_c_vals=s2a("SCALAPACK", "PDGEMM", "COSMA"), &
764 : enum_desc=s2a("Standard ScaLAPACK pdgemm", &
765 : "Alias for ScaLAPACK", &
766 16766 : "COSMA is employed. See <https://github.com/eth-cscs/COSMA>."))
767 16766 : CALL section_add_keyword(section, keyword)
768 16766 : CALL keyword_release(keyword)
769 :
770 : !
771 16766 : END SUBROUTINE create_fm_section
772 : ! **************************************************************************************************
773 : !> \brief Creates the input section used to define the heuristic rules which determine if
774 : !> a FM matrix should be redistributed before diagonalizing it.
775 : !> \param section the input section to create
776 : !> \author Nico Holmberg [01.2018]
777 : ! **************************************************************************************************
778 16766 : SUBROUTINE create_fm_diag_rules_section(section)
779 : TYPE(section_type), POINTER :: section
780 :
781 : TYPE(keyword_type), POINTER :: keyword
782 :
783 16766 : CPASSERT(.NOT. ASSOCIATED(section))
784 : CALL section_create(section, __LOCATION__, name="FM_DIAG_SETTINGS", &
785 : description="This section defines a set of heuristic rules which are "// &
786 : "used to calculate the optimal number of CPUs, M, needed to diagonalize a "// &
787 : "full matrix distributed on N processors (FM type). If M < N, the matrix "// &
788 : "is redistributed onto M processors before it is diagonalized. "// &
789 : "The optimal value is calculate according to M = ((K+a*x-1)/(a*x))*a, "// &
790 : "where K is the size of the matrix, and {a, x} are integers defined below. "// &
791 : "The default values have been selected based on timings on a Cray XE6. "// &
792 : "Supports diagonalization libraries SL and ELPA (see keyword ELPA_FORCE_REDISTRIBUTE).", &
793 16766 : n_keywords=3, n_subsections=0, repeats=.FALSE.)
794 :
795 16766 : NULLIFY (keyword)
796 :
797 : CALL keyword_create(keyword, __LOCATION__, name="PARAMETER_A", &
798 : description="Parameter used for defining the rule which determines the optimal "// &
799 : "number of CPUs needed to diagonalize a full distributed matrix. The optimal "// &
800 : "number of CPUs will be an integer multiple of this variable.", &
801 : usage="PARAMETER_A 4", type_of_var=integer_t, &
802 16766 : default_i_val=4)
803 16766 : CALL section_add_keyword(section, keyword)
804 16766 : CALL keyword_release(keyword)
805 :
806 : CALL keyword_create(keyword, __LOCATION__, name="PARAMETER_X", &
807 : description="Parameter used for defining the rule which determines the optimal "// &
808 : "number of CPUs needed to diagonalize a full distributed matrix. The optimal "// &
809 : "number of CPUs will be roughly proportional to this value.", &
810 : usage="PARAMETER_X 60", type_of_var=integer_t, &
811 16766 : default_i_val=60)
812 16766 : CALL section_add_keyword(section, keyword)
813 16766 : CALL keyword_release(keyword)
814 :
815 : CALL keyword_create(keyword, __LOCATION__, name="PRINT_FM_REDISTRIBUTE", &
816 : description="Controls printing of information related to this section. For each "// &
817 : "diagonalized matrix, prints the size of the matrix, the optimal number of CPUs, "// &
818 : "as well as notifies if the matrix was redistributed. Useful for testing.", &
819 : usage="PRINT_FM_REDISTRIBUTE", type_of_var=logical_t, &
820 16766 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
821 16766 : CALL section_add_keyword(section, keyword)
822 16766 : CALL keyword_release(keyword)
823 :
824 : CALL keyword_create(keyword, __LOCATION__, name="ELPA_FORCE_REDISTRIBUTE", &
825 : description="Controls how to perform redistribution when ELPA is used for diagonalization. "// &
826 : "By default, redistribution is always performed using the defined rules. "// &
827 : "By turning off this keyword, matrices are redistributed only to prevent crashes in the ELPA "// &
828 : "library which happens when the original matrix is distributed over too many processors.", &
829 : usage="ELPA_FORCE_REDISTRIBUTE", type_of_var=logical_t, &
830 16766 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
831 16766 : CALL section_add_keyword(section, keyword)
832 16766 : CALL keyword_release(keyword)
833 :
834 16766 : END SUBROUTINE create_fm_diag_rules_section
835 :
836 : ! **************************************************************************************************
837 : !> \brief Creates the section for configuring the grid library
838 : !> \param section ...
839 : !> \author Ole Schuett
840 : ! **************************************************************************************************
841 16766 : SUBROUTINE create_grid_section(section)
842 : TYPE(section_type), POINTER :: section
843 :
844 : TYPE(keyword_type), POINTER :: keyword
845 :
846 16766 : CPASSERT(.NOT. ASSOCIATED(section))
847 : CALL section_create(section, __LOCATION__, name="GRID", &
848 : description="Configuration options for the grid library, "// &
849 : "which performs e.g. the collocate and integrate of the GPW method.", &
850 16766 : n_keywords=1, n_subsections=0, repeats=.FALSE.)
851 :
852 16766 : NULLIFY (keyword)
853 : CALL keyword_create(keyword, __LOCATION__, name="BACKEND", &
854 : description="Selects the backed used by the grid library.", &
855 : default_i_val=GRID_BACKEND_AUTO, &
856 : enum_i_vals=[GRID_BACKEND_AUTO, GRID_BACKEND_REF, GRID_BACKEND_CPU, &
857 : GRID_BACKEND_DGEMM, GRID_BACKEND_GPU], &
858 : enum_c_vals=s2a("AUTO", "REFERENCE", "CPU", "DGEMM", "GPU"), &
859 : enum_desc=s2a("Let the grid library pick the backend automatically", &
860 : "Reference backend implementation", &
861 : "Optimized CPU backend", &
862 : "Alternative CPU backend based on DGEMM", &
863 16766 : "GPU backend optimized for NVIDIA and AMD GPU"))
864 16766 : CALL section_add_keyword(section, keyword)
865 16766 : CALL keyword_release(keyword)
866 :
867 : CALL keyword_create(keyword, __LOCATION__, name="VALIDATE", &
868 : description="When enabled the reference backend is run in shadow mode "// &
869 : "and its results are compared with those from the selected backend. "// &
870 : "If the two results differ by too much then the calculation is aborted.", &
871 16766 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
872 16766 : CALL section_add_keyword(section, keyword)
873 16766 : CALL keyword_release(keyword)
874 :
875 : CALL keyword_create(keyword, __LOCATION__, name="APPLY_CUTOFF", &
876 : description="When enabled the cpu backend "// &
877 : "apply a spherical cutoff on the top of the cube. "// &
878 : "There is a performance penalty using it in "// &
879 : "combination with the cpu backend but it is on by "// &
880 : "default for the regtests", default_l_val=.TRUE., &
881 16766 : lone_keyword_l_val=.TRUE.)
882 16766 : CALL section_add_keyword(section, keyword)
883 16766 : CALL keyword_release(keyword)
884 :
885 16766 : END SUBROUTINE create_grid_section
886 :
887 : END MODULE input_cp2k_global
|