|
procedure(exec_proc), pointer, nopass | overhead => null() |
| Procedure Pointer to the (user-provided) overhead wrapper with explicit interface exec_proc. The overhead wrapper is used to measure the overhead of the exec wrapper component besides the cost of calling the wrapped procedure with the exec wrapper component. More...
|
|
real(RKD) | minsec = 0.05_RKD |
| The minimum time in units of seconds that the benchmark should last. It could take longer, but not less than minsec . More...
|
|
integer(IK) | miniter = 1_IK |
| The minimum number of timing of the user-specified wrapper procedure. It could run more, but not fewer than miniter . More...
|
|
type(timing_type) | timing |
| The object of type timing_type containing the timing information and statistics of the benchmark. More...
|
|
character(:, SK), allocatable | name |
| The name of the procedure to be timed. More...
|
|
class(timer_type), allocatable | timer |
| The allocatable component of abstract class timer_type used for internal timing.
Public access to this component provided is provided solely for the convenience of the user when access to a timer is needed.
Otherwise, it not meant to be directly accessed or manipulated.
The concrete type of this class component is set by the user at runtime depending on their choice of timer.
More...
|
|
This is the class for creating benchmark and performance-profiling objects.
This type has two public
methods both of which accomplish the same task of timing the user-specified procedure wrapper.
However, one (getTiming) has a function
interface where the output of the method can be clearly specified, while the other (setTiming) has a subroutine
interface where the output of the timing is implicitly assigned to the timing
component of the parent object of type bench_type
.
The former has an explicit clear calling syntax.
The latter has a more concise syntax with potentially faster runtime performance (which is likely irrelevant in almost all practical scenarios).
See also the constructor of this type.
Possible calling interfaces ⛓
type(bench_type) :: bench
character(:, SK) :: name
integer(IK) :: miniter
real(RKD) :: minsec
benchBase
= bench_type(name, exec, overhead
= overhead, minsec
= minsec, miniter
= miniter, timer
= timerCPU_type())
benchBase
= bench_type(name, exec, overhead
= overhead, minsec
= minsec, miniter
= miniter, timer
= timerDAT_type())
benchBase
= bench_type(name, exec, overhead
= overhead, minsec
= minsec, miniter
= miniter, timer
= timerMPI_type())
benchBase
= bench_type(name, exec, overhead
= overhead, minsec
= minsec, miniter
= miniter, timer
= timerOMP_type())
benchBase
= bench_type(name, exec, overhead
= overhead, minsec
= minsec, miniter
= miniter, timer
= timerSYS_type())
This module contains abstract interfaces and types that facilitate benchmarking of different procedur...
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
integer, parameter RKD
The double precision real kind in Fortran mode. On most platforms, this is an 64-bit real kind.
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
This module contains the timer procedures and derived types to facilitate timing applications at runt...
This is the base class for creating low-level benchmark objects.
This is the class for creating benchmark and performance-profiling objects.
This is the timerCPU_type class, containing attributes and static methods for setting up a timer base...
This is the timerDAT_type class, containing attributes and static methods for setting up a timer base...
This is the timerMPI_type class, containing attributes and static methods for setting up a timer base...
This is the timerMPI_type class, containing attributes and static methods for setting up a timer base...
This is the timerSYS_type class, containing attributes and static methods for setting up a timer base...
- See also
- benchMulti_type
benchBase_type
timing_type
bench_type
timer_type
timerDAT_type
timerMPI_type
timerOMP_type
timerSYS_type
Example usage ⛓
12 type(bench_type) :: bench
14 real(RKD) :: unifsum
= 0._RKD
16 type(display_type) :: disp
20 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
21 call disp%show(
"!Benchmark the uniform random number generation.")
22 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
26 call disp%show(
"subroutine wrapper(); call random_number(unifrnd); unifsum = unifsum + unifrnd; end")
27 call disp%show(
"bench = bench_type(name = SK_'random_number', exec = wrapper)")
28 bench
= bench_type(name
= SK_
'random_number', exec
= wrapper)
29 call disp%show(
"bench%timing = bench%getTiming() ! same as below")
35 call disp%show(
"call bench%setTiming(minsec = 0.1_RKD) ! same as above but with a non-default minimum overall repetitive timing for 0.1 seconds.")
44 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
45 call disp%show(
"!Benchmark the uniform random number generation while excluding the overhead of redundant operations.")
46 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
50 call disp%show(
"subroutine wrapper(); call random_number(unifrnd); unifsum = unifsum + unifrnd; end")
51 call disp%show(
"subroutine overhead(); unifsum = unifsum + unifrnd; end")
52 call disp%show(
"bench = bench_type(name = SK_'random_number', exec = wrapper, overhead = overhead)")
53 bench
= bench_type(name
= SK_
'random_number', exec
= wrapper, overhead
= overhead)
54 call disp%show(
"bench%timing = bench%getTiming() ! same as below")
65 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
66 call disp%show(
"!Benchmark the uniform random number generation while excluding the overhead of redundant operations using a non-default CPU timer.")
67 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
71 call disp%show(
"subroutine wrapper(); call random_number(unifrnd); unifsum = unifsum + unifrnd; end")
72 call disp%show(
"subroutine overhead(); unifsum = unifsum + unifrnd; end")
73 call disp%show(
"bench = bench_type(name = SK_'random_number', exec = wrapper, overhead = overhead, timer = timerCPU_type())")
75 call disp%show(
"bench%timing = bench%getTiming() ! same as below")
86 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
87 call disp%show(
"!Benchmark the uniform random number generation while excluding the overhead of redundant operations using a non-default date_and_time() timer.")
88 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
92 call disp%show(
"subroutine wrapper(); call random_number(unifrnd); unifsum = unifsum + unifrnd; end")
93 call disp%show(
"subroutine overhead(); unifsum = unifsum + unifrnd; end")
94 call disp%show(
"bench = bench_type(name = SK_'random_number', exec = wrapper, overhead = overhead, timer = timerDAT_type())")
96 call disp%show(
"bench%timing = bench%getTiming() ! same as below")
108 impure subroutine showTimerComponents()
110 call disp%show( bench
%name , deliml
= SK_
"""" )
118 call random_number(unifrnd)
119 unifsum
= unifsum
+ unifrnd
122 subroutine overhead()
123 unifsum
= unifsum
+ unifrnd
Generate and return an object of type timing_type containing the benchmark timing information and sta...
Time the user-specified procedure wrapper in the parent object of type bench_type and store the outpu...
This is a generic method of the derived type display_type with pass attribute.
This is a generic method of the derived type display_type with pass attribute.
This module contains classes and procedures for input/output (IO) or generic display operations on st...
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
Generate and return an object of type display_type.
Example Unix compile command via Intel ifort
compiler ⛓
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example Windows Batch compile command via Intel ifort
compiler ⛓
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
Example Unix / MinGW compile command via GNU gfortran
compiler ⛓
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example output ⛓
7subroutine wrapper(); call random_number(unifrnd); unifsum
= unifsum
+ unifrnd; end
8bench
= bench_type(name
= SK_
'random_number', exec
= wrapper)
11+0.22604502138542149E-6
13+0.68037835551224595E-6
16+0.20747135432595663E-6
18+0.43650225530541366E-6
26subroutine wrapper(); call random_number(unifrnd); unifsum
= unifsum
+ unifrnd; end
27subroutine overhead(); unifsum
= unifsum
+ unifrnd; end
28bench
= bench_type(name
= SK_
'random_number', exec
= wrapper, overhead
= overhead)
31+0.92292511819425713E-7
33+0.40737882127251760E-6
35+0.10000000000000001E-8
43subroutine wrapper(); call random_number(unifrnd); unifsum
= unifsum
+ unifrnd; end
44subroutine overhead(); unifsum
= unifsum
+ unifrnd; end
48+0.10000000000287557E-5
50+0.10000000000287557E-5
52+0.10000000000287557E-5
60subroutine wrapper(); call random_number(unifrnd); unifsum
= unifsum
+ unifrnd; end
61subroutine overhead(); unifsum
= unifsum
+ unifrnd; end
65+0.10000000000000007E-2
67+0.10000000000000000E-2
69+0.10000000000000000E-2
- Test:
- test_pm_bench
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
-
If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
-
If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
- Copyright
- Computational Data Science Lab
- Author:
- Amir Shahmoradi, Wednesday 4:13 AM, August 13, 2016, Institute for Computational Engineering and Sciences (ICES), The University of Texas Austin
Definition at line 386 of file pm_bench.F90.