LCOV - code coverage report
Current view: top level - src/start - input_cp2k.F (source / functions) Coverage Total Hit
Test: CP2K Regtests (git:42dac4a) Lines: 100.0 % 579 579
Test Date: 2025-07-25 12:55:17 Functions: 100.0 % 12 12

            Line data    Source code
       1              : !--------------------------------------------------------------------------------------------------!
       2              : !   CP2K: A general program to perform molecular dynamics simulations                              !
       3              : !   Copyright 2000-2025 CP2K developers group <https://cp2k.org>                                   !
       4              : !                                                                                                  !
       5              : !   SPDX-License-Identifier: GPL-2.0-or-later                                                      !
       6              : !--------------------------------------------------------------------------------------------------!
       7              : 
       8              : ! **************************************************************************************************
       9              : !> \brief builds the input structure for cp2k
      10              : !> \par History
      11              : !>      06.2004 created [fawzi]
      12              : !> \author fawzi
      13              : ! **************************************************************************************************
      14              : MODULE input_cp2k
      15              :    USE cp_eri_mme_interface,            ONLY: create_eri_mme_test_section
      16              :    USE cp_output_handling,              ONLY: add_last_numeric,&
      17              :                                               cp_print_key_section_create,&
      18              :                                               low_print_level,&
      19              :                                               medium_print_level,&
      20              :                                               silent_print_level
      21              :    USE dbcsr_api,                       ONLY: dbcsr_test_binary_io,&
      22              :                                               dbcsr_test_mm,&
      23              :                                               dbcsr_type_complex_8,&
      24              :                                               dbcsr_type_real_8
      25              :    USE input_constants,                 ONLY: &
      26              :         do_diag_syevd, do_diag_syevx, do_mat_random, do_mat_read, do_pwgrid_ns_fullspace, &
      27              :         do_pwgrid_ns_halfspace, do_pwgrid_spherical, ehrenfest, numerical
      28              :    USE input_cp2k_atom,                 ONLY: create_atom_section
      29              :    USE input_cp2k_force_eval,           ONLY: create_force_eval_section
      30              :    USE input_cp2k_global,               ONLY: create_global_section
      31              :    USE input_cp2k_motion,               ONLY: create_motion_section
      32              :    USE input_cp2k_negf,                 ONLY: create_negf_section
      33              :    USE input_cp2k_rsgrid,               ONLY: create_rsgrid_section
      34              :    USE input_cp2k_vib,                  ONLY: create_vib_section
      35              :    USE input_keyword_types,             ONLY: keyword_create,&
      36              :                                               keyword_release,&
      37              :                                               keyword_type
      38              :    USE input_optimize_basis,            ONLY: create_optimize_basis_section
      39              :    USE input_optimize_input,            ONLY: create_optimize_input_section
      40              :    USE input_section_types,             ONLY: section_add_keyword,&
      41              :                                               section_add_subsection,&
      42              :                                               section_create,&
      43              :                                               section_release,&
      44              :                                               section_type
      45              :    USE input_val_types,                 ONLY: char_t,&
      46              :                                               integer_t,&
      47              :                                               lchar_t,&
      48              :                                               logical_t
      49              :    USE kinds,                           ONLY: dp
      50              :    USE pw_grids,                        ONLY: do_pw_grid_blocked_false,&
      51              :                                               do_pw_grid_blocked_free,&
      52              :                                               do_pw_grid_blocked_true
      53              :    USE shg_integrals_test,              ONLY: create_shg_integrals_test_section
      54              :    USE string_utilities,                ONLY: newline,&
      55              :                                               s2a
      56              :    USE swarm_input,                     ONLY: create_swarm_section
      57              : #include "../base/base_uses.f90"
      58              : 
      59              :    IMPLICIT NONE
      60              :    PRIVATE
      61              : 
      62              :    LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .TRUE.
      63              :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k'
      64              : 
      65              :    PUBLIC :: create_cp2k_root_section
      66              : 
      67              : CONTAINS
      68              : 
      69              : ! **************************************************************************************************
      70              : !> \brief creates the input structure of the file used by cp2k
      71              : !> \param root_section the input structure to be created
      72              : !> \author fawzi
      73              : ! **************************************************************************************************
      74         9238 :    SUBROUTINE create_cp2k_root_section(root_section)
      75              :       TYPE(section_type), POINTER                        :: root_section
      76              : 
      77              :       CHARACTER(len=*), PARAMETER :: routineN = 'create_cp2k_root_section'
      78              : 
      79              :       INTEGER                                            :: handle
      80              :       TYPE(section_type), POINTER                        :: section
      81              : 
      82         9238 :       CALL timeset(routineN, handle)
      83              : 
      84         9238 :       CPASSERT(.NOT. ASSOCIATED(root_section))
      85              :       CALL section_create(root_section, __LOCATION__, name="__ROOT__", &
      86              :                           description="input file of cp2k", n_keywords=0, n_subsections=10, &
      87         9238 :                           repeats=.FALSE.)
      88         9238 :       NULLIFY (section)
      89              : 
      90         9238 :       CALL create_global_section(section)
      91         9238 :       CALL section_add_subsection(root_section, section)
      92         9238 :       CALL section_release(section)
      93              : 
      94         9238 :       CALL create_test_section(section)
      95         9238 :       CALL section_add_subsection(root_section, section)
      96         9238 :       CALL section_release(section)
      97              : 
      98         9238 :       CALL create_debug_section(section)
      99         9238 :       CALL section_add_subsection(root_section, section)
     100         9238 :       CALL section_release(section)
     101              : 
     102         9238 :       CALL create_motion_section(section)
     103         9238 :       CALL section_add_subsection(root_section, section)
     104         9238 :       CALL section_release(section)
     105              : 
     106         9238 :       CALL create_multi_force_section(section)
     107         9238 :       CALL section_add_subsection(root_section, section)
     108         9238 :       CALL section_release(section)
     109              : 
     110         9238 :       CALL create_force_eval_section(section)
     111         9238 :       CALL section_add_subsection(root_section, section)
     112         9238 :       CALL section_release(section)
     113              : 
     114         9238 :       CALL create_farming_section(section)
     115         9238 :       CALL section_add_subsection(root_section, section)
     116         9238 :       CALL section_release(section)
     117              : 
     118         9238 :       CALL create_optimize_input_section(section)
     119         9238 :       CALL section_add_subsection(root_section, section)
     120         9238 :       CALL section_release(section)
     121              : 
     122         9238 :       CALL create_optimize_basis_section(section)
     123         9238 :       CALL section_add_subsection(root_section, section)
     124         9238 :       CALL section_release(section)
     125              : 
     126         9238 :       CALL create_swarm_section(section)
     127         9238 :       CALL section_add_subsection(root_section, section)
     128         9238 :       CALL section_release(section)
     129              : 
     130         9238 :       CALL create_ext_restart_section(section)
     131         9238 :       CALL section_add_subsection(root_section, section)
     132         9238 :       CALL section_release(section)
     133              : 
     134         9238 :       CALL create_vib_section(section)
     135         9238 :       CALL section_add_subsection(root_section, section)
     136         9238 :       CALL section_release(section)
     137              : 
     138         9238 :       CALL create_negf_section(section)
     139         9238 :       CALL section_add_subsection(root_section, section)
     140         9238 :       CALL section_release(section)
     141              : 
     142         9238 :       CALL create_atom_section(section)
     143         9238 :       CALL section_add_subsection(root_section, section)
     144         9238 :       CALL section_release(section)
     145         9238 :       CALL timestop(handle)
     146              : 
     147         9238 :    END SUBROUTINE create_cp2k_root_section
     148              : 
     149              : ! **************************************************************************************************
     150              : !> \brief section with the tests of the libraries or external code that cp2k uses
     151              : !> \param section the section to be created
     152              : !> \author fawzi
     153              : ! **************************************************************************************************
     154         9238 :    SUBROUTINE create_test_section(section)
     155              :       TYPE(section_type), POINTER                        :: section
     156              : 
     157              :       TYPE(keyword_type), POINTER                        :: keyword
     158              :       TYPE(section_type), POINTER                        :: print_key, subsection
     159              : 
     160              :       CALL section_create(section, __LOCATION__, name="TEST", &
     161              :                           description="Tests to perform on the supported libraries.", &
     162         9238 :                           n_keywords=6, n_subsections=0, repeats=.FALSE.)
     163              : 
     164         9238 :       NULLIFY (keyword, print_key)
     165              :       CALL keyword_create(keyword, __LOCATION__, name="MEMORY", &
     166              :                           description="Set the maximum amount of memory allocated for a given test (in bytes)", &
     167         9238 :                           usage="MEMORY <REAL>", default_r_val=256.e6_dp)
     168         9238 :       CALL section_add_keyword(section, keyword)
     169         9238 :       CALL keyword_release(keyword)
     170              : 
     171              :       CALL keyword_create(keyword, __LOCATION__, name="COPY", &
     172              :                           description="Tests the performance to copy two vectors. "// &
     173              :                           "The results of these tests allow to determine the size of the cache "// &
     174              :                           "of the CPU. This can be used to optimize the performance of the "// &
     175              :                           "FFTSG library. Tests are repeated the given number of times.", &
     176         9238 :                           usage="copy 10", default_i_val=0)
     177         9238 :       CALL section_add_keyword(section, keyword)
     178         9238 :       CALL keyword_release(keyword)
     179              : 
     180              :       CALL keyword_create(keyword, __LOCATION__, name="MATMUL", &
     181              :                           description="Tests the performance of different kinds of matrix matrix "// &
     182              :                           "multiply kernels for the F95 INTRINSIC matmul. Matrices up to 2**N+1 will be tested. ", &
     183         9238 :                           usage="matmul 10", default_i_val=0)
     184         9238 :       CALL section_add_keyword(section, keyword)
     185         9238 :       CALL keyword_release(keyword)
     186              : 
     187              :       CALL keyword_create(keyword, __LOCATION__, name="DGEMM", &
     188              :                           description="Tests the performance of different kinds of matrix matrix "// &
     189              :                           "multiply kernels for the BLAS INTRINSIC DGEMM. Matrices up to 2**N+1 will be tested. ", &
     190         9238 :                           usage="DGEMM 10", default_i_val=0)
     191         9238 :       CALL section_add_keyword(section, keyword)
     192         9238 :       CALL keyword_release(keyword)
     193              : 
     194              :       CALL keyword_create(keyword, __LOCATION__, name="FFT", &
     195              :                           description="Tests the performance of all available FFT libraries for "// &
     196              :                           "3D FFTs Tests are repeated the given number of times.", &
     197         9238 :                           usage="fft 10", default_i_val=0)
     198         9238 :       CALL section_add_keyword(section, keyword)
     199         9238 :       CALL keyword_release(keyword)
     200              : 
     201              :       CALL keyword_create(keyword, __LOCATION__, name="ERI", &
     202              :                           description="Tests the performance and correctness of ERI libraries ", &
     203         9238 :                           usage="eri 1", default_i_val=0)
     204         9238 :       CALL section_add_keyword(section, keyword)
     205         9238 :       CALL keyword_release(keyword)
     206              : 
     207              :       CALL keyword_create(keyword, __LOCATION__, name="CLEBSCH_GORDON", variants=(/"CLEBSCH"/), &
     208              :                           description="Tests the Clebsch-Gordon Coefficients. "// &
     209              :                           "Tests are repeated the given number of times.", &
     210        18476 :                           usage="clebsch_gordon 10", default_i_val=0)
     211              : 
     212         9238 :       CALL section_add_keyword(section, keyword)
     213         9238 :       CALL keyword_release(keyword)
     214              : 
     215              :       CALL keyword_create(keyword, __LOCATION__, name="MPI", &
     216              :                           description="Tests mpi, quickly adapted benchmark code, "// &
     217              :                           "will ONLY work on an even number of CPUs. comm is the relevant, "// &
     218              :                           "initialized communicator. This test will produce messages "// &
     219              :                           "of the size 8*10**requested_size, where requested_size is the value "// &
     220              :                           "given to this keyword", &
     221         9238 :                           usage="mpi 6", default_i_val=0)
     222              : 
     223         9238 :       CALL section_add_keyword(section, keyword)
     224         9238 :       CALL keyword_release(keyword)
     225              : 
     226              :       CALL keyword_create(keyword, __LOCATION__, name="MINIMAX", &
     227              :                           description="Tests validity of minimax coefficients for approximating 1/x "// &
     228              :                           "as a sum of exponentials. "// &
     229              :                           "Checks numerical error against tabulated error, testing "// &
     230              :                           "the given number of different Rc values.", &
     231         9238 :                           usage="MINIMAX 1000", default_i_val=0)
     232         9238 :       CALL section_add_keyword(section, keyword)
     233         9238 :       CALL keyword_release(keyword)
     234              : 
     235              :       CALL keyword_create(keyword, __LOCATION__, name="LEAST_SQ_FT", &
     236              :                           description="Tests accuracy of the integration weights gamma_ik from Kaltak, "// &
     237              :                           "Klimes, Kresse, JCTC 10, 2498 (2014), Eq. 30. Printed is the L1-error (=minimax "// &
     238              :                           "error for a given range and a given number of grid points. The input parameter is "// &
     239              :                           "the given number of different Rc values.", &
     240         9238 :                           usage="LEAST_SQ_FT 1000", default_i_val=0)
     241         9238 :       CALL section_add_keyword(section, keyword)
     242         9238 :       CALL keyword_release(keyword)
     243              : 
     244              :       CALL cp_print_key_section_create( &
     245              :          print_key, __LOCATION__, "GRID_INFORMATION", &
     246              :          description="Controls the printing of information regarding the PW and RS grid structures"// &
     247              :          " (ONLY for TEST run).", &
     248         9238 :          print_level=medium_print_level, filename="__STD_OUT__")
     249         9238 :       CALL section_add_subsection(section, print_key)
     250         9238 :       CALL section_release(print_key)
     251              : 
     252              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "PROGRAM_RUN_INFO", &
     253              :                                        description="Controls the printing of the test output", &
     254         9238 :                                        print_level=silent_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
     255         9238 :       CALL section_add_subsection(section, print_key)
     256         9238 :       CALL section_release(print_key)
     257              : 
     258         9238 :       NULLIFY (subsection)
     259         9238 :       CALL create_rs_pw_transfer_section(subsection)
     260         9238 :       CALL section_add_subsection(section, subsection)
     261         9238 :       CALL section_release(subsection)
     262              : 
     263         9238 :       CALL create_eigensolver_section(subsection)
     264         9238 :       CALL section_add_subsection(section, subsection)
     265         9238 :       CALL section_release(subsection)
     266              : 
     267         9238 :       CALL create_pw_transfer_section(subsection)
     268         9238 :       CALL section_add_subsection(section, subsection)
     269         9238 :       CALL section_release(subsection)
     270              : 
     271         9238 :       CALL create_cp_fm_gemm_section(subsection)
     272         9238 :       CALL section_add_subsection(section, subsection)
     273         9238 :       CALL section_release(subsection)
     274              : 
     275         9238 :       CALL create_cp_dbcsr_section(subsection)
     276         9238 :       CALL section_add_subsection(section, subsection)
     277         9238 :       CALL section_release(subsection)
     278              : 
     279         9238 :       CALL create_dbm_section(subsection)
     280         9238 :       CALL section_add_subsection(section, subsection)
     281         9238 :       CALL section_release(subsection)
     282              : 
     283         9238 :       CALL create_eri_mme_test_section(subsection)
     284         9238 :       CALL section_add_subsection(section, subsection)
     285         9238 :       CALL section_release(subsection)
     286              : 
     287         9238 :       CALL create_shg_integrals_test_section(subsection)
     288         9238 :       CALL section_add_subsection(section, subsection)
     289         9238 :       CALL section_release(subsection)
     290              : 
     291         9238 :    END SUBROUTINE create_test_section
     292              : 
     293              : ! **************************************************************************************************
     294              : !> \brief section to setup debugging parameter
     295              : !> \param section the section to be created
     296              : !> \author teo
     297              : ! **************************************************************************************************
     298         9238 :    SUBROUTINE create_debug_section(section)
     299              :       TYPE(section_type), POINTER                        :: section
     300              : 
     301              :       TYPE(keyword_type), POINTER                        :: keyword
     302              :       TYPE(section_type), POINTER                        :: print_key
     303              : 
     304              :       CALL section_create(section, __LOCATION__, name="DEBUG", &
     305              :                           description="Section to setup parameters for debug runs.", &
     306         9238 :                           n_keywords=7, n_subsections=0, repeats=.FALSE.)
     307              : 
     308         9238 :       NULLIFY (keyword, print_key)
     309              : 
     310              :       CALL keyword_create(keyword, __LOCATION__, name="DEBUG_FORCES", &
     311              :                           description="Activates the debugging of the atomic forces", &
     312              :                           usage="DEBUG_FORCES {LOGICAL}", default_l_val=.TRUE., &
     313         9238 :                           lone_keyword_l_val=.TRUE.)
     314         9238 :       CALL section_add_keyword(section, keyword)
     315         9238 :       CALL keyword_release(keyword)
     316              : 
     317              :       CALL keyword_create(keyword, __LOCATION__, name="DEBUG_STRESS_TENSOR", &
     318              :                           description="Activates the debugging of the stress tensor", &
     319              :                           usage="DEBUG_STRESS_TENSOR {LOGICAL}", default_l_val=.TRUE., &
     320         9238 :                           lone_keyword_l_val=.TRUE.)
     321         9238 :       CALL section_add_keyword(section, keyword)
     322         9238 :       CALL keyword_release(keyword)
     323              : 
     324              :       CALL keyword_create(keyword, __LOCATION__, name="DEBUG_DIPOLE", &
     325              :                           description="Activates the debugging of the dipole moment", &
     326              :                           usage="DEBUG_DIPOLE {LOGICAL}", default_l_val=.FALSE., &
     327         9238 :                           lone_keyword_l_val=.TRUE.)
     328         9238 :       CALL section_add_keyword(section, keyword)
     329         9238 :       CALL keyword_release(keyword)
     330              : 
     331              :       CALL keyword_create(keyword, __LOCATION__, name="DEBUG_POLARIZABILITY", &
     332              :                           description="Activates the debugging of the polarizability", &
     333              :                           usage="DEBUG_POLARIZABILITY {LOGICAL}", default_l_val=.FALSE., &
     334         9238 :                           lone_keyword_l_val=.TRUE.)
     335         9238 :       CALL section_add_keyword(section, keyword)
     336         9238 :       CALL keyword_release(keyword)
     337              : 
     338              :       CALL keyword_create(keyword, __LOCATION__, name="DX", &
     339              :                           description="Increment for the calculation of the numerical derivatives", &
     340         9238 :                           usage="DX {REAL}", default_r_val=0.001_dp)
     341         9238 :       CALL section_add_keyword(section, keyword)
     342         9238 :       CALL keyword_release(keyword)
     343              : 
     344              :       CALL keyword_create(keyword, __LOCATION__, name="DE", &
     345              :                           description="Increment for the calculation of the numerical electric field derivatives", &
     346         9238 :                           usage="DE {REAL}", default_r_val=0.0001_dp)
     347         9238 :       CALL section_add_keyword(section, keyword)
     348         9238 :       CALL keyword_release(keyword)
     349              : 
     350              :       CALL keyword_create(keyword, __LOCATION__, name="MAX_RELATIVE_ERROR", &
     351              :                           description="The maximum relative error that will be "// &
     352              :                           "flagged [in percent]. ", &
     353         9238 :                           usage="MAX_RELATIVE_ERROR {REAL}", default_r_val=0.2_dp)
     354         9238 :       CALL section_add_keyword(section, keyword)
     355         9238 :       CALL keyword_release(keyword)
     356              : 
     357              :       CALL keyword_create(keyword, __LOCATION__, name="EPS_NO_ERROR_CHECK", &
     358              :                           description="The mismatch between the numerical and the "// &
     359              :                           "analytical value is not checked for analytical "// &
     360              :                           "values smaller than this threshold value", &
     361         9238 :                           usage="EPS_NO_ERROR_CHECK {REAL}", default_r_val=1.0E-5_dp)
     362         9238 :       CALL section_add_keyword(section, keyword)
     363         9238 :       CALL keyword_release(keyword)
     364              : 
     365              :       CALL keyword_create(keyword, __LOCATION__, name="STOP_ON_MISMATCH", &
     366              :                           description="Stop the debug run when a mismatch between the numerical and "// &
     367              :                           "the analytical value is detected", &
     368              :                           usage="STOP_ON_MISMATCH {LOGICAL}", default_l_val=.TRUE., &
     369         9238 :                           lone_keyword_l_val=.TRUE.)
     370         9238 :       CALL section_add_keyword(section, keyword)
     371         9238 :       CALL keyword_release(keyword)
     372              : 
     373              :       CALL keyword_create(keyword, __LOCATION__, name="CHECK_DIPOLE_DIRS", &
     374              :                           description="Dipole coordinates to be checked", &
     375              :                           usage="CHECK_DIPOLE_DIRS XZ", type_of_var=char_t, &
     376         9238 :                           default_c_val="XYZ")
     377         9238 :       CALL section_add_keyword(section, keyword)
     378         9238 :       CALL keyword_release(keyword)
     379              : 
     380              :       CALL keyword_create(keyword, __LOCATION__, name="CHECK_ATOM_FORCE", &
     381              :                           description="Atom force directions to be checked [atom_number coordinates]", &
     382              :                           usage="CHECK_ATOM_FORCE 1 XZ", &
     383         9238 :                           type_of_var=char_t, n_var=2, repeats=.TRUE.)
     384         9238 :       CALL section_add_keyword(section, keyword)
     385         9238 :       CALL keyword_release(keyword)
     386              : 
     387              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "PROGRAM_RUN_INFO", &
     388              :                                        description="Controls the printing of the DEBUG specific output", &
     389         9238 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
     390         9238 :       CALL section_add_subsection(section, print_key)
     391         9238 :       CALL section_release(print_key)
     392              : 
     393         9238 :    END SUBROUTINE create_debug_section
     394              : 
     395              : ! **************************************************************************************************
     396              : !> \brief creates the multiple force_eval section
     397              : !> \param section the section to be created
     398              : !> \author fawzi
     399              : ! **************************************************************************************************
     400         9238 :    SUBROUTINE create_multi_force_section(section)
     401              :       TYPE(section_type), POINTER                        :: section
     402              : 
     403              :       TYPE(keyword_type), POINTER                        :: keyword
     404              : 
     405         9238 :       CPASSERT(.NOT. ASSOCIATED(section))
     406              :       CALL section_create(section, __LOCATION__, name="MULTIPLE_FORCE_EVALS", &
     407              :                           description="Describes how to handle multiple force_evals.", &
     408         9238 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     409              : 
     410         9238 :       NULLIFY (keyword)
     411              :       CALL keyword_create(keyword, __LOCATION__, name="FORCE_EVAL_ORDER", &
     412              :                           description='Specify the orders of the different force_eval. When using a MIXED force_eval'// &
     413              :                           " this does not need to be specified in this list, because it that takes into account only the real"// &
     414              :                           " energy contributions", &
     415              :                           usage="FORCE_EVAL_ORDER <INTEGER> .. <INTEGER>", type_of_var=integer_t, n_var=-1, &
     416         9238 :                           default_i_vals=(/1/))
     417         9238 :       CALL section_add_keyword(section, keyword)
     418         9238 :       CALL keyword_release(keyword)
     419              : 
     420              :       CALL keyword_create(keyword, __LOCATION__, name="MULTIPLE_SUBSYS", &
     421              :                           description="Specify if force_eval have different subsys. In case they share the same subsys,"// &
     422              :                           " it needs to be specified only in the MIXED force_eval (if using MIXED) or"// &
     423              :                           " in the force_eval corresponding to first force_eval of the previous order (when not using MIXED).", &
     424         9238 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     425         9238 :       CALL section_add_keyword(section, keyword)
     426         9238 :       CALL keyword_release(keyword)
     427              : 
     428         9238 :    END SUBROUTINE create_multi_force_section
     429              : 
     430              : ! **************************************************************************************************
     431              : !> \brief Creates the exteranal restart section
     432              : !> \param section the section to create
     433              : !> \author fawzi
     434              : ! **************************************************************************************************
     435         9238 :    SUBROUTINE create_ext_restart_section(section)
     436              :       TYPE(section_type), POINTER                        :: section
     437              : 
     438              :       TYPE(keyword_type), POINTER                        :: keyword
     439              : 
     440         9238 :       CPASSERT(.NOT. ASSOCIATED(section))
     441              :       CALL section_create(section, __LOCATION__, name="EXT_RESTART", &
     442              :                           description="Section for external restart, specifies an external "// &
     443              :                           "input file where to take positions, etc. "// &
     444              :                           "By default they are all set to TRUE", &
     445         9238 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     446         9238 :       NULLIFY (keyword)
     447              : 
     448              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_FILE_NAME", variants=(/"EXTERNAL_FILE"/), &
     449              :                           description="Specifies the name of restart file (or any other input file)"// &
     450              :                           " to be read. Only fields relevant to a restart will be used"// &
     451              :                           " (unless switched off with the keywords in this section)", &
     452        18476 :                           default_lc_val=" ")
     453         9238 :       CALL section_add_keyword(section, keyword)
     454         9238 :       CALL keyword_release(keyword)
     455              : 
     456              :       CALL keyword_create(keyword, __LOCATION__, name="BINARY_RESTART_FILE_NAME", &
     457              :                           variants=(/"BINARY_RESTART_FILE"/), &
     458              :                           description="Specifies the name of an additional restart file "// &
     459              :                           "from which selected input sections are read in binary format "// &
     460              :                           "(see SPLIT_RESTART_FILE).", &
     461        18476 :                           default_lc_val="")
     462         9238 :       CALL section_add_keyword(section, keyword)
     463         9238 :       CALL keyword_release(keyword)
     464              : 
     465              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_DEFAULT", &
     466              :                           description="This keyword controls the default value for all possible"// &
     467              :                           " restartable keywords, unless explicitly defined. For example setting"// &
     468              :                           " this keyword to .FALSE. does not restart any quantity. If, at the"// &
     469              :                           " same time, one keyword is set to .TRUE. only that quantity will be"// &
     470         9238 :                           " restarted.", default_l_val=.TRUE.)
     471         9238 :       CALL section_add_keyword(section, keyword)
     472         9238 :       CALL keyword_release(keyword)
     473              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_COUNTERS", &
     474              :                           description="Restarts the counters in MD schemes and optimization STEP", &
     475         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     476         9238 :       CALL section_add_keyword(section, keyword)
     477         9238 :       CALL keyword_release(keyword)
     478              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_POS", &
     479              :                           description="Takes the positions from the external file", &
     480         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     481         9238 :       CALL section_add_keyword(section, keyword)
     482         9238 :       CALL keyword_release(keyword)
     483              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_VEL", &
     484              :                           description="Takes the velocities from the external file", &
     485         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     486         9238 :       CALL section_add_keyword(section, keyword)
     487         9238 :       CALL keyword_release(keyword)
     488              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_RANDOMG", &
     489              :                           description="Restarts the random number generator from the external file", &
     490         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     491         9238 :       CALL section_add_keyword(section, keyword)
     492         9238 :       CALL keyword_release(keyword)
     493              : 
     494              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_SHELL_POS", &
     495              :                           description="Takes the positions of the shells from the external file (only if shell-model)", &
     496         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     497         9238 :       CALL section_add_keyword(section, keyword)
     498         9238 :       CALL keyword_release(keyword)
     499              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_CORE_POS", &
     500              :                           description="Takes the positions of the cores from the external file (only if shell-model)", &
     501         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     502         9238 :       CALL section_add_keyword(section, keyword)
     503         9238 :       CALL keyword_release(keyword)
     504              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_OPTIMIZE_INPUT_VARIABLES", &
     505              :                           description="Restart with the optimize input variables", &
     506         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     507         9238 :       CALL section_add_keyword(section, keyword)
     508         9238 :       CALL keyword_release(keyword)
     509              : 
     510              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_SHELL_VELOCITY", &
     511              :                           description="Takes the velocities of the shells from the external file (only if shell-model)", &
     512         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     513         9238 :       CALL section_add_keyword(section, keyword)
     514         9238 :       CALL keyword_release(keyword)
     515              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_CORE_VELOCITY", &
     516              :                           description="Takes the velocities of the shells from the external file (only if shell-model)", &
     517         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     518         9238 :       CALL section_add_keyword(section, keyword)
     519         9238 :       CALL keyword_release(keyword)
     520              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_BAROSTAT", &
     521              :                           description="Restarts the barostat from the external file", &
     522         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     523         9238 :       CALL section_add_keyword(section, keyword)
     524         9238 :       CALL keyword_release(keyword)
     525              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_BAROSTAT_THERMOSTAT", &
     526              :                           description="Restarts the barostat thermostat from the external file", &
     527         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     528         9238 :       CALL section_add_keyword(section, keyword)
     529         9238 :       CALL keyword_release(keyword)
     530              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_SHELL_THERMOSTAT", &
     531              :                           description="Restarts the shell thermostat from the external file", &
     532         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     533         9238 :       CALL section_add_keyword(section, keyword)
     534         9238 :       CALL keyword_release(keyword)
     535              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_THERMOSTAT", &
     536              :                           description="Restarts the nose thermostats of the particles "// &
     537              :                           "from the EXTERNAL file", &
     538         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     539         9238 :       CALL section_add_keyword(section, keyword)
     540         9238 :       CALL keyword_release(keyword)
     541              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_TEMPERATURE_ANNEALING", &
     542              :                           description="Restarts external temperature when using TEMPERATURE_ANNEALING.", &
     543         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     544         9238 :       CALL section_add_keyword(section, keyword)
     545         9238 :       CALL keyword_release(keyword)
     546              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_CELL", &
     547              :                           description="Restarts the cell (and cell_ref) "// &
     548              :                           "from the EXTERNAL file", &
     549         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     550         9238 :       CALL section_add_keyword(section, keyword)
     551         9238 :       CALL keyword_release(keyword)
     552              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_METADYNAMICS", &
     553              :                           description="Restarts hills from a previous metadynamics run "// &
     554              :                           "from the EXTERNAL file", &
     555         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     556         9238 :       CALL section_add_keyword(section, keyword)
     557         9238 :       CALL keyword_release(keyword)
     558              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_WALKERS", &
     559              :                           description="Restarts walkers informations from a previous metadynamics run "// &
     560              :                           "from the EXTERNAL file", &
     561         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     562         9238 :       CALL section_add_keyword(section, keyword)
     563         9238 :       CALL keyword_release(keyword)
     564              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_BAND", &
     565              :                           description="Restarts positions and velocities of the Band.", &
     566         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     567         9238 :       CALL section_add_keyword(section, keyword)
     568         9238 :       CALL keyword_release(keyword)
     569              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_QMMM", &
     570              :                           description="Restarts the following specific QMMM info: translation vectors.", &
     571         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     572         9238 :       CALL section_add_keyword(section, keyword)
     573         9238 :       CALL keyword_release(keyword)
     574              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_CONSTRAINT", &
     575              :                           description="Restarts constraint section. It's necessary when doing restraint"// &
     576              :                           " calculation to have a perfect energy conservation. For constraints only its"// &
     577              :                           " use is optional.", &
     578         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     579         9238 :       CALL section_add_keyword(section, keyword)
     580         9238 :       CALL keyword_release(keyword)
     581              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_BSSE", &
     582              :                           description="Restarts information for BSSE calculations.", &
     583         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     584         9238 :       CALL section_add_keyword(section, keyword)
     585         9238 :       CALL keyword_release(keyword)
     586              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_DIMER", &
     587              :                           description="Restarts information for DIMER geometry optimizations.", &
     588         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     589         9238 :       CALL section_add_keyword(section, keyword)
     590         9238 :       CALL keyword_release(keyword)
     591              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_AVERAGES", &
     592              :                           description="Restarts information for AVERAGES.", &
     593         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     594         9238 :       CALL section_add_keyword(section, keyword)
     595         9238 :       CALL keyword_release(keyword)
     596              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_RTP", &
     597              :                           description="Restarts information for REAL TIME PROPAGATION and EHRENFEST DYNAMICS.", &
     598         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     599         9238 :       CALL section_add_keyword(section, keyword)
     600         9238 :       CALL keyword_release(keyword)
     601              :       CALL keyword_create(keyword, __LOCATION__, name="CUSTOM_PATH", &
     602              :                           description="Restarts the given path from the EXTERNAL file. Allows a major flexibility for restarts.", &
     603         9238 :                           type_of_var=char_t, repeats=.TRUE.)
     604         9238 :       CALL section_add_keyword(section, keyword)
     605         9238 :       CALL keyword_release(keyword)
     606              : 
     607              :       ! PIMD
     608              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_PINT_POS", &
     609              :                           description="Restart bead positions from PINT%BEADS%COORD.", &
     610         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     611         9238 :       CALL section_add_keyword(section, keyword)
     612         9238 :       CALL keyword_release(keyword)
     613              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_PINT_VEL", &
     614              :                           description="Restart bead velocities from PINT%BEADS%VELOCITY.", &
     615         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     616         9238 :       CALL section_add_keyword(section, keyword)
     617         9238 :       CALL keyword_release(keyword)
     618              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_PINT_NOSE", &
     619              :                           description="Restart Nose thermostat for beads from PINT%NOSE.", &
     620         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     621         9238 :       CALL section_add_keyword(section, keyword)
     622         9238 :       CALL keyword_release(keyword)
     623              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_PINT_GLE", &
     624              :                           description="Restart GLE thermostat for beads from PINT%GLE.", &
     625         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     626         9238 :       CALL section_add_keyword(section, keyword)
     627         9238 :       CALL keyword_release(keyword)
     628              : 
     629              :       ! PIMC
     630              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_HELIUM_POS", &
     631              :                           description="Restart helium positions from PINT%HELIUM%COORD.", &
     632         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     633         9238 :       CALL section_add_keyword(section, keyword)
     634         9238 :       CALL keyword_release(keyword)
     635              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_HELIUM_PERMUTATION", &
     636              :                           description="Restart helium permutation state from PINT%HELIUM%PERM.", &
     637         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     638         9238 :       CALL section_add_keyword(section, keyword)
     639         9238 :       CALL keyword_release(keyword)
     640              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_HELIUM_FORCE", &
     641              :                           description="Restart helium forces exerted on the solute from PINT%HELIUM%FORCE.", &
     642         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     643         9238 :       CALL section_add_keyword(section, keyword)
     644         9238 :       CALL keyword_release(keyword)
     645              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_HELIUM_RNG", &
     646              :                           description="Restarts helium random number generators from PINT%HELIUM%RNG_STATE.", &
     647         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     648         9238 :       CALL section_add_keyword(section, keyword)
     649         9238 :       CALL keyword_release(keyword)
     650              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_HELIUM_DENSITIES", &
     651              :                           description="Restarts helium density distributions from PINT%HELIUM%RHO.", &
     652              :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE., &
     653         9238 :                           default_l_val=.FALSE.)
     654         9238 :       CALL section_add_keyword(section, keyword)
     655         9238 :       CALL keyword_release(keyword)
     656              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_HELIUM_AVERAGES", &
     657              :                           description="Restarts average properties from PINT%HELIUM%AVERAGES.", &
     658         9238 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     659         9238 :       CALL section_add_keyword(section, keyword)
     660         9238 :       CALL keyword_release(keyword)
     661              : 
     662         9238 :    END SUBROUTINE create_ext_restart_section
     663              : 
     664              : ! **************************************************************************************************
     665              : !> \brief creates the farming section
     666              : !> \param section the section to create
     667              : !> \author fawzi
     668              : ! **************************************************************************************************
     669         9238 :    SUBROUTINE create_farming_section(section)
     670              :       TYPE(section_type), POINTER                        :: section
     671              : 
     672              :       TYPE(keyword_type), POINTER                        :: keyword
     673              :       TYPE(section_type), POINTER                        :: print_key, sub_section
     674              : 
     675         9238 :       CPASSERT(.NOT. ASSOCIATED(section))
     676              :       CALL section_create(section, __LOCATION__, name="farming", &
     677              :                           description="Describes a farming job, in which multiple inputs are executed."//newline// &
     678              :                           "The RUN_TYPE in the global section has to be set to NONE for FARMING."//newline// &
     679              :                           "The different groups are executed in parallel. The jobs inside the same groups in series.", &
     680         9238 :                           repeats=.FALSE.)
     681         9238 :       NULLIFY (keyword, print_key)
     682              : 
     683              :       CALL keyword_create( &
     684              :          keyword, __LOCATION__, name="CAPTAIN_MINION", &
     685              :     description="If a captain/minion setup should be employed, in which one process (captain) is used to distribute the tasks. "// &
     686              :          "This is most useful to load-balance if not all jobs have the same length, "// &
     687              :          "and a lot of CPUs/groups are available.", &
     688         9238 :          usage="CAPTAIN_MINION", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     689         9238 :       CALL section_add_keyword(section, keyword)
     690         9238 :       CALL keyword_release(keyword)
     691              : 
     692              :       CALL keyword_create(keyword, __LOCATION__, name="NGROUPS", variants=(/"NGROUP"/), &
     693              :                           description="Gives the preferred number of working groups.", &
     694        18476 :                           usage="ngroups 4", type_of_var=integer_t)
     695         9238 :       CALL section_add_keyword(section, keyword)
     696         9238 :       CALL keyword_release(keyword)
     697              : 
     698              :       CALL keyword_create(keyword, __LOCATION__, name="GROUP_SIZE", &
     699              :                           description="Gives the preferred size of a working group, "// &
     700              :                           "groups will always be equal or larger than this size.", &
     701         9238 :                           usage="group_size 2", default_i_val=8)
     702         9238 :       CALL section_add_keyword(section, keyword)
     703         9238 :       CALL keyword_release(keyword)
     704              : 
     705              :       CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
     706              :                           description="Stride to be used when building working groups from the parent MPI comm. "// &
     707              :                          "Can be used to layout minion groups over nodes in advanced ways (1 rank per node / 2 groups per node).", &
     708         9238 :                           usage="STRIDE 2", default_i_val=1)
     709         9238 :       CALL section_add_keyword(section, keyword)
     710         9238 :       CALL keyword_release(keyword)
     711              : 
     712              :       CALL keyword_create(keyword, __LOCATION__, name="GROUP_PARTITION", &
     713              :                           description="gives the exact number of processors for each group.", &
     714         9238 :                           usage="group_partition  2 2 4 2 4 ", type_of_var=integer_t, n_var=-1)
     715         9238 :       CALL section_add_keyword(section, keyword)
     716         9238 :       CALL keyword_release(keyword)
     717              : 
     718              :       CALL keyword_create(keyword, __LOCATION__, name="MAX_JOBS_PER_GROUP", &
     719              :                           variants=(/"MAX_JOBS"/), &
     720              :                           description="maximum number of jobs executed per group", &
     721        18476 :                           usage="MAX_JOBS_PER_GROUP 4", default_i_val=65535)
     722         9238 :       CALL section_add_keyword(section, keyword)
     723         9238 :       CALL keyword_release(keyword)
     724              : 
     725              :       CALL keyword_create( &
     726              :          keyword, __LOCATION__, name="CYCLE", &
     727              :          description="If farming should process all jobs in a cyclic way, stopping only if MAX_JOBS_PER_GROUP is exceeded.", &
     728         9238 :          usage="CYCLE", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     729         9238 :       CALL section_add_keyword(section, keyword)
     730         9238 :       CALL keyword_release(keyword)
     731              : 
     732              :       CALL keyword_create( &
     733              :          keyword, __LOCATION__, name="WAIT_TIME", &
     734              :          description="Time to wait [s] for a new task if no task is currently available, make this zero if no clock is available", &
     735         9238 :          usage="WAIT_TIME 0.1", default_r_val=0.5_dp)
     736         9238 :       CALL section_add_keyword(section, keyword)
     737         9238 :       CALL keyword_release(keyword)
     738              : 
     739         9238 :       NULLIFY (sub_section)
     740              :       CALL section_create(sub_section, __LOCATION__, name="JOB", &
     741              :                           description="description of the jobs to be executed", &
     742         9238 :                           repeats=.TRUE.)
     743              : 
     744              :       CALL keyword_create(keyword, __LOCATION__, name="DIRECTORY", &
     745              :                           description="the directory in which the job should be executed", &
     746              :                           usage="DIRECTORY /my/path", &
     747         9238 :                           default_lc_val=".")
     748         9238 :       CALL section_add_keyword(sub_section, keyword)
     749         9238 :       CALL keyword_release(keyword)
     750              : 
     751              :       CALL keyword_create(keyword, __LOCATION__, name="INPUT_FILE_NAME", &
     752              :                           description="the filename of the input file", &
     753              :                           usage="INPUT_FILE_NAME my_input.inp", &
     754         9238 :                           default_lc_val="input.inp")
     755         9238 :       CALL section_add_keyword(sub_section, keyword)
     756         9238 :       CALL keyword_release(keyword)
     757              : 
     758              :       CALL keyword_create( &
     759              :          keyword, __LOCATION__, name="OUTPUT_FILE_NAME", &
     760              :          description="the filename of the output file, if not specified will use the project name in the &GLOBAL section.", &
     761              :          usage="OUTPUT_FILE_NAME my_input.inp", &
     762         9238 :          default_lc_val="")
     763         9238 :       CALL section_add_keyword(sub_section, keyword)
     764         9238 :       CALL keyword_release(keyword)
     765              : 
     766              :       CALL keyword_create(keyword, __LOCATION__, name="JOB_ID", &
     767              :                           description="An ID used to indentify a job in DEPENDENCIES. "// &
     768              :                           "JOB_IDs do not need to be unique, dependencies will be on all jobs with a given ID. "// &
     769              :                           "If no JOB_ID is given, the index of the &JOB section in the input file will be used.", &
     770         9238 :                           usage="JOB_ID 13", type_of_var=integer_t)
     771         9238 :       CALL section_add_keyword(sub_section, keyword)
     772         9238 :       CALL keyword_release(keyword)
     773              : 
     774              :       CALL keyword_create( &
     775              :          keyword, __LOCATION__, name="DEPENDENCIES", &
     776              :          description="specifies a list of JOB_IDs on which the current job depends. "// &
     777              :          "The current job will not be executed before all the dependencies have finished. "// &
     778              :          "The keyword requires a CAPTAIN_MINION farming run. "// &
     779              :          "Beyond the default case, some special cases might arise: "// &
     780              :          "1) circular dependencies will lead to a deadlock. "// &
     781              :          "2) This keyword is not compatible with CYCLE. "// &
     782              :          "3) MAX_JOBS_PER_GROUP is ignored (though only a total of MAX_JOBS_PER_GROUP*NGROUPS jobs will be executed) "// &
     783              :          "4) dependencies on jobs that will not be executed (due to RESTART or MAX_JOBS_PER_GROUP) are ignored. "// &
     784              :          "Additionally, note that, on some file systems, "// &
     785              :          "output (restart) files might not be immediately available on all compute nodes, "// &
     786              :          "potentially resulting in unexpected failures.", &
     787         9238 :          usage="DEPENDENCIES 13 1 7", type_of_var=integer_t, n_var=-1)
     788         9238 :       CALL section_add_keyword(sub_section, keyword)
     789         9238 :       CALL keyword_release(keyword)
     790         9238 :       CALL section_add_subsection(section, sub_section)
     791         9238 :       CALL section_release(sub_section)
     792              : 
     793              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "PROGRAM_RUN_INFO", &
     794              :                                        description="Controls the printing of FARMING specific output", &
     795         9238 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
     796         9238 :       CALL section_add_subsection(section, print_key)
     797         9238 :       CALL section_release(print_key)
     798              : 
     799              :       CALL keyword_create(keyword, __LOCATION__, name="DO_RESTART", &
     800              :                           description="Restart a farming job (and should pick up where the previous left off)", &
     801         9238 :                           usage="DO_RESTART", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     802         9238 :       CALL section_add_keyword(section, keyword)
     803         9238 :       CALL keyword_release(keyword)
     804              : 
     805              :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_FILE_NAME", &
     806              :                           description="Name of the restart file to use for restarting a FARMING run. If not "// &
     807              :                           "specified the name is determined from PROJECT name.", &
     808         9238 :                           usage="RESTART_FILE_NAME <FILENAME>", type_of_var=lchar_t)
     809         9238 :       CALL section_add_keyword(section, keyword)
     810         9238 :       CALL keyword_release(keyword)
     811              : 
     812              :       CALL cp_print_key_section_create(print_key, __LOCATION__, "RESTART", &
     813              :                                        description="controls the printing of the restart for FARMING.", &
     814         9238 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="FARMING")
     815         9238 :       CALL section_add_subsection(section, print_key)
     816         9238 :       CALL section_release(print_key)
     817              : 
     818         9238 :    END SUBROUTINE create_farming_section
     819              : 
     820              : ! **************************************************************************************************
     821              : !> \brief   creates the rs_pw_transfer section for use in the test section
     822              : !> \param section ...
     823              : !> \date    2008-03-09
     824              : !> \author  Joost VandeVondele
     825              : ! **************************************************************************************************
     826         9238 :    SUBROUTINE create_rs_pw_transfer_section(section)
     827              :       TYPE(section_type), POINTER                        :: section
     828              : 
     829              :       TYPE(keyword_type), POINTER                        :: keyword
     830              :       TYPE(section_type), POINTER                        :: subsection
     831              : 
     832         9238 :       CPASSERT(.NOT. ASSOCIATED(section))
     833              :       CALL section_create(section, __LOCATION__, name="RS_PW_TRANSFER", &
     834              :                           description="Describes how to benchmark the rs_pw_transfer routines.", &
     835         9238 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     836              : 
     837         9238 :       NULLIFY (keyword)
     838              :       CALL keyword_create(keyword, __LOCATION__, name="GRID", &
     839              :                           description="Specify the number of grid points (not all grid points are allowed)", &
     840              :                           usage="GRID_DIMENSIONS 128 128 128", type_of_var=integer_t, n_var=3, &
     841         9238 :                           default_i_vals=(/128, 128, 128/))
     842         9238 :       CALL section_add_keyword(section, keyword)
     843         9238 :       CALL keyword_release(keyword)
     844              : 
     845              :       CALL keyword_create(keyword, __LOCATION__, name="HALO_SIZE", &
     846              :                           description="number of grid points of the halo", &
     847         9238 :                           usage="HALO_SIZE 17", default_i_val=17)
     848         9238 :       CALL section_add_keyword(section, keyword)
     849         9238 :       CALL keyword_release(keyword)
     850              : 
     851              :       CALL keyword_create(keyword, __LOCATION__, name="N_LOOP", &
     852              :                           description="Number of rs_pw_transfers being timed", &
     853         9238 :                           usage="N_LOOP 100", default_i_val=10)
     854         9238 :       CALL section_add_keyword(section, keyword)
     855         9238 :       CALL keyword_release(keyword)
     856              : 
     857              :       CALL keyword_create(keyword, __LOCATION__, name="RS2PW", &
     858              :                           description="should the direction be rs2pw (pw2rs otherwise)", &
     859         9238 :                           usage="rs2pw TRUE", default_l_val=.TRUE.)
     860         9238 :       CALL section_add_keyword(section, keyword)
     861         9238 :       CALL keyword_release(keyword)
     862              : 
     863         9238 :       NULLIFY (subsection)
     864         9238 :       CALL create_rsgrid_section(subsection)
     865         9238 :       CALL section_add_subsection(section, subsection)
     866         9238 :       CALL section_release(subsection)
     867              : 
     868         9238 :    END SUBROUTINE create_rs_pw_transfer_section
     869              : 
     870              : ! **************************************************************************************************
     871              : !> \brief   creates the rs_pw_transfer section for use in the test section
     872              : !> \param section ...
     873              : !> \date    2008-03-09
     874              : !> \author  Joost VandeVondele
     875              : ! **************************************************************************************************
     876         9238 :    SUBROUTINE create_pw_transfer_section(section)
     877              :       TYPE(section_type), POINTER                        :: section
     878              : 
     879              :       TYPE(keyword_type), POINTER                        :: keyword
     880              : 
     881         9238 :       CPASSERT(.NOT. ASSOCIATED(section))
     882              :       CALL section_create(section, __LOCATION__, name="PW_TRANSFER", &
     883              :                           description="Benchmark and test the pw_transfer routines.", &
     884         9238 :                           n_keywords=1, n_subsections=0, repeats=.TRUE.)
     885              : 
     886         9238 :       NULLIFY (keyword)
     887              :       CALL keyword_create(keyword, __LOCATION__, name="GRID", &
     888              :                           description="Specify the number of grid points (not all grid points are allowed)", &
     889              :                           usage="GRID_DIMENSIONS 128 128 128", type_of_var=integer_t, n_var=3, &
     890         9238 :                           default_i_vals=(/128, 128, 128/))
     891         9238 :       CALL section_add_keyword(section, keyword)
     892         9238 :       CALL keyword_release(keyword)
     893              : 
     894              :       CALL keyword_create(keyword, __LOCATION__, name="N_LOOP", &
     895              :                           description="Number of pw_transfers (backward&forward) being timed", &
     896         9238 :                           usage="N_LOOP 100", default_i_val=100)
     897         9238 :       CALL section_add_keyword(section, keyword)
     898         9238 :       CALL keyword_release(keyword)
     899              : 
     900              :       CALL keyword_create(keyword, __LOCATION__, name="PW_GRID", &
     901              :                           description="What kind of PW_GRID should be employed", &
     902              :                           usage="PW_GRID NS-FULLSPACE", &
     903              :                           enum_c_vals=s2a("SPHERICAL", "NS-FULLSPACE", "NS-HALFSPACE"), &
     904              :                           enum_desc=s2a("- not tested", " tested", " - not tested"), &
     905              :                           enum_i_vals=(/do_pwgrid_spherical, do_pwgrid_ns_fullspace, do_pwgrid_ns_halfspace/), &
     906         9238 :                           default_i_val=do_pwgrid_ns_fullspace)
     907         9238 :       CALL section_add_keyword(section, keyword)
     908         9238 :       CALL keyword_release(keyword)
     909              : 
     910              :       CALL keyword_create(keyword, __LOCATION__, name="PW_GRID_LAYOUT_ALL", &
     911              :                           description="loop overal all PW_GRID_LAYOUTs that are compatible with a given number of CPUs ", &
     912         9238 :                           usage="PW_GRID_LAYOUT_ALL", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     913         9238 :       CALL section_add_keyword(section, keyword)
     914         9238 :       CALL keyword_release(keyword)
     915              : 
     916              :       CALL keyword_create(keyword, __LOCATION__, name="DEBUG", &
     917              :                           description="Do the FFT in debug mode in all cases", &
     918         9238 :                           usage="DEBUG", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     919         9238 :       CALL section_add_keyword(section, keyword)
     920         9238 :       CALL keyword_release(keyword)
     921              : 
     922              :       CALL keyword_create(keyword, __LOCATION__, name="PW_GRID_LAYOUT", &
     923              :                           description="Expert use only, leave the default... "// &
     924              :                           "Can be used to set the distribution for ray-distributed FFT.", &
     925              :                           usage="PW_GRID_LAYOUT", &
     926              :                           repeats=.FALSE., n_var=2, &
     927         9238 :                           default_i_vals=(/-1, -1/))
     928         9238 :       CALL section_add_keyword(section, keyword)
     929         9238 :       CALL keyword_release(keyword)
     930              : 
     931              :       CALL keyword_create(keyword, __LOCATION__, name="PW_GRID_BLOCKED", &
     932              :                           description="Expert use only, leave the default... "// &
     933              :                           "Can be used to set the distribution in g-space for the pw grids and their FFT.", &
     934              :                           usage="PW_GRID_BLOCKED FREE", &
     935              :                           enum_c_vals=s2a("FREE", "TRUE", "FALSE"), &
     936              :                           enum_desc=s2a("CP2K will select the optimal value", "blocked", "not blocked"), &
     937              :                           enum_i_vals=(/do_pw_grid_blocked_free, do_pw_grid_blocked_true, do_pw_grid_blocked_false/), &
     938         9238 :                           default_i_val=do_pw_grid_blocked_false)
     939         9238 :       CALL section_add_keyword(section, keyword)
     940         9238 :       CALL keyword_release(keyword)
     941              : 
     942         9238 :    END SUBROUTINE create_pw_transfer_section
     943              : 
     944              : ! **************************************************************************************************
     945              : !> \brief   creates the cp_fm_gemm section for use in the test section
     946              : !> \param section ...
     947              : !> \date    2009-06-15
     948              : !> \author  Joost VandeVondele
     949              : ! **************************************************************************************************
     950         9238 :    SUBROUTINE create_cp_fm_gemm_section(section)
     951              :       TYPE(section_type), POINTER                        :: section
     952              : 
     953              :       TYPE(keyword_type), POINTER                        :: keyword
     954              : 
     955         9238 :       CPASSERT(.NOT. ASSOCIATED(section))
     956              :       CALL section_create(section, __LOCATION__, name="CP_FM_GEMM", &
     957              :                           description="Benchmark and test the cp_fm_gemm routines by multiplying C=A*B  ", &
     958         9238 :                           n_keywords=1, n_subsections=0, repeats=.TRUE.)
     959              : 
     960         9238 :       NULLIFY (keyword)
     961              :       CALL keyword_create(keyword, __LOCATION__, name="N_LOOP", &
     962              :                           description="Number of cp_fm_gemm operations being timed (useful for small matrices).", &
     963         9238 :                           usage="N_LOOP 10", default_i_val=10)
     964         9238 :       CALL section_add_keyword(section, keyword)
     965         9238 :       CALL keyword_release(keyword)
     966              : 
     967              :       CALL keyword_create(keyword, __LOCATION__, name="K", &
     968              :                           description="Dimension 1 of C", &
     969         9238 :                           usage="K 1024", default_i_val=256)
     970         9238 :       CALL section_add_keyword(section, keyword)
     971         9238 :       CALL keyword_release(keyword)
     972              :       CALL keyword_create(keyword, __LOCATION__, name="M", &
     973              :                           description="Inner dimension M   ", &
     974         9238 :                           usage="M 1024", default_i_val=256)
     975         9238 :       CALL section_add_keyword(section, keyword)
     976         9238 :       CALL keyword_release(keyword)
     977              :       CALL keyword_create(keyword, __LOCATION__, name="N", &
     978              :                           description="Dimension 2 of C", &
     979         9238 :                           usage="N 1024", default_i_val=256)
     980         9238 :       CALL section_add_keyword(section, keyword)
     981         9238 :       CALL keyword_release(keyword)
     982              : 
     983              :       CALL keyword_create(keyword, __LOCATION__, name="NROW_BLOCK", &
     984              :                           description="block_size for rows", &
     985         9238 :                           usage="nrow_block 64", default_i_val=32)
     986         9238 :       CALL section_add_keyword(section, keyword)
     987         9238 :       CALL keyword_release(keyword)
     988              : 
     989              :       CALL keyword_create(keyword, __LOCATION__, name="NCOL_BLOCK", &
     990              :                           description="block_size for cols", &
     991         9238 :                           usage="NCOL_BLOCK 64", default_i_val=32)
     992         9238 :       CALL section_add_keyword(section, keyword)
     993         9238 :       CALL keyword_release(keyword)
     994              : 
     995              :       CALL keyword_create(keyword, __LOCATION__, name="ROW_MAJOR", &
     996              :                           description="Use a row major blacs grid", &
     997         9238 :                           usage="ROW_MAJOR .FALSE.", default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     998         9238 :       CALL section_add_keyword(section, keyword)
     999         9238 :       CALL keyword_release(keyword)
    1000              : 
    1001              :       CALL keyword_create(keyword, __LOCATION__, name="FORCE_BLOCKSIZE", &
    1002              :                           description="Forces the blocksize, even if this implies that a few processes might have no data", &
    1003         9238 :                           usage="FORCE_BLOCKSIZE", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1004         9238 :       CALL section_add_keyword(section, keyword)
    1005         9238 :       CALL keyword_release(keyword)
    1006              : 
    1007              :       CALL keyword_create(keyword, __LOCATION__, name="GRID_2D", &
    1008              :                           description="Explicitly set the blacs 2D processor layout."// &
    1009              :                           " If the product differs from the number of MPI ranks,"// &
    1010              :                           " it is ignored and a default nearly square layout is used.", n_var=2, &
    1011         9238 :                           usage="GRID_2D 64 16 ", default_i_vals=(/1, 1/))
    1012         9238 :       CALL section_add_keyword(section, keyword)
    1013         9238 :       CALL keyword_release(keyword)
    1014              : 
    1015              :       CALL keyword_create(keyword, __LOCATION__, name="TRANSA", &
    1016              :                           description="Transpose matrix A", &
    1017         9238 :                           usage="TRANSA", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1018         9238 :       CALL section_add_keyword(section, keyword)
    1019         9238 :       CALL keyword_release(keyword)
    1020              : 
    1021              :       CALL keyword_create(keyword, __LOCATION__, name="TRANSB", &
    1022              :                           description="Transpose matrix B", &
    1023         9238 :                           usage="TRANSB", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1024         9238 :       CALL section_add_keyword(section, keyword)
    1025         9238 :       CALL keyword_release(keyword)
    1026              : 
    1027         9238 :    END SUBROUTINE create_cp_fm_gemm_section
    1028              : 
    1029              : ! **************************************************************************************************
    1030              : !> \brief   creates the eigensolver section for use in the test section
    1031              : !> \param section ...
    1032              : !> \date    2010-03-10
    1033              : !> \author  Joost VandeVondele
    1034              : ! **************************************************************************************************
    1035         9238 :    SUBROUTINE create_eigensolver_section(section)
    1036              :       TYPE(section_type), POINTER                        :: section
    1037              : 
    1038              :       TYPE(keyword_type), POINTER                        :: keyword
    1039              : 
    1040         9238 :       CPASSERT(.NOT. ASSOCIATED(section))
    1041              :       CALL section_create(section, __LOCATION__, name="EIGENSOLVER", &
    1042              :                           description="Benchmark and test the eigensolver routines.", &
    1043         9238 :                           n_keywords=1, n_subsections=0, repeats=.TRUE.)
    1044              : 
    1045         9238 :       NULLIFY (keyword)
    1046              :       CALL keyword_create(keyword, __LOCATION__, name="N", &
    1047              :                           description="Dimension of the square matrix", &
    1048         9238 :                           usage="N 1024", default_i_val=256)
    1049         9238 :       CALL section_add_keyword(section, keyword)
    1050         9238 :       CALL keyword_release(keyword)
    1051              : 
    1052              :       CALL keyword_create(keyword, __LOCATION__, name="N_LOOP", &
    1053              :                           description="Number of operations being timed (useful for small matrices).", &
    1054         9238 :                           usage="N_LOOP 10", default_i_val=10)
    1055         9238 :       CALL section_add_keyword(section, keyword)
    1056         9238 :       CALL keyword_release(keyword)
    1057              : 
    1058              :       CALL keyword_create(keyword, __LOCATION__, name="DIAG_METHOD", &
    1059              :                           description="Diagonalization strategy", &
    1060              :                           usage="DIAG_METHOD syevd", &
    1061              :                           enum_c_vals=s2a("syevd", "syevx"), &
    1062              :                           enum_desc=s2a("(sca)lapacks syevd", "(sca)lapacks syevx"), &
    1063              :                           enum_i_vals=(/do_diag_syevd, do_diag_syevx/), &
    1064         9238 :                           default_i_val=do_diag_syevd)
    1065         9238 :       CALL section_add_keyword(section, keyword)
    1066         9238 :       CALL keyword_release(keyword)
    1067              : 
    1068              :       CALL keyword_create(keyword, __LOCATION__, name="EIGENVALUES", &
    1069              :                           description="number of eigenvalues to be computed (all=<0) ", &
    1070         9238 :                           usage="EIGENVALUES 13", default_i_val=-1)
    1071         9238 :       CALL section_add_keyword(section, keyword)
    1072         9238 :       CALL keyword_release(keyword)
    1073              : 
    1074              :       CALL keyword_create(keyword, __LOCATION__, name="INIT_METHOD", &
    1075              :                           description="Initialization approach", &
    1076              :                           usage="INIT_METHOD RANDOM", &
    1077              :                           enum_c_vals=s2a("random", "read"), &
    1078              :                           enum_desc=s2a("use a random initial matrix", "read a matrix from file MATRIX"), &
    1079              :                           enum_i_vals=(/do_mat_random, do_mat_read/), &
    1080         9238 :                           default_i_val=do_mat_random)
    1081         9238 :       CALL section_add_keyword(section, keyword)
    1082         9238 :       CALL keyword_release(keyword)
    1083              : 
    1084         9238 :    END SUBROUTINE create_eigensolver_section
    1085              : 
    1086              : ! **************************************************************************************************
    1087              : !> \brief   creates the cp_dbcsr section for use in the test section
    1088              : !> \param section ...
    1089              : !> \date    2010-02-08
    1090              : !> \author  Urban Borstnik
    1091              : ! **************************************************************************************************
    1092         9238 :    SUBROUTINE create_cp_dbcsr_section(section)
    1093              :       TYPE(section_type), POINTER                        :: section
    1094              : 
    1095              :       TYPE(keyword_type), POINTER                        :: keyword
    1096              : 
    1097         9238 :       CPASSERT(.NOT. ASSOCIATED(section))
    1098              :       CALL section_create(section, __LOCATION__, name="CP_DBCSR", &
    1099              :                           description="Benchmark and test the cp_dbcsr routines", &
    1100         9238 :                           n_keywords=1, n_subsections=0, repeats=.TRUE.)
    1101              : 
    1102         9238 :       NULLIFY (keyword)
    1103              :       CALL keyword_create(keyword, __LOCATION__, name="N_LOOP", &
    1104              :                           description="Number of operations being timed (useful for small matrices).", &
    1105         9238 :                           usage="N_LOOP 10", default_i_val=10)
    1106         9238 :       CALL section_add_keyword(section, keyword)
    1107         9238 :       CALL keyword_release(keyword)
    1108              : 
    1109              :       CALL keyword_create(keyword, __LOCATION__, name="DATA_TYPE", &
    1110              :                           description="Data type of the matrices", &
    1111              :                           usage="DATA_TYPE real_8", &
    1112              :                           default_i_val=dbcsr_type_real_8, &
    1113              :                           enum_c_vals=s2a("real_8", "complex_8"), &
    1114              :                           enum_i_vals=(/dbcsr_type_real_8, dbcsr_type_complex_8/), &
    1115              :                           enum_desc=s2a( &
    1116              :                           "Real (Double Precision)", &
    1117         9238 :                           "Complex (Double Precision)"))
    1118         9238 :       CALL section_add_keyword(section, keyword)
    1119         9238 :       CALL keyword_release(keyword)
    1120              : 
    1121              :       CALL keyword_create(keyword, __LOCATION__, name="TEST_TYPE", &
    1122              :                           description="Which part of DBCSR is tested", &
    1123              :                           usage="TEST_TYPE MM", &
    1124              :                           default_i_val=dbcsr_test_mm, &
    1125              :                           enum_c_vals=s2a("MM", "Binary_IO"), &
    1126              :                           enum_i_vals=(/dbcsr_test_mm, dbcsr_test_binary_io/), &
    1127              :                           enum_desc=s2a( &
    1128              :                           "Run matrix multiplications", &
    1129         9238 :                           "Run binary IO checks"))
    1130         9238 :       CALL section_add_keyword(section, keyword)
    1131         9238 :       CALL keyword_release(keyword)
    1132              : 
    1133              :       CALL keyword_create(keyword, __LOCATION__, name="M", &
    1134              :                           description="Dimension 1 of C", &
    1135         9238 :                           usage="M 1024", default_i_val=256)
    1136         9238 :       CALL section_add_keyword(section, keyword)
    1137         9238 :       CALL keyword_release(keyword)
    1138              :       CALL keyword_create(keyword, __LOCATION__, name="N", &
    1139              :                           description="Dimension 2 of C", &
    1140         9238 :                           usage="N 1024", default_i_val=256)
    1141         9238 :       CALL section_add_keyword(section, keyword)
    1142         9238 :       CALL keyword_release(keyword)
    1143              :       CALL keyword_create(keyword, __LOCATION__, name="K", &
    1144              :                           description="Inner dimension M   ", &
    1145         9238 :                           usage="K 1024", default_i_val=256)
    1146         9238 :       CALL section_add_keyword(section, keyword)
    1147         9238 :       CALL keyword_release(keyword)
    1148              : 
    1149              :       CALL keyword_create(keyword, __LOCATION__, name="TRANSA", &
    1150              :                           description="Transpose matrix A", &
    1151         9238 :                           usage="TRANSA", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1152         9238 :       CALL section_add_keyword(section, keyword)
    1153         9238 :       CALL keyword_release(keyword)
    1154              : 
    1155              :       CALL keyword_create(keyword, __LOCATION__, name="TRANSB", &
    1156              :                           description="Transpose matrix B", &
    1157         9238 :                           usage="TRANSB", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1158         9238 :       CALL section_add_keyword(section, keyword)
    1159         9238 :       CALL keyword_release(keyword)
    1160              : 
    1161              :       CALL keyword_create(keyword, __LOCATION__, name="BS_M", &
    1162              :                           description="Row block sizes of C", n_var=-1, &
    1163         9238 :                           usage="BS_M 1 13 2 5", default_i_vals=(/1, 13, 2, 15/))
    1164         9238 :       CALL section_add_keyword(section, keyword)
    1165         9238 :       CALL keyword_release(keyword)
    1166              : 
    1167              :       CALL keyword_create(keyword, __LOCATION__, name="BS_N", &
    1168              :                           description="Column block sizes of C", n_var=-1, &
    1169         9238 :                           usage="BS_N 1 13 2 5", default_i_vals=(/1, 13, 2, 15/))
    1170         9238 :       CALL section_add_keyword(section, keyword)
    1171         9238 :       CALL keyword_release(keyword)
    1172              : 
    1173              :       CALL keyword_create(keyword, __LOCATION__, name="BS_K", &
    1174              :                           description="Block sizes of inner dimension", n_var=-1, &
    1175         9238 :                           usage="BS_K 1 13 2 5", default_i_vals=(/1, 13, 2, 15/))
    1176         9238 :       CALL section_add_keyword(section, keyword)
    1177         9238 :       CALL keyword_release(keyword)
    1178              : 
    1179              :       CALL keyword_create(keyword, __LOCATION__, name="ATYPE", &
    1180              :                           description="Matrix A type", &
    1181         9238 :                           usage="ATYPE N", default_c_val='N')
    1182         9238 :       CALL section_add_keyword(section, keyword)
    1183         9238 :       CALL keyword_release(keyword)
    1184              :       CALL keyword_create(keyword, __LOCATION__, name="BTYPE", &
    1185              :                           description="Matrix B type", &
    1186         9238 :                           usage="BTYPE N", default_c_val='N')
    1187         9238 :       CALL section_add_keyword(section, keyword)
    1188         9238 :       CALL keyword_release(keyword)
    1189              :       CALL keyword_create(keyword, __LOCATION__, name="CTYPE", &
    1190              :                           description="Matrix C type", &
    1191         9238 :                           usage="CTYPE N", default_c_val='N')
    1192         9238 :       CALL section_add_keyword(section, keyword)
    1193         9238 :       CALL keyword_release(keyword)
    1194              : 
    1195              :       CALL keyword_create(keyword, __LOCATION__, name="NPROC", &
    1196              :                           description="Number of processors to test", n_var=-1, &
    1197         9238 :                           usage="NPROC 128 16 1", default_i_vals=(/0/))
    1198         9238 :       CALL section_add_keyword(section, keyword)
    1199         9238 :       CALL keyword_release(keyword)
    1200              : 
    1201              :       CALL keyword_create(keyword, __LOCATION__, name="KEEPSPARSE", &
    1202              :                           description="Keep product sparse", &
    1203         9238 :                           usage="KEEPSPARSE", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1204         9238 :       CALL section_add_keyword(section, keyword)
    1205         9238 :       CALL keyword_release(keyword)
    1206              : 
    1207              :       CALL keyword_create(keyword, __LOCATION__, name="ASPARSITY", &
    1208              :                           description="Sparsity of A matrix", &
    1209         9238 :                           usage="ASPARSITY 70", default_r_val=0.0_dp)
    1210         9238 :       CALL section_add_keyword(section, keyword)
    1211         9238 :       CALL keyword_release(keyword)
    1212              : 
    1213              :       CALL keyword_create(keyword, __LOCATION__, name="BSPARSITY", &
    1214              :                           description="Sparsity of B matrix", &
    1215         9238 :                           usage="BSPARSITY 80", default_r_val=0.0_dp)
    1216         9238 :       CALL section_add_keyword(section, keyword)
    1217         9238 :       CALL keyword_release(keyword)
    1218              : 
    1219              :       CALL keyword_create(keyword, __LOCATION__, name="CSPARSITY", &
    1220              :                           description="Sparsity of C matrix", &
    1221         9238 :                           usage="CSPARSITY 90", default_r_val=0.0_dp)
    1222         9238 :       CALL section_add_keyword(section, keyword)
    1223         9238 :       CALL keyword_release(keyword)
    1224              : 
    1225              :       CALL keyword_create(keyword, __LOCATION__, name="ALPHA", &
    1226              :                           description="Multiplication factor", &
    1227         9238 :                           usage="ALPHA 2.0", default_r_val=1.0_dp)
    1228         9238 :       CALL section_add_keyword(section, keyword)
    1229         9238 :       CALL keyword_release(keyword)
    1230              : 
    1231              :       CALL keyword_create(keyword, __LOCATION__, name="BETA", &
    1232              :                           description="Product premultiplication factor", &
    1233         9238 :                           usage="BETA 1.0", default_r_val=0.0_dp)
    1234         9238 :       CALL section_add_keyword(section, keyword)
    1235         9238 :       CALL keyword_release(keyword)
    1236              : 
    1237              :       CALL keyword_create(keyword, __LOCATION__, name="FILTER_EPS", &
    1238              :                           description="Threshold for on-the-fly and final filtering.", &
    1239         9238 :                           usage="FILTER_EPS 1.0", default_r_val=-1.0_dp)
    1240         9238 :       CALL section_add_keyword(section, keyword)
    1241         9238 :       CALL keyword_release(keyword)
    1242              : 
    1243              :       CALL keyword_create(keyword, __LOCATION__, name="ALWAYS_CHECKSUM", &
    1244              :                           description="perform a checksum after each multiplication", &
    1245         9238 :                           usage="ALWAYS_CHECKSUM", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1246         9238 :       CALL section_add_keyword(section, keyword)
    1247         9238 :       CALL keyword_release(keyword)
    1248              : 
    1249         9238 :    END SUBROUTINE create_cp_dbcsr_section
    1250              : 
    1251              : ! **************************************************************************************************
    1252              : !> \brief Creates the DBM section for use in the test section.
    1253              : !> \param section ...
    1254              : !> \author Ole Schuett
    1255              : ! **************************************************************************************************
    1256         9238 :    SUBROUTINE create_dbm_section(section)
    1257              :       TYPE(section_type), POINTER                        :: section
    1258              : 
    1259              :       TYPE(keyword_type), POINTER                        :: keyword
    1260              : 
    1261         9238 :       CPASSERT(.NOT. ASSOCIATED(section))
    1262              :       CALL section_create(section, __LOCATION__, name="DBM", &
    1263              :                           description="Benchmark and test the dbm routines", &
    1264         9238 :                           n_keywords=1, n_subsections=0, repeats=.TRUE.)
    1265              : 
    1266         9238 :       NULLIFY (keyword)
    1267              :       CALL keyword_create(keyword, __LOCATION__, name="N_LOOP", &
    1268              :                           description="Number of operations being timed (useful for small matrices).", &
    1269         9238 :                           usage="N_LOOP 10", default_i_val=10)
    1270         9238 :       CALL section_add_keyword(section, keyword)
    1271         9238 :       CALL keyword_release(keyword)
    1272              : 
    1273              :       CALL keyword_create(keyword, __LOCATION__, name="M", &
    1274              :                           description="Dimension 1 of C", &
    1275         9238 :                           usage="M 1024", default_i_val=256)
    1276         9238 :       CALL section_add_keyword(section, keyword)
    1277         9238 :       CALL keyword_release(keyword)
    1278              :       CALL keyword_create(keyword, __LOCATION__, name="N", &
    1279              :                           description="Dimension 2 of C", &
    1280         9238 :                           usage="N 1024", default_i_val=256)
    1281         9238 :       CALL section_add_keyword(section, keyword)
    1282         9238 :       CALL keyword_release(keyword)
    1283              :       CALL keyword_create(keyword, __LOCATION__, name="K", &
    1284              :                           description="Inner dimension M   ", &
    1285         9238 :                           usage="K 1024", default_i_val=256)
    1286         9238 :       CALL section_add_keyword(section, keyword)
    1287         9238 :       CALL keyword_release(keyword)
    1288              : 
    1289              :       CALL keyword_create(keyword, __LOCATION__, name="TRANSA", &
    1290              :                           description="Transpose matrix A", &
    1291         9238 :                           usage="TRANSA", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1292         9238 :       CALL section_add_keyword(section, keyword)
    1293         9238 :       CALL keyword_release(keyword)
    1294              : 
    1295              :       CALL keyword_create(keyword, __LOCATION__, name="TRANSB", &
    1296              :                           description="Transpose matrix B", &
    1297         9238 :                           usage="TRANSB", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1298         9238 :       CALL section_add_keyword(section, keyword)
    1299         9238 :       CALL keyword_release(keyword)
    1300              : 
    1301              :       CALL keyword_create(keyword, __LOCATION__, name="BS_M", &
    1302              :                           description="Row block sizes of C", n_var=-1, &
    1303         9238 :                           usage="BS_M 1 13 2 5", default_i_vals=(/1, 13, 2, 15/))
    1304         9238 :       CALL section_add_keyword(section, keyword)
    1305         9238 :       CALL keyword_release(keyword)
    1306              : 
    1307              :       CALL keyword_create(keyword, __LOCATION__, name="BS_N", &
    1308              :                           description="Column block sizes of C", n_var=-1, &
    1309         9238 :                           usage="BS_N 1 13 2 5", default_i_vals=(/1, 13, 2, 15/))
    1310         9238 :       CALL section_add_keyword(section, keyword)
    1311         9238 :       CALL keyword_release(keyword)
    1312              : 
    1313              :       CALL keyword_create(keyword, __LOCATION__, name="BS_K", &
    1314              :                           description="Block sizes of inner dimension", n_var=-1, &
    1315         9238 :                           usage="BS_K 1 13 2 5", default_i_vals=(/1, 13, 2, 15/))
    1316         9238 :       CALL section_add_keyword(section, keyword)
    1317         9238 :       CALL keyword_release(keyword)
    1318              : 
    1319              :       CALL keyword_create(keyword, __LOCATION__, name="KEEPSPARSE", &
    1320              :                           description="Keep product sparse", &
    1321         9238 :                           usage="KEEPSPARSE", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1322         9238 :       CALL section_add_keyword(section, keyword)
    1323         9238 :       CALL keyword_release(keyword)
    1324              : 
    1325              :       CALL keyword_create(keyword, __LOCATION__, name="ASPARSITY", &
    1326              :                           description="Sparsity of A matrix", &
    1327         9238 :                           usage="ASPARSITY 70", default_r_val=0.0_dp)
    1328         9238 :       CALL section_add_keyword(section, keyword)
    1329         9238 :       CALL keyword_release(keyword)
    1330              : 
    1331              :       CALL keyword_create(keyword, __LOCATION__, name="BSPARSITY", &
    1332              :                           description="Sparsity of B matrix", &
    1333         9238 :                           usage="BSPARSITY 80", default_r_val=0.0_dp)
    1334         9238 :       CALL section_add_keyword(section, keyword)
    1335         9238 :       CALL keyword_release(keyword)
    1336              : 
    1337              :       CALL keyword_create(keyword, __LOCATION__, name="CSPARSITY", &
    1338              :                           description="Sparsity of C matrix", &
    1339         9238 :                           usage="CSPARSITY 90", default_r_val=0.0_dp)
    1340         9238 :       CALL section_add_keyword(section, keyword)
    1341         9238 :       CALL keyword_release(keyword)
    1342              : 
    1343              :       CALL keyword_create(keyword, __LOCATION__, name="ALPHA", &
    1344              :                           description="Multiplication factor", &
    1345         9238 :                           usage="ALPHA 2.0", default_r_val=1.0_dp)
    1346         9238 :       CALL section_add_keyword(section, keyword)
    1347         9238 :       CALL keyword_release(keyword)
    1348              : 
    1349              :       CALL keyword_create(keyword, __LOCATION__, name="BETA", &
    1350              :                           description="Product premultiplication factor", &
    1351         9238 :                           usage="BETA 1.0", default_r_val=0.0_dp)
    1352         9238 :       CALL section_add_keyword(section, keyword)
    1353         9238 :       CALL keyword_release(keyword)
    1354              : 
    1355              :       CALL keyword_create(keyword, __LOCATION__, name="FILTER_EPS", &
    1356              :                           description="Threshold for on-the-fly and final filtering.", &
    1357         9238 :                           usage="FILTER_EPS 1.0", default_r_val=-1.0_dp)
    1358         9238 :       CALL section_add_keyword(section, keyword)
    1359         9238 :       CALL keyword_release(keyword)
    1360              : 
    1361              :       CALL keyword_create(keyword, __LOCATION__, name="ALWAYS_CHECKSUM", &
    1362              :                           description="perform a checksum after each multiplication", &
    1363         9238 :                           usage="ALWAYS_CHECKSUM", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1364         9238 :       CALL section_add_keyword(section, keyword)
    1365         9238 :       CALL keyword_release(keyword)
    1366              : 
    1367         9238 :    END SUBROUTINE create_dbm_section
    1368              : END MODULE input_cp2k
        

Generated by: LCOV version 2.0-1