Inherits runner_options.
Provides properties and instance methods for the execution a benchmarking run. The runner class extends the base class runner_options .
The following examples demonstrate some of the main members of the runner.
The first example shows a simple benchmark of the methods foo
and bar
passing two Dummy arguments. This example make use of the preprocessing macros found in the include file benchmark.inc
.
The second example demonstrates how the benchmarking options can be serialized to disk and loaded for later use. The options are saved as namelist on disk.
The third example demonstrate how functions can be passed using the iso_c_binbing
module. The address of the procedure is first obtained using c_funloc
and then casted into an implicit procedure using c_f_procpointer
.
benchmark.inc
. procedure()
. This means that benchmarking only works for subroutine
s with gfortran. PROCEDURE() with no type or interface name is supposed to work as a dummy procedure or procedure pointer that can handle either a function or a subroutine, so long as it isn't referenced. Many compilers assume that it means a subroutine, or just can't deal with it. (more info) Definition at line 55 of file Benchmark.f90.
Variables | |
type(output), public | unit |
Output unit. By default the standard output is used. | |
integer, public | maxcalls = 100000000 |
Maximum number of function calls. | |
integer, public | csv_unit = 0 |
Integer designating the logical output unit for csv results. Null value corresponds to unset value. | |
real(r8), public | mintime = 100.0_r8 |
Minimum sampling time in ms to collect data. | |
real(r8), public | maxtime = 100000.0_r8 |
Maximum sampling time in ms to collect data. | |
real(r8), public | overhead = 0.0_r8 |
Time overhead corresponding to the surounding methods calls. | |
integer, public | sampling_window = 20 |
Integer option to adjust the size of the sampling window. | |
real(r8), public | ssd_threshold = 0.05_r8 |
Acceptance threshold for the steady-state detection. | |
logical, public | skip_prelude = .false. |
Logical flag. If set to .true., only the benchmarking step will be performed. | |
character(200), public | name = '' |
String name. | |
Static Public Attributes | |
procedure(), pointer, nopass | caller => null() |
Caller wrapper procedure. | |
procedure, pass, public dispose | ( | class(runner), intent(inout) | this | ) |
Dispose resources associated with The type bound to the method.
[in,out] | this | The type bound to the method |
Remarks
Definition at line 99 of file Benchmark.f90.
procedure, pass, public read | ( | class(runner), intent(inout) | this, |
character(*), intent(in) | path ) |
Read runner options from namelist.
Example
Remarks
Definition at line 98 of file Benchmark.f90.
generic, public run | ( | class(runner), intent(inout) | this, |
class(*), intent(in) | a1, | ||
class(*), intent(in) | a2, | ||
class(*), intent(in) | a3, | ||
class(*), intent(in) | a4, | ||
class(*), intent(in) | a5, | ||
class(*), intent(in) | a6, | ||
class(*), intent(in) | a7, | ||
procedure() | f ) |
Bound procedure to run the benchmark.
[in] | this | The type bound to the method |
[in] | a1 | Dummy argument |
[in] | a2 | Dummy argument |
[in] | a3 | Dummy argument |
[in] | a4 | Dummy argument |
[in] | a5 | Dummy argument |
[in] | a6 | Dummy argument |
[in] | a7 | Dummy argument |
f | The procedure to benchmark |
Examples
Remarks
Definition at line 89 of file Benchmark.f90.
generic, public run | ( | class(runner), intent(inout) | this, |
class(*), intent(in) | a1, | ||
class(*), intent(in) | a2, | ||
class(*), intent(in) | a3, | ||
class(*), intent(in) | a4, | ||
class(*), intent(in) | a5, | ||
class(*), intent(in) | a6, | ||
procedure() | f ) |
Bound procedure to run the benchmark.
[in] | this | The type bound to the method |
[in] | a1 | Dummy argument |
[in] | a2 | Dummy argument |
[in] | a3 | Dummy argument |
[in] | a4 | Dummy argument |
[in] | a5 | Dummy argument |
[in] | a6 | Dummy argument |
f | The procedure to benchmark |
Examples
Remarks
Definition at line 89 of file Benchmark.f90.
generic, public run | ( | class(runner), intent(inout) | this, |
class(*), intent(in) | a1, | ||
class(*), intent(in) | a2, | ||
class(*), intent(in) | a3, | ||
class(*), intent(in) | a4, | ||
class(*), intent(in) | a5, | ||
procedure() | f ) |
Bound procedure to run the benchmark.
[in] | this | The type bound to the method |
[in] | a1 | Dummy argument |
[in] | a2 | Dummy argument |
[in] | a3 | Dummy argument |
[in] | a4 | Dummy argument |
[in] | a5 | Dummy argument |
f | The procedure to benchmark |
Examples
Remarks
Definition at line 89 of file Benchmark.f90.
generic, public run | ( | class(runner), intent(inout) | this, |
class(*), intent(in) | a1, | ||
class(*), intent(in) | a2, | ||
class(*), intent(in) | a3, | ||
class(*), intent(in) | a4, | ||
procedure() | f ) |
Bound procedure to run the benchmark.
[in] | this | The type bound to the method |
[in] | a1 | Dummy argument |
[in] | a2 | Dummy argument |
[in] | a3 | Dummy argument |
[in] | a4 | Dummy argument |
f | The procedure to benchmark |
Examples
Remarks
Definition at line 89 of file Benchmark.f90.
generic, public run | ( | class(runner), intent(inout) | this, |
class(*), intent(in) | a1, | ||
class(*), intent(in) | a2, | ||
class(*), intent(in) | a3, | ||
procedure() | f ) |
Bound procedure to run the benchmark.
[in] | this | The type bound to the method |
[in] | a1 | Dummy argument |
[in] | a2 | Dummy argument |
[in] | a3 | Dummy argument |
f | The procedure to benchmark |
Examples
Remarks
Definition at line 89 of file Benchmark.f90.
generic, public run | ( | class(runner), intent(inout) | this, |
class(*), intent(in) | a1, | ||
class(*), intent(in) | a2, | ||
procedure() | f ) |
Bound procedure to run the benchmark.
[in] | this | The type bound to the method |
[in] | a1 | Dummy argument |
[in] | a2 | Dummy argument |
f | The procedure to benchmark |
Examples
Remarks
Definition at line 89 of file Benchmark.f90.
generic, public run | ( | class(runner), intent(inout) | this, |
class(*), intent(in) | a1, | ||
procedure() | f ) |
Bound procedure to run the benchmark.
[in] | this | The type bound to the method |
[in] | a1 | Dummy argument |
f | The procedure to benchmark |
Examples
Remarks
Definition at line 89 of file Benchmark.f90.
generic, public run | ( | class(runner), intent(inout) | this, |
procedure() | f ) |
Bound procedure to run the benchmark.
[in] | this | The type bound to the method |
f | The procedure to benchmark |
Examples
Remarks
Definition at line 89 of file Benchmark.f90.
procedure, pass, public set_caller | ( | class(runner), intent(inout) | this, |
procedure() | caller ) |
Set the function caller to wrap function call.
[in] | this | The type bound to the method |
caller | Function wrapper |
Examples The following example demonstrate how to use the caller
wrapper. By doing so, one can enforce a specific interface to the procedure argument. This is especially handy when benchmarking functions or requiring inout
and out
intents
Where foo
is defined as follows.
With the following interface
Remarks
Definition at line 80 of file Benchmark.f90.
procedure, pass, public write | ( | class(runner), intent(inout) | this, |
character(*), intent(in) | path ) |
Write runner options to namelist.
Example
The output file is a namelist. It looks as follows
Remarks
Definition at line 97 of file Benchmark.f90.
|
final |
Definition at line 100 of file Benchmark.f90.