Loading...
Searching...
No Matches
Library

Definition

Benchmark library module.

Data Types

type  runner
 Provides properties and instance methods for the execution a benchmarking run. The runner class extends the base class runner_options . More...

Methods

◆ benchmark_a1()

subroutine benchmark_a1 ( class(runner), intent(inout) this,
class(*), intent(in) a1,
procedure() f )
private

Bound procedure to run the benchmark.

Parameters
[in]thisThe type bound to the method
[in]a1Dummy argument
fThe procedure to benchmark

Examples

type(runner) :: br
call br%run('a1')

Remarks

Definition at line 288 of file Benchmark.f90.

◆ benchmark_a2()

subroutine benchmark_a2 ( class(runner), intent(inout) this,
class(*), intent(in) a1,
class(*), intent(in) a2,
procedure() f )
private

Bound procedure to run the benchmark.

Parameters
[in]thisThe type bound to the method
[in]a1Dummy argument
[in]a2Dummy argument
fThe procedure to benchmark

Examples

type(runner) :: br
call br%run('a1', 'a2')

Remarks

Definition at line 325 of file Benchmark.f90.

◆ benchmark_a3()

subroutine benchmark_a3 ( class(runner), intent(inout) this,
class(*), intent(in) a1,
class(*), intent(in) a2,
class(*), intent(in) a3,
procedure() f )
private

Bound procedure to run the benchmark.

Parameters
[in]thisThe type bound to the method
[in]a1Dummy argument
[in]a2Dummy argument
[in]a3Dummy argument
fThe procedure to benchmark

Examples

type(runner) :: br
call br%run('a1', 'a2', 'a3')

Remarks

Definition at line 364 of file Benchmark.f90.

◆ benchmark_a4()

subroutine benchmark_a4 ( class(runner), intent(inout) this,
class(*), intent(in) a1,
class(*), intent(in) a2,
class(*), intent(in) a3,
class(*), intent(in) a4,
procedure() f )
private

Bound procedure to run the benchmark.

Parameters
[in]thisThe type bound to the method
[in]a1Dummy argument
[in]a2Dummy argument
[in]a3Dummy argument
[in]a4Dummy argument
fThe procedure to benchmark

Examples

type(runner) :: br
call br%run('a1', 'a2', 'a3', 'a4')

Remarks

Definition at line 404 of file Benchmark.f90.

◆ benchmark_a5()

subroutine benchmark_a5 ( 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 )
private

Bound procedure to run the benchmark.

Parameters
[in]thisThe type bound to the method
[in]a1Dummy argument
[in]a2Dummy argument
[in]a3Dummy argument
[in]a4Dummy argument
[in]a5Dummy argument
fThe procedure to benchmark

Examples

type(runner) :: br
call br%run('a1', 'a2', 'a3', 'a4', 'a5')

Remarks

Definition at line 446 of file Benchmark.f90.

◆ benchmark_a6()

subroutine benchmark_a6 ( 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 )
private

Bound procedure to run the benchmark.

Parameters
[in]thisThe type bound to the method
[in]a1Dummy argument
[in]a2Dummy argument
[in]a3Dummy argument
[in]a4Dummy argument
[in]a5Dummy argument
[in]a6Dummy argument
fThe procedure to benchmark

Examples

type(runner) :: br
call br%run('a1', 'a2', 'a3', 'a4', 'a5', 'a6')

Remarks

Definition at line 489 of file Benchmark.f90.

◆ benchmark_a7()

subroutine benchmark_a7 ( 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 )
private

Bound procedure to run the benchmark.

Parameters
[in]thisThe type bound to the method
[in]a1Dummy argument
[in]a2Dummy argument
[in]a3Dummy argument
[in]a4Dummy argument
[in]a5Dummy argument
[in]a6Dummy argument
[in]a7Dummy argument
fThe procedure to benchmark

Examples

type(runner) :: br
call br%run('a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7')

Remarks

Definition at line 533 of file Benchmark.f90.

◆ benchmark_read()

subroutine benchmark_read ( class(runner), intent(inout) this,
character(*), intent(in) path )

Read runner options from namelist.

Example

use benchmark_kinds
use benchmark_library
type(runner) :: br
call br2%read('benchmark.nml')

Remarks

Definition at line 122 of file Benchmark.f90.

◆ benchmark_void()

subroutine benchmark_void ( class(runner), intent(inout) this,
procedure() f )
private

Bound procedure to run the benchmark.

Parameters
[in]thisThe type bound to the method
fThe procedure to benchmark

Examples

type(runner) :: br
call br%run()

Remarks

Definition at line 251 of file Benchmark.f90.

◆ benchmark_write()

subroutine benchmark_write ( class(runner), intent(inout) this,
character(*), intent(in) path )
private

Write runner options to namelist.

Example

use benchmark_kinds
use benchmark_library
type(runner) :: br
integer :: lu
br%maxcalls = 10
br%csv_unit = -10
br%mintime = 50_r8
br%maxtime = 100_r8
br%sampling_window = 10
br%ssd_threshold = 0.025_r8
call br%write('benchmark.nml')

The output file is a namelist. It looks as follows

&config
bench%MAXCALLS=10 ,
bench%CSV_UNIT=-10 ,
bench%MINTIME= 50.000000000000000 ,
bench%MAXTIME= 100.00000000000000 ,
bench%SAMPLING_WINDOW=10 ,
bench%SSD_THRESHOLD= 2.5000000000000001e-002,
bench%SKIP_PRELUDE=f,
bench%COUNT=0 ,
bench%NAME=',

Remarks

Definition at line 177 of file Benchmark.f90.

◆ dispose()

subroutine dispose ( class(runner), intent(inout) this)
private

Dispose resources associated with The type bound to the method.

Parameters
[in,out]thisThe type bound to the method

Remarks

Definition at line 676 of file Benchmark.f90.

◆ set_caller()

subroutine set_caller ( class(runner), intent(inout) this,
procedure() caller )
private

Set the function caller to wrap function call.

Parameters
[in]thisThe type bound to the method
callerFunction 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

type(runner) :: br
call br%set_caller(foo)

Where foo is defined as follows.

subroutine foo(f, a)
procedure(foo_x) :: f
type(string), intent(in) :: a
block
character(len(a)) :: res
res = f(a%chars)
end block
end subroutine

With the following interface

interface
pure function foo_x(str) result(res)
character(*), intent(in) :: str
character(len(str)) :: res
end function
end interface

Remarks

Definition at line 230 of file Benchmark.f90.