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