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