(git:ccc2433)
input_cp2k_rsgrid.F
Go to the documentation of this file.
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 !> \par History
10 !> 01.2008 Created
11 !> \author Joost
12 ! **************************************************************************************************
14 
17  keyword_type
20  section_type
21  USE kinds, ONLY: dp
25  USE string_utilities, ONLY: s2a
26 #include "./base/base_uses.f90"
27 
28  IMPLICIT NONE
29  PRIVATE
30 
31  CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_rsgrid'
32 
33  PUBLIC :: create_rsgrid_section
34 
35 !***
36 CONTAINS
37 
38 ! **************************************************************************************************
39 !> \brief ...
40 !> \param section ...
41 !> \author Joost
42 ! **************************************************************************************************
43  SUBROUTINE create_rsgrid_section(section)
44  TYPE(section_type), POINTER :: section
45 
46  TYPE(keyword_type), POINTER :: keyword
47 
48  cpassert(.NOT. ASSOCIATED(section))
49  CALL section_create(section, __location__, name="RS_GRID", &
50  description="Set options that influence how the realspace grids are being distributed in parallel runs.", &
51  n_keywords=5, n_subsections=0, repeats=.true.)
52 
53  NULLIFY (keyword)
54  CALL keyword_create(keyword, __location__, name="DISTRIBUTION_TYPE", &
55  description="Parallelization strategy.", &
56  usage="DISTRIBUTION_TYPE DISTRIBUTED", &
57  enum_c_vals=s2a("AUTOMATIC", "DISTRIBUTED", "REPLICATED"), &
59  enum_desc=s2a("Use heuristic rules to decide between distributed and replicated", &
60  "Force a distributed setup if possible", &
61  "Force a replicated setup"), &
62  default_i_val=rsgrid_automatic)
63  CALL section_add_keyword(section, keyword)
64  CALL keyword_release(keyword)
65 
66  CALL keyword_create(keyword, __location__, name="DISTRIBUTION_LAYOUT", &
67  description="Specifies the number of slices in the x, y and z directions. "// &
68  "-1 specifies that any number of slices is OK. "// &
69  "If a given distribution can not be satisfied, a replicated grid will result. "// &
70  "Also see LOCK_DISTRIBUTION.", &
71  usage="DISTRIBUTION_LAYOUT", &
72  repeats=.false., n_var=3, &
73  default_i_vals=(/-1, -1, -1/))
74  CALL section_add_keyword(section, keyword)
75  CALL keyword_release(keyword)
76 
77  CALL keyword_create(keyword, __location__, name="MAX_DISTRIBUTED_LEVEL", &
78  description="If the multigrid-level of a grid is larger than the parameter,"// &
79  " it will not be distributed in the automatic scheme.", &
80  usage="MAX_DISTRIBUTED_LEVEL 1", &
81  default_i_val=2)
82  CALL section_add_keyword(section, keyword)
83  CALL keyword_release(keyword)
84 
85  CALL keyword_create(keyword, __location__, name="LOCK_DISTRIBUTION", &
86  description="Expert use only, only basic QS deals correctly with a non-default value. "// &
87  "If the distribution is locked, a grid will have the same distribution as "// &
88  "the next finer multigrid (provided it is distributed). "// &
89  "If unlocked, all grids can be distributed freely.", &
90  usage="LOCK_DISTRIBUTION TRUE", &
91  default_l_val=.true.)
92  CALL section_add_keyword(section, keyword)
93  CALL keyword_release(keyword)
94 
95  CALL keyword_create(keyword, __location__, name="MEMORY_FACTOR", &
96  description="A grid will only be distributed if the memory usage for that grid (including halo) "// &
97  "is smaller than a replicated grid by this parameter.", &
98  usage="MEMORY_FACTOR 4.0", &
99  default_r_val=2.0_dp)
100  CALL section_add_keyword(section, keyword)
101  CALL keyword_release(keyword)
102 
103  CALL keyword_create(keyword, __location__, name="HALO_REDUCTION_FACTOR", &
104  description="Can be used to reduce the halo of the distributed grid (experimental features).", &
105  usage="HALO_REDUCTION_FACTOR 0.5", &
106  default_r_val=1.0_dp)
107  CALL section_add_keyword(section, keyword)
108  CALL keyword_release(keyword)
109  END SUBROUTINE create_rsgrid_section
110 
111 END MODULE input_cp2k_rsgrid
subroutine, public create_rsgrid_section(section)
...
represents keywords in an input
subroutine, public keyword_release(keyword)
releases the given keyword (see doc/ReferenceCounting.html)
subroutine, public keyword_create(keyword, location, name, description, usage, type_of_var, n_var, repeats, variants, default_val, default_l_val, default_r_val, default_lc_val, default_c_val, default_i_val, default_l_vals, default_r_vals, default_c_vals, default_i_vals, lone_keyword_val, lone_keyword_l_val, lone_keyword_r_val, lone_keyword_c_val, lone_keyword_i_val, lone_keyword_l_vals, lone_keyword_r_vals, lone_keyword_c_vals, lone_keyword_i_vals, enum_c_vals, enum_i_vals, enum, enum_strict, enum_desc, unit_str, citations, deprecation_notice, removed)
creates a keyword object
objects that represent the structure of input sections and the data contained in an input section
subroutine, public section_create(section, location, name, description, n_keywords, n_subsections, repeats, citations)
creates a list of keywords
subroutine, public section_add_keyword(section, keyword)
adds a keyword to the given section
Defines the basic variable types.
Definition: kinds.F:23
integer, parameter, public dp
Definition: kinds.F:34
integer, parameter, public rsgrid_replicated
integer, parameter, public rsgrid_automatic
integer, parameter, public rsgrid_distributed
Utilities for string manipulations.