Octopus
test_parameters.F90
Go to the documentation of this file.
1!! Copyright (C) 2024 A. Buccheri
2!!
3!! This program is free software; you can redistribute it and/or modify
4!! it under the terms of the GNU General Public License as published by
5!! the Free Software Foundation; either version 2, or (at your option)
6!! any later version.
7!!
8!! This program is distributed in the hope that it will be useful,
9!! but WITHOUT ANY WARRANTY; without even the implied warranty of
10!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11!! GNU General Public License for more details.
12!!
13!! You should have received a copy of the GNU General Public License
14!! along with this program; if not, write to the Free Software
15!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16!! 02110-1301, USA.
17!!
18
19#include "global.h"
20
21! Note, mk_varinfo.pl required modification to check for variable documentation
22! outside of src/
24 use debug_oct_m
25 use global_oct_m
28 use parser_oct_m
29
30
31 implicit none
32 private
33 public :: test_parameters_t
34
36 integer :: type
37 integer :: repetitions
38 integer :: min_blocksize
39 integer :: max_blocksize
40 contains
41 procedure :: init_from_file => test_parameters_init_from_file
42 end type test_parameters_t
43
44contains
45
47 subroutine test_parameters_init_from_file(this, namespace)
48 class(test_parameters_t), intent(out) :: this
49 type(namespace_t), intent(in ) :: namespace
50
52
53 call messages_obsolete_variable(namespace, 'TestDerivatives', 'TestType')
54 call messages_obsolete_variable(namespace, 'TestOrthogonalization', 'TestType')
55
56 !%Variable TestType
57 !%Type integer
58 !%Default all
59 !%Section Calculation Modes::Test
60 !%Description
61 !% Decides on what type of values the test should be performed.
62 !%Option real 1
63 !% Test for double-precision real functions.
64 !%Option complex 2
65 !%Option all 3
66 !% Tests for double-precision real and complex functions.
67 !%End
68 call parse_variable(namespace, 'TestType', option__testtype__all, this%type)
69 if (this%type < 1 .or. this%type > 5) then
70 message(1) = "Invalid option for TestType."
71 call messages_fatal(1, only_root_writes = .true., namespace=namespace)
72 end if
73
74 !%Variable TestRepetitions
75 !%Type integer
76 !%Default 1
77 !%Section Calculation Modes::Test
78 !%Description
79 !% This variable controls the behavior of oct-test for performance
80 !% benchmarking purposes. It sets the number of times the
81 !% computational kernel of a test will be executed, in order to
82 !% provide more accurate timings.
83 !%
84 !% Currently this variable is used by the <tt>hartree_test</tt>,
85 !% <tt>derivatives</tt>, and <tt>projector</tt> tests.
86 !%End
87 call parse_variable(namespace, 'TestRepetitions', 1, this%repetitions)
88
89 !%Variable TestMinBlockSize
90 !%Type integer
91 !%Default 1
92 !%Section Calculation Modes::Test
93 !%Description
94 !% Some tests can work with multiple blocksizes, in this case of
95 !% range of blocksizes will be tested. This variable sets the lower
96 !% bound of that range.
97 !%
98 !% Currently this variable is only used by the derivatives test.
99 !%End
100 call parse_variable(namespace, 'TestMinBlockSize', 1, this%min_blocksize)
101
102 !%Variable TestMaxBlockSize
103 !%Type integer
104 !%Default 128
105 !%Section Calculation Modes::Test
106 !%Description
107 !% Some tests can work with multiple blocksizes, in this case of
108 !% range of blocksizes will be tested. This variable sets the lower
109 !% bound of that range.
110 !%
111 !% Currently this variable is only used by the derivatives test.
112 !%End
113 call parse_variable(namespace, 'TestMaxBlockSize', 128, this%max_blocksize)
114
117 end subroutine test_parameters_init_from_file
118
119end module test_parameters_oct_m
120
121!! Local Variables:
122!! mode: f90
123!! coding: utf-8
124!! End:
subroutine, public messages_obsolete_variable(namespace, name, rep)
Definition: messages.F90:1045
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
Definition: messages.F90:160
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
Definition: messages.F90:414
subroutine test_parameters_init_from_file(this, namespace)
Initialise a test parameters instance from an inp file.
int true(void)