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