LCOV - code coverage report
Current view: top level - src/start - input_cp2k.F (source / functions) Hit Total Coverage
Test: CP2K Regtests (git:34ef472) Lines: 579 579 100.0 %
Date: 2024-04-26 08:30:29 Functions: 12 12 100.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------------------------!
       2             : !   CP2K: A general program to perform molecular dynamics simulations                              !
       3             : !   Copyright 2000-2024 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        8392 :    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        8392 :       CALL timeset(routineN, handle)
      83             : 
      84        8392 :       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        8392 :                           repeats=.FALSE.)
      88        8392 :       NULLIFY (section)
      89             : 
      90        8392 :       CALL create_global_section(section)
      91        8392 :       CALL section_add_subsection(root_section, section)
      92        8392 :       CALL section_release(section)
      93             : 
      94        8392 :       CALL create_test_section(section)
      95        8392 :       CALL section_add_subsection(root_section, section)
      96        8392 :       CALL section_release(section)
      97             : 
      98        8392 :       CALL create_debug_section(section)
      99        8392 :       CALL section_add_subsection(root_section, section)
     100        8392 :       CALL section_release(section)
     101             : 
     102        8392 :       CALL create_motion_section(section)
     103        8392 :       CALL section_add_subsection(root_section, section)
     104        8392 :       CALL section_release(section)
     105             : 
     106        8392 :       CALL create_multi_force_section(section)
     107        8392 :       CALL section_add_subsection(root_section, section)
     108        8392 :       CALL section_release(section)
     109             : 
     110        8392 :       CALL create_force_eval_section(section)
     111        8392 :       CALL section_add_subsection(root_section, section)
     112        8392 :       CALL section_release(section)
     113             : 
     114        8392 :       CALL create_farming_section(section)
     115        8392 :       CALL section_add_subsection(root_section, section)
     116        8392 :       CALL section_release(section)
     117             : 
     118        8392 :       CALL create_optimize_input_section(section)
     119        8392 :       CALL section_add_subsection(root_section, section)
     120        8392 :       CALL section_release(section)
     121             : 
     122        8392 :       CALL create_optimize_basis_section(section)
     123        8392 :       CALL section_add_subsection(root_section, section)
     124        8392 :       CALL section_release(section)
     125             : 
     126        8392 :       CALL create_swarm_section(section)
     127        8392 :       CALL section_add_subsection(root_section, section)
     128        8392 :       CALL section_release(section)
     129             : 
     130        8392 :       CALL create_ext_restart_section(section)
     131        8392 :       CALL section_add_subsection(root_section, section)
     132        8392 :       CALL section_release(section)
     133             : 
     134        8392 :       CALL create_vib_section(section)
     135        8392 :       CALL section_add_subsection(root_section, section)
     136        8392 :       CALL section_release(section)
     137             : 
     138        8392 :       CALL create_negf_section(section)
     139        8392 :       CALL section_add_subsection(root_section, section)
     140        8392 :       CALL section_release(section)
     141             : 
     142        8392 :       CALL create_atom_section(section)
     143        8392 :       CALL section_add_subsection(root_section, section)
     144        8392 :       CALL section_release(section)
     145        8392 :       CALL timestop(handle)
     146             : 
     147        8392 :    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        8392 :    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        8392 :                           n_keywords=6, n_subsections=0, repeats=.FALSE.)
     163             : 
     164        8392 :       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        8392 :                           usage="MEMORY <REAL>", default_r_val=256.e6_dp)
     168        8392 :       CALL section_add_keyword(section, keyword)
     169        8392 :       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        8392 :                           usage="copy 10", default_i_val=0)
     177        8392 :       CALL section_add_keyword(section, keyword)
     178        8392 :       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        8392 :                           usage="matmul 10", default_i_val=0)
     184        8392 :       CALL section_add_keyword(section, keyword)
     185        8392 :       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        8392 :                           usage="DGEMM 10", default_i_val=0)
     191        8392 :       CALL section_add_keyword(section, keyword)
     192        8392 :       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        8392 :                           usage="fft 10", default_i_val=0)
     198        8392 :       CALL section_add_keyword(section, keyword)
     199        8392 :       CALL keyword_release(keyword)
     200             : 
     201             :       CALL keyword_create(keyword, __LOCATION__, name="ERI", &
     202             :                           description="Tests the performance and correctness of ERI libraries ", &
     203        8392 :                           usage="eri 1", default_i_val=0)
     204        8392 :       CALL section_add_keyword(section, keyword)
     205        8392 :       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       16784 :                           usage="clebsch_gordon 10", default_i_val=0)
     211             : 
     212        8392 :       CALL section_add_keyword(section, keyword)
     213        8392 :       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        8392 :                           usage="mpi 6", default_i_val=0)
     222             : 
     223        8392 :       CALL section_add_keyword(section, keyword)
     224        8392 :       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        8392 :                           usage="MINIMAX 1000", default_i_val=0)
     232        8392 :       CALL section_add_keyword(section, keyword)
     233        8392 :       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        8392 :                           usage="MINIMAX 1000", default_i_val=0)
     241        8392 :       CALL section_add_keyword(section, keyword)
     242        8392 :       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        8392 :          print_level=medium_print_level, filename="__STD_OUT__")
     249        8392 :       CALL section_add_subsection(section, print_key)
     250        8392 :       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 tests output", &
     254        8392 :                                        print_level=silent_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
     255        8392 :       CALL section_add_subsection(section, print_key)
     256        8392 :       CALL section_release(print_key)
     257             : 
     258        8392 :       NULLIFY (subsection)
     259        8392 :       CALL create_rs_pw_transfer_section(subsection)
     260        8392 :       CALL section_add_subsection(section, subsection)
     261        8392 :       CALL section_release(subsection)
     262             : 
     263        8392 :       CALL create_eigensolver_section(subsection)
     264        8392 :       CALL section_add_subsection(section, subsection)
     265        8392 :       CALL section_release(subsection)
     266             : 
     267        8392 :       CALL create_pw_transfer_section(subsection)
     268        8392 :       CALL section_add_subsection(section, subsection)
     269        8392 :       CALL section_release(subsection)
     270             : 
     271        8392 :       CALL create_cp_fm_gemm_section(subsection)
     272        8392 :       CALL section_add_subsection(section, subsection)
     273        8392 :       CALL section_release(subsection)
     274             : 
     275        8392 :       CALL create_cp_dbcsr_section(subsection)
     276        8392 :       CALL section_add_subsection(section, subsection)
     277        8392 :       CALL section_release(subsection)
     278             : 
     279        8392 :       CALL create_dbm_section(subsection)
     280        8392 :       CALL section_add_subsection(section, subsection)
     281        8392 :       CALL section_release(subsection)
     282             : 
     283        8392 :       CALL create_eri_mme_test_section(subsection)
     284        8392 :       CALL section_add_subsection(section, subsection)
     285        8392 :       CALL section_release(subsection)
     286             : 
     287        8392 :       CALL create_shg_integrals_test_section(subsection)
     288        8392 :       CALL section_add_subsection(section, subsection)
     289        8392 :       CALL section_release(subsection)
     290             : 
     291        8392 :    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        8392 :    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        8392 :                           n_keywords=7, n_subsections=0, repeats=.FALSE.)
     307             : 
     308        8392 :       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        8392 :                           lone_keyword_l_val=.TRUE.)
     314        8392 :       CALL section_add_keyword(section, keyword)
     315        8392 :       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        8392 :                           lone_keyword_l_val=.TRUE.)
     321        8392 :       CALL section_add_keyword(section, keyword)
     322        8392 :       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        8392 :                           lone_keyword_l_val=.TRUE.)
     328        8392 :       CALL section_add_keyword(section, keyword)
     329        8392 :       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        8392 :                           lone_keyword_l_val=.TRUE.)
     335        8392 :       CALL section_add_keyword(section, keyword)
     336        8392 :       CALL keyword_release(keyword)
     337             : 
     338             :       CALL keyword_create(keyword, __LOCATION__, name="DX", &
     339             :                           description="Increment for the calculation of the numerical derivatives", &
     340        8392 :                           usage="DX {REAL}", default_r_val=0.001_dp)
     341        8392 :       CALL section_add_keyword(section, keyword)
     342        8392 :       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        8392 :                           usage="DE {REAL}", default_r_val=0.0001_dp)
     347        8392 :       CALL section_add_keyword(section, keyword)
     348        8392 :       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        8392 :                           usage="MAX_RELATIVE_ERROR {REAL}", default_r_val=0.2_dp)
     354        8392 :       CALL section_add_keyword(section, keyword)
     355        8392 :       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        8392 :                           usage="EPS_NO_ERROR_CHECK {REAL}", default_r_val=1.0E-5_dp)
     362        8392 :       CALL section_add_keyword(section, keyword)
     363        8392 :       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        8392 :                           lone_keyword_l_val=.TRUE.)
     370        8392 :       CALL section_add_keyword(section, keyword)
     371        8392 :       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        8392 :                           default_c_val="XYZ")
     377        8392 :       CALL section_add_keyword(section, keyword)
     378        8392 :       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        8392 :                           type_of_var=char_t, n_var=2, repeats=.TRUE.)
     384        8392 :       CALL section_add_keyword(section, keyword)
     385        8392 :       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        8392 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
     390        8392 :       CALL section_add_subsection(section, print_key)
     391        8392 :       CALL section_release(print_key)
     392             : 
     393        8392 :    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        8392 :    SUBROUTINE create_multi_force_section(section)
     401             :       TYPE(section_type), POINTER                        :: section
     402             : 
     403             :       TYPE(keyword_type), POINTER                        :: keyword
     404             : 
     405        8392 :       CPASSERT(.NOT. ASSOCIATED(section))
     406             :       CALL section_create(section, __LOCATION__, name="MULTIPLE_FORCE_EVALS", &
     407             :                           description="Describes how to handle multiple force_evals.", &
     408        8392 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     409             : 
     410        8392 :       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        8392 :                           default_i_vals=(/1/))
     417        8392 :       CALL section_add_keyword(section, keyword)
     418        8392 :       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        8392 :                           default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     425        8392 :       CALL section_add_keyword(section, keyword)
     426        8392 :       CALL keyword_release(keyword)
     427             : 
     428        8392 :    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        8392 :    SUBROUTINE create_ext_restart_section(section)
     436             :       TYPE(section_type), POINTER                        :: section
     437             : 
     438             :       TYPE(keyword_type), POINTER                        :: keyword
     439             : 
     440        8392 :       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        8392 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     446        8392 :       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       16784 :                           default_lc_val=" ")
     453        8392 :       CALL section_add_keyword(section, keyword)
     454        8392 :       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       16784 :                           default_lc_val="")
     462        8392 :       CALL section_add_keyword(section, keyword)
     463        8392 :       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        8392 :                           " restarted.", default_l_val=.TRUE.)
     471        8392 :       CALL section_add_keyword(section, keyword)
     472        8392 :       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        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     476        8392 :       CALL section_add_keyword(section, keyword)
     477        8392 :       CALL keyword_release(keyword)
     478             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_POS", &
     479             :                           description="Takes the positions from the external file", &
     480        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     481        8392 :       CALL section_add_keyword(section, keyword)
     482        8392 :       CALL keyword_release(keyword)
     483             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_VEL", &
     484             :                           description="Takes the velocities from the external file", &
     485        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     486        8392 :       CALL section_add_keyword(section, keyword)
     487        8392 :       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        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     491        8392 :       CALL section_add_keyword(section, keyword)
     492        8392 :       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        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     497        8392 :       CALL section_add_keyword(section, keyword)
     498        8392 :       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        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     502        8392 :       CALL section_add_keyword(section, keyword)
     503        8392 :       CALL keyword_release(keyword)
     504             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_OPTIMIZE_INPUT_VARIABLES", &
     505             :                           description="Restart with the optimize input variables", &
     506        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     507        8392 :       CALL section_add_keyword(section, keyword)
     508        8392 :       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        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     513        8392 :       CALL section_add_keyword(section, keyword)
     514        8392 :       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        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     518        8392 :       CALL section_add_keyword(section, keyword)
     519        8392 :       CALL keyword_release(keyword)
     520             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_BAROSTAT", &
     521             :                           description="Restarts the barostat from the external file", &
     522        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     523        8392 :       CALL section_add_keyword(section, keyword)
     524        8392 :       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        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     528        8392 :       CALL section_add_keyword(section, keyword)
     529        8392 :       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        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     533        8392 :       CALL section_add_keyword(section, keyword)
     534        8392 :       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        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     539        8392 :       CALL section_add_keyword(section, keyword)
     540        8392 :       CALL keyword_release(keyword)
     541             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_TEMPERATURE_ANNEALING", &
     542             :                           description="Restarts external temperature when using TEMPERATURE_ANNEALING.", &
     543        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     544        8392 :       CALL section_add_keyword(section, keyword)
     545        8392 :       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        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     550        8392 :       CALL section_add_keyword(section, keyword)
     551        8392 :       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        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     556        8392 :       CALL section_add_keyword(section, keyword)
     557        8392 :       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        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     562        8392 :       CALL section_add_keyword(section, keyword)
     563        8392 :       CALL keyword_release(keyword)
     564             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_BAND", &
     565             :                           description="Restarts positions and velocities of the Band.", &
     566        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     567        8392 :       CALL section_add_keyword(section, keyword)
     568        8392 :       CALL keyword_release(keyword)
     569             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_QMMM", &
     570             :                           description="Restarts the following specific QMMM info: translation vectors.", &
     571        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     572        8392 :       CALL section_add_keyword(section, keyword)
     573        8392 :       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        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     579        8392 :       CALL section_add_keyword(section, keyword)
     580        8392 :       CALL keyword_release(keyword)
     581             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_BSSE", &
     582             :                           description="Restarts information for BSSE calculations.", &
     583        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     584        8392 :       CALL section_add_keyword(section, keyword)
     585        8392 :       CALL keyword_release(keyword)
     586             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_DIMER", &
     587             :                           description="Restarts information for DIMER geometry optimizations.", &
     588        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     589        8392 :       CALL section_add_keyword(section, keyword)
     590        8392 :       CALL keyword_release(keyword)
     591             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_AVERAGES", &
     592             :                           description="Restarts information for AVERAGES.", &
     593        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     594        8392 :       CALL section_add_keyword(section, keyword)
     595        8392 :       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        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     599        8392 :       CALL section_add_keyword(section, keyword)
     600        8392 :       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        8392 :                           type_of_var=char_t, repeats=.TRUE.)
     604        8392 :       CALL section_add_keyword(section, keyword)
     605        8392 :       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        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     611        8392 :       CALL section_add_keyword(section, keyword)
     612        8392 :       CALL keyword_release(keyword)
     613             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_PINT_VEL", &
     614             :                           description="Restart bead velocities from PINT%BEADS%VELOCITY.", &
     615        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     616        8392 :       CALL section_add_keyword(section, keyword)
     617        8392 :       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        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     621        8392 :       CALL section_add_keyword(section, keyword)
     622        8392 :       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        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     626        8392 :       CALL section_add_keyword(section, keyword)
     627        8392 :       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        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     633        8392 :       CALL section_add_keyword(section, keyword)
     634        8392 :       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        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     638        8392 :       CALL section_add_keyword(section, keyword)
     639        8392 :       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        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     643        8392 :       CALL section_add_keyword(section, keyword)
     644        8392 :       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        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE.)
     648        8392 :       CALL section_add_keyword(section, keyword)
     649        8392 :       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        8392 :                           default_l_val=.FALSE.)
     654        8392 :       CALL section_add_keyword(section, keyword)
     655        8392 :       CALL keyword_release(keyword)
     656             :       CALL keyword_create(keyword, __LOCATION__, name="RESTART_HELIUM_AVERAGES", &
     657             :                           description="Restarts average properties from PINT%HELIUM%AVERAGES.", &
     658        8392 :                           type_of_var=logical_t, lone_keyword_l_val=.TRUE., default_l_val=.FALSE.)
     659        8392 :       CALL section_add_keyword(section, keyword)
     660        8392 :       CALL keyword_release(keyword)
     661             : 
     662        8392 :    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        8392 :    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        8392 :       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        8392 :                           repeats=.FALSE.)
     681        8392 :       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        8392 :          usage="CAPTAIN_MINION", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     689        8392 :       CALL section_add_keyword(section, keyword)
     690        8392 :       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       16784 :                           usage="ngroups 4", type_of_var=integer_t)
     695        8392 :       CALL section_add_keyword(section, keyword)
     696        8392 :       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        8392 :                           usage="group_size 2", default_i_val=8)
     702        8392 :       CALL section_add_keyword(section, keyword)
     703        8392 :       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        8392 :                           usage="STRIDE 2", default_i_val=1)
     709        8392 :       CALL section_add_keyword(section, keyword)
     710        8392 :       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        8392 :                           usage="group_partition  2 2 4 2 4 ", type_of_var=integer_t, n_var=-1)
     715        8392 :       CALL section_add_keyword(section, keyword)
     716        8392 :       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       16784 :                           usage="max_step 4", default_i_val=65535)
     722        8392 :       CALL section_add_keyword(section, keyword)
     723        8392 :       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        8392 :          usage="CYCLE", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     729        8392 :       CALL section_add_keyword(section, keyword)
     730        8392 :       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        8392 :          usage="WAIT_TIME 0.1", default_r_val=0.5_dp)
     736        8392 :       CALL section_add_keyword(section, keyword)
     737        8392 :       CALL keyword_release(keyword)
     738             : 
     739        8392 :       NULLIFY (sub_section)
     740             :       CALL section_create(sub_section, __LOCATION__, name="JOB", &
     741             :                           description="description of the jobs to be executed", &
     742        8392 :                           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        8392 :                           default_lc_val=".")
     748        8392 :       CALL section_add_keyword(sub_section, keyword)
     749        8392 :       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        8392 :                           default_lc_val="input.inp")
     755        8392 :       CALL section_add_keyword(sub_section, keyword)
     756        8392 :       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        8392 :          default_lc_val="")
     763        8392 :       CALL section_add_keyword(sub_section, keyword)
     764        8392 :       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        8392 :                           usage="JOB_ID 13", type_of_var=integer_t)
     771        8392 :       CALL section_add_keyword(sub_section, keyword)
     772        8392 :       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        8392 :          usage="DEPENDENCIES 13 1 7", type_of_var=integer_t, n_var=-1)
     788        8392 :       CALL section_add_keyword(sub_section, keyword)
     789        8392 :       CALL keyword_release(keyword)
     790        8392 :       CALL section_add_subsection(section, sub_section)
     791        8392 :       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        8392 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
     796        8392 :       CALL section_add_subsection(section, print_key)
     797        8392 :       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        8392 :                           usage="DO_RESTART", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     802        8392 :       CALL section_add_keyword(section, keyword)
     803        8392 :       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        8392 :                           usage="RESTART_FILE_NAME <FILENAME>", type_of_var=lchar_t)
     809        8392 :       CALL section_add_keyword(section, keyword)
     810        8392 :       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        8392 :                                        print_level=low_print_level, add_last=add_last_numeric, filename="FARMING")
     815        8392 :       CALL section_add_subsection(section, print_key)
     816        8392 :       CALL section_release(print_key)
     817             : 
     818        8392 :    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        8392 :    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        8392 :       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        8392 :                           n_keywords=1, n_subsections=0, repeats=.FALSE.)
     836             : 
     837        8392 :       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        8392 :                           default_i_vals=(/128, 128, 128/))
     842        8392 :       CALL section_add_keyword(section, keyword)
     843        8392 :       CALL keyword_release(keyword)
     844             : 
     845             :       CALL keyword_create(keyword, __LOCATION__, name="HALO_SIZE", &
     846             :                           description="number of grid points of the halo", &
     847        8392 :                           usage="HALO_SIZE 17", default_i_val=17)
     848        8392 :       CALL section_add_keyword(section, keyword)
     849        8392 :       CALL keyword_release(keyword)
     850             : 
     851             :       CALL keyword_create(keyword, __LOCATION__, name="N_LOOP", &
     852             :                           description="Number of rs_pw_transfers being timed", &
     853        8392 :                           usage="N_LOOP 100", default_i_val=10)
     854        8392 :       CALL section_add_keyword(section, keyword)
     855        8392 :       CALL keyword_release(keyword)
     856             : 
     857             :       CALL keyword_create(keyword, __LOCATION__, name="RS2PW", &
     858             :                           description="should the direction be rs2pw (pw2rs otherwise)", &
     859        8392 :                           usage="rs2pw TRUE", default_l_val=.TRUE.)
     860        8392 :       CALL section_add_keyword(section, keyword)
     861        8392 :       CALL keyword_release(keyword)
     862             : 
     863        8392 :       NULLIFY (subsection)
     864        8392 :       CALL create_rsgrid_section(subsection)
     865        8392 :       CALL section_add_subsection(section, subsection)
     866        8392 :       CALL section_release(subsection)
     867             : 
     868        8392 :    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        8392 :    SUBROUTINE create_pw_transfer_section(section)
     877             :       TYPE(section_type), POINTER                        :: section
     878             : 
     879             :       TYPE(keyword_type), POINTER                        :: keyword
     880             : 
     881        8392 :       CPASSERT(.NOT. ASSOCIATED(section))
     882             :       CALL section_create(section, __LOCATION__, name="PW_TRANSFER", &
     883             :                           description="Benchmark and test the pw_transfer routines.", &
     884        8392 :                           n_keywords=1, n_subsections=0, repeats=.TRUE.)
     885             : 
     886        8392 :       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        8392 :                           default_i_vals=(/128, 128, 128/))
     891        8392 :       CALL section_add_keyword(section, keyword)
     892        8392 :       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        8392 :                           usage="N_LOOP 100", default_i_val=100)
     897        8392 :       CALL section_add_keyword(section, keyword)
     898        8392 :       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        8392 :                           default_i_val=do_pwgrid_ns_fullspace)
     907        8392 :       CALL section_add_keyword(section, keyword)
     908        8392 :       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        8392 :                           usage="PW_GRID_LAYOUT_ALL", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     913        8392 :       CALL section_add_keyword(section, keyword)
     914        8392 :       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        8392 :                           usage="DEBUG", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
     919        8392 :       CALL section_add_keyword(section, keyword)
     920        8392 :       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        8392 :                           default_i_vals=(/-1, -1/))
     928        8392 :       CALL section_add_keyword(section, keyword)
     929        8392 :       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        8392 :                           default_i_val=do_pw_grid_blocked_false)
     939        8392 :       CALL section_add_keyword(section, keyword)
     940        8392 :       CALL keyword_release(keyword)
     941             : 
     942        8392 :    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        8392 :    SUBROUTINE create_cp_fm_gemm_section(section)
     951             :       TYPE(section_type), POINTER                        :: section
     952             : 
     953             :       TYPE(keyword_type), POINTER                        :: keyword
     954             : 
     955        8392 :       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        8392 :                           n_keywords=1, n_subsections=0, repeats=.TRUE.)
     959             : 
     960        8392 :       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        8392 :                           usage="N_LOOP 10", default_i_val=10)
     964        8392 :       CALL section_add_keyword(section, keyword)
     965        8392 :       CALL keyword_release(keyword)
     966             : 
     967             :       CALL keyword_create(keyword, __LOCATION__, name="K", &
     968             :                           description="Dimension 1 of C", &
     969        8392 :                           usage="A 1024", default_i_val=256)
     970        8392 :       CALL section_add_keyword(section, keyword)
     971        8392 :       CALL keyword_release(keyword)
     972             :       CALL keyword_create(keyword, __LOCATION__, name="M", &
     973             :                           description="Inner dimension M   ", &
     974        8392 :                           usage="A 1024", default_i_val=256)
     975        8392 :       CALL section_add_keyword(section, keyword)
     976        8392 :       CALL keyword_release(keyword)
     977             :       CALL keyword_create(keyword, __LOCATION__, name="N", &
     978             :                           description="Dimension 2 of C", &
     979        8392 :                           usage="A 1024", default_i_val=256)
     980        8392 :       CALL section_add_keyword(section, keyword)
     981        8392 :       CALL keyword_release(keyword)
     982             : 
     983             :       CALL keyword_create(keyword, __LOCATION__, name="NROW_BLOCK", &
     984             :                           description="block_size for rows", &
     985        8392 :                           usage="nrow_block 64", default_i_val=32)
     986        8392 :       CALL section_add_keyword(section, keyword)
     987        8392 :       CALL keyword_release(keyword)
     988             : 
     989             :       CALL keyword_create(keyword, __LOCATION__, name="NCOL_BLOCK", &
     990             :                           description="block_size for cols", &
     991        8392 :                           usage="nrow_block 64", default_i_val=32)
     992        8392 :       CALL section_add_keyword(section, keyword)
     993        8392 :       CALL keyword_release(keyword)
     994             : 
     995             :       CALL keyword_create(keyword, __LOCATION__, name="ROW_MAJOR", &
     996             :                           description="Use a row major blacs grid", &
     997        8392 :                           usage="ROW_MAJOR .FALSE.", default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
     998        8392 :       CALL section_add_keyword(section, keyword)
     999        8392 :       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        8392 :                           usage="FORCE_BLOCKSIZE", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1004        8392 :       CALL section_add_keyword(section, keyword)
    1005        8392 :       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        8392 :                           usage="GRID_2D 64 16 ", default_i_vals=(/1, 1/))
    1012        8392 :       CALL section_add_keyword(section, keyword)
    1013        8392 :       CALL keyword_release(keyword)
    1014             : 
    1015             :       CALL keyword_create(keyword, __LOCATION__, name="TRANSA", &
    1016             :                           description="Transpose matrix A", &
    1017        8392 :                           usage="TRANSA", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1018        8392 :       CALL section_add_keyword(section, keyword)
    1019        8392 :       CALL keyword_release(keyword)
    1020             : 
    1021             :       CALL keyword_create(keyword, __LOCATION__, name="TRANSB", &
    1022             :                           description="Transpose matrix B", &
    1023        8392 :                           usage="TRANSB", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1024        8392 :       CALL section_add_keyword(section, keyword)
    1025        8392 :       CALL keyword_release(keyword)
    1026             : 
    1027        8392 :    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        8392 :    SUBROUTINE create_eigensolver_section(section)
    1036             :       TYPE(section_type), POINTER                        :: section
    1037             : 
    1038             :       TYPE(keyword_type), POINTER                        :: keyword
    1039             : 
    1040        8392 :       CPASSERT(.NOT. ASSOCIATED(section))
    1041             :       CALL section_create(section, __LOCATION__, name="EIGENSOLVER", &
    1042             :                           description="Benchmark and test the eigensolver routines.", &
    1043        8392 :                           n_keywords=1, n_subsections=0, repeats=.TRUE.)
    1044             : 
    1045        8392 :       NULLIFY (keyword)
    1046             :       CALL keyword_create(keyword, __LOCATION__, name="N", &
    1047             :                           description="Dimension of the square matrix", &
    1048        8392 :                           usage="N 1024", default_i_val=256)
    1049        8392 :       CALL section_add_keyword(section, keyword)
    1050        8392 :       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        8392 :                           usage="N_LOOP 10", default_i_val=10)
    1055        8392 :       CALL section_add_keyword(section, keyword)
    1056        8392 :       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        8392 :                           default_i_val=do_diag_syevd)
    1065        8392 :       CALL section_add_keyword(section, keyword)
    1066        8392 :       CALL keyword_release(keyword)
    1067             : 
    1068             :       CALL keyword_create(keyword, __LOCATION__, name="EIGENVALUES", &
    1069             :                           description="number of eigenvalues to be computed (all=<0) ", &
    1070        8392 :                           usage="EIGENVALUES 13", default_i_val=-1)
    1071        8392 :       CALL section_add_keyword(section, keyword)
    1072        8392 :       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        8392 :                           default_i_val=do_mat_random)
    1081        8392 :       CALL section_add_keyword(section, keyword)
    1082        8392 :       CALL keyword_release(keyword)
    1083             : 
    1084        8392 :    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        8392 :    SUBROUTINE create_cp_dbcsr_section(section)
    1093             :       TYPE(section_type), POINTER                        :: section
    1094             : 
    1095             :       TYPE(keyword_type), POINTER                        :: keyword
    1096             : 
    1097        8392 :       CPASSERT(.NOT. ASSOCIATED(section))
    1098             :       CALL section_create(section, __LOCATION__, name="CP_DBCSR", &
    1099             :                           description="Benchmark and test the cp_dbcsr routines", &
    1100        8392 :                           n_keywords=1, n_subsections=0, repeats=.TRUE.)
    1101             : 
    1102        8392 :       NULLIFY (keyword)
    1103             :       CALL keyword_create(keyword, __LOCATION__, name="N_LOOP", &
    1104             :                           description="Number of operations being timed (useful for small matrices).", &
    1105        8392 :                           usage="N_LOOP 10", default_i_val=10)
    1106        8392 :       CALL section_add_keyword(section, keyword)
    1107        8392 :       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        8392 :                           "Complex (Double Precision)"))
    1118        8392 :       CALL section_add_keyword(section, keyword)
    1119        8392 :       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        8392 :                           "Run binary IO checks"))
    1130        8392 :       CALL section_add_keyword(section, keyword)
    1131        8392 :       CALL keyword_release(keyword)
    1132             : 
    1133             :       CALL keyword_create(keyword, __LOCATION__, name="M", &
    1134             :                           description="Dimension 1 of C", &
    1135        8392 :                           usage="A 1024", default_i_val=256)
    1136        8392 :       CALL section_add_keyword(section, keyword)
    1137        8392 :       CALL keyword_release(keyword)
    1138             :       CALL keyword_create(keyword, __LOCATION__, name="N", &
    1139             :                           description="Dimension 2 of C", &
    1140        8392 :                           usage="A 1024", default_i_val=256)
    1141        8392 :       CALL section_add_keyword(section, keyword)
    1142        8392 :       CALL keyword_release(keyword)
    1143             :       CALL keyword_create(keyword, __LOCATION__, name="K", &
    1144             :                           description="Inner dimension M   ", &
    1145        8392 :                           usage="A 1024", default_i_val=256)
    1146        8392 :       CALL section_add_keyword(section, keyword)
    1147        8392 :       CALL keyword_release(keyword)
    1148             : 
    1149             :       CALL keyword_create(keyword, __LOCATION__, name="TRANSA", &
    1150             :                           description="Transpose matrix A", &
    1151        8392 :                           usage="TRANSA", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1152        8392 :       CALL section_add_keyword(section, keyword)
    1153        8392 :       CALL keyword_release(keyword)
    1154             : 
    1155             :       CALL keyword_create(keyword, __LOCATION__, name="TRANSB", &
    1156             :                           description="Transpose matrix B", &
    1157        8392 :                           usage="TRANSB", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1158        8392 :       CALL section_add_keyword(section, keyword)
    1159        8392 :       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        8392 :                           usage="BS_M 1 13 2 5", default_i_vals=(/1, 13, 2, 15/))
    1164        8392 :       CALL section_add_keyword(section, keyword)
    1165        8392 :       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        8392 :                           usage="BS_N 1 13 2 5", default_i_vals=(/1, 13, 2, 15/))
    1170        8392 :       CALL section_add_keyword(section, keyword)
    1171        8392 :       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        8392 :                           usage="BS_K 1 13 2 5", default_i_vals=(/1, 13, 2, 15/))
    1176        8392 :       CALL section_add_keyword(section, keyword)
    1177        8392 :       CALL keyword_release(keyword)
    1178             : 
    1179             :       CALL keyword_create(keyword, __LOCATION__, name="ATYPE", &
    1180             :                           description="Matrix A type", &
    1181        8392 :                           usage="ATYPE N", default_c_val='N')
    1182        8392 :       CALL section_add_keyword(section, keyword)
    1183        8392 :       CALL keyword_release(keyword)
    1184             :       CALL keyword_create(keyword, __LOCATION__, name="BTYPE", &
    1185             :                           description="Matrix B type", &
    1186        8392 :                           usage="BTYPE N", default_c_val='N')
    1187        8392 :       CALL section_add_keyword(section, keyword)
    1188        8392 :       CALL keyword_release(keyword)
    1189             :       CALL keyword_create(keyword, __LOCATION__, name="CTYPE", &
    1190             :                           description="Matrix C type", &
    1191        8392 :                           usage="CTYPE N", default_c_val='N')
    1192        8392 :       CALL section_add_keyword(section, keyword)
    1193        8392 :       CALL keyword_release(keyword)
    1194             : 
    1195             :       CALL keyword_create(keyword, __LOCATION__, name="NPROC", &
    1196             :                           description="Number of processors to test", n_var=-1, &
    1197        8392 :                           usage="NPROC 128 16 1", default_i_vals=(/0/))
    1198        8392 :       CALL section_add_keyword(section, keyword)
    1199        8392 :       CALL keyword_release(keyword)
    1200             : 
    1201             :       CALL keyword_create(keyword, __LOCATION__, name="KEEPSPARSE", &
    1202             :                           description="Keep product sparse", &
    1203        8392 :                           usage="KEEPSPARSE", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1204        8392 :       CALL section_add_keyword(section, keyword)
    1205        8392 :       CALL keyword_release(keyword)
    1206             : 
    1207             :       CALL keyword_create(keyword, __LOCATION__, name="ASPARSITY", &
    1208             :                           description="Sparsity of A matrix", &
    1209        8392 :                           usage="ASPARSITY 70", default_r_val=0.0_dp)
    1210        8392 :       CALL section_add_keyword(section, keyword)
    1211        8392 :       CALL keyword_release(keyword)
    1212             : 
    1213             :       CALL keyword_create(keyword, __LOCATION__, name="BSPARSITY", &
    1214             :                           description="Sparsity of B matrix", &
    1215        8392 :                           usage="ASPARSITY 80", default_r_val=0.0_dp)
    1216        8392 :       CALL section_add_keyword(section, keyword)
    1217        8392 :       CALL keyword_release(keyword)
    1218             : 
    1219             :       CALL keyword_create(keyword, __LOCATION__, name="CSPARSITY", &
    1220             :                           description="Sparsity of C matrix", &
    1221        8392 :                           usage="ASPARSITY 90", default_r_val=0.0_dp)
    1222        8392 :       CALL section_add_keyword(section, keyword)
    1223        8392 :       CALL keyword_release(keyword)
    1224             : 
    1225             :       CALL keyword_create(keyword, __LOCATION__, name="ALPHA", &
    1226             :                           description="Multiplication factor", &
    1227        8392 :                           usage="ALPHA 2.0", default_r_val=1.0_dp)
    1228        8392 :       CALL section_add_keyword(section, keyword)
    1229        8392 :       CALL keyword_release(keyword)
    1230             : 
    1231             :       CALL keyword_create(keyword, __LOCATION__, name="BETA", &
    1232             :                           description="Product premultiplication factor", &
    1233        8392 :                           usage="BETA 1.0", default_r_val=0.0_dp)
    1234        8392 :       CALL section_add_keyword(section, keyword)
    1235        8392 :       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        8392 :                           usage="FILTER_EPS 1.0", default_r_val=-1.0_dp)
    1240        8392 :       CALL section_add_keyword(section, keyword)
    1241        8392 :       CALL keyword_release(keyword)
    1242             : 
    1243             :       CALL keyword_create(keyword, __LOCATION__, name="ALWAYS_CHECKSUM", &
    1244             :                           description="perform a checksum after each multiplication", &
    1245        8392 :                           usage="ALWAYS_CHECKSUM", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1246        8392 :       CALL section_add_keyword(section, keyword)
    1247        8392 :       CALL keyword_release(keyword)
    1248             : 
    1249        8392 :    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        8392 :    SUBROUTINE create_dbm_section(section)
    1257             :       TYPE(section_type), POINTER                        :: section
    1258             : 
    1259             :       TYPE(keyword_type), POINTER                        :: keyword
    1260             : 
    1261        8392 :       CPASSERT(.NOT. ASSOCIATED(section))
    1262             :       CALL section_create(section, __LOCATION__, name="DBM", &
    1263             :                           description="Benchmark and test the dbm routines", &
    1264        8392 :                           n_keywords=1, n_subsections=0, repeats=.TRUE.)
    1265             : 
    1266        8392 :       NULLIFY (keyword)
    1267             :       CALL keyword_create(keyword, __LOCATION__, name="N_LOOP", &
    1268             :                           description="Number of operations being timed (useful for small matrices).", &
    1269        8392 :                           usage="N_LOOP 10", default_i_val=10)
    1270        8392 :       CALL section_add_keyword(section, keyword)
    1271        8392 :       CALL keyword_release(keyword)
    1272             : 
    1273             :       CALL keyword_create(keyword, __LOCATION__, name="M", &
    1274             :                           description="Dimension 1 of C", &
    1275        8392 :                           usage="A 1024", default_i_val=256)
    1276        8392 :       CALL section_add_keyword(section, keyword)
    1277        8392 :       CALL keyword_release(keyword)
    1278             :       CALL keyword_create(keyword, __LOCATION__, name="N", &
    1279             :                           description="Dimension 2 of C", &
    1280        8392 :                           usage="A 1024", default_i_val=256)
    1281        8392 :       CALL section_add_keyword(section, keyword)
    1282        8392 :       CALL keyword_release(keyword)
    1283             :       CALL keyword_create(keyword, __LOCATION__, name="K", &
    1284             :                           description="Inner dimension M   ", &
    1285        8392 :                           usage="A 1024", default_i_val=256)
    1286        8392 :       CALL section_add_keyword(section, keyword)
    1287        8392 :       CALL keyword_release(keyword)
    1288             : 
    1289             :       CALL keyword_create(keyword, __LOCATION__, name="TRANSA", &
    1290             :                           description="Transpose matrix A", &
    1291        8392 :                           usage="TRANSA", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1292        8392 :       CALL section_add_keyword(section, keyword)
    1293        8392 :       CALL keyword_release(keyword)
    1294             : 
    1295             :       CALL keyword_create(keyword, __LOCATION__, name="TRANSB", &
    1296             :                           description="Transpose matrix B", &
    1297        8392 :                           usage="TRANSB", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1298        8392 :       CALL section_add_keyword(section, keyword)
    1299        8392 :       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        8392 :                           usage="BS_M 1 13 2 5", default_i_vals=(/1, 13, 2, 15/))
    1304        8392 :       CALL section_add_keyword(section, keyword)
    1305        8392 :       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        8392 :                           usage="BS_N 1 13 2 5", default_i_vals=(/1, 13, 2, 15/))
    1310        8392 :       CALL section_add_keyword(section, keyword)
    1311        8392 :       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        8392 :                           usage="BS_K 1 13 2 5", default_i_vals=(/1, 13, 2, 15/))
    1316        8392 :       CALL section_add_keyword(section, keyword)
    1317        8392 :       CALL keyword_release(keyword)
    1318             : 
    1319             :       CALL keyword_create(keyword, __LOCATION__, name="KEEPSPARSE", &
    1320             :                           description="Keep product sparse", &
    1321        8392 :                           usage="KEEPSPARSE", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1322        8392 :       CALL section_add_keyword(section, keyword)
    1323        8392 :       CALL keyword_release(keyword)
    1324             : 
    1325             :       CALL keyword_create(keyword, __LOCATION__, name="ASPARSITY", &
    1326             :                           description="Sparsity of A matrix", &
    1327        8392 :                           usage="ASPARSITY 70", default_r_val=0.0_dp)
    1328        8392 :       CALL section_add_keyword(section, keyword)
    1329        8392 :       CALL keyword_release(keyword)
    1330             : 
    1331             :       CALL keyword_create(keyword, __LOCATION__, name="BSPARSITY", &
    1332             :                           description="Sparsity of B matrix", &
    1333        8392 :                           usage="ASPARSITY 80", default_r_val=0.0_dp)
    1334        8392 :       CALL section_add_keyword(section, keyword)
    1335        8392 :       CALL keyword_release(keyword)
    1336             : 
    1337             :       CALL keyword_create(keyword, __LOCATION__, name="CSPARSITY", &
    1338             :                           description="Sparsity of C matrix", &
    1339        8392 :                           usage="ASPARSITY 90", default_r_val=0.0_dp)
    1340        8392 :       CALL section_add_keyword(section, keyword)
    1341        8392 :       CALL keyword_release(keyword)
    1342             : 
    1343             :       CALL keyword_create(keyword, __LOCATION__, name="ALPHA", &
    1344             :                           description="Multiplication factor", &
    1345        8392 :                           usage="ALPHA 2.0", default_r_val=1.0_dp)
    1346        8392 :       CALL section_add_keyword(section, keyword)
    1347        8392 :       CALL keyword_release(keyword)
    1348             : 
    1349             :       CALL keyword_create(keyword, __LOCATION__, name="BETA", &
    1350             :                           description="Product premultiplication factor", &
    1351        8392 :                           usage="BETA 1.0", default_r_val=0.0_dp)
    1352        8392 :       CALL section_add_keyword(section, keyword)
    1353        8392 :       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        8392 :                           usage="FILTER_EPS 1.0", default_r_val=-1.0_dp)
    1358        8392 :       CALL section_add_keyword(section, keyword)
    1359        8392 :       CALL keyword_release(keyword)
    1360             : 
    1361             :       CALL keyword_create(keyword, __LOCATION__, name="ALWAYS_CHECKSUM", &
    1362             :                           description="perform a checksum after each multiplication", &
    1363        8392 :                           usage="ALWAYS_CHECKSUM", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
    1364        8392 :       CALL section_add_keyword(section, keyword)
    1365        8392 :       CALL keyword_release(keyword)
    1366             : 
    1367        8392 :    END SUBROUTINE create_dbm_section
    1368             : END MODULE input_cp2k

Generated by: LCOV version 1.15