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