This is the class for creating object to perform multiple benchmarks and performance-profiling.
More...
This is the class for creating object to perform multiple benchmarks and performance-profiling.
This type facilitates comparison of performances of multiple user-specified procedure wrappers by reducing the amount of code to be written and automating and randomizing the timing schemes.
See also benchMulti_typer, the type constructor.
Possible calling interfaces ⛓
type(benchMulti_type) :: self(:)
type(bench_type), allocatable :: case(:)
self = benchMulti_type(case(:))
- See also
- benchMulti_typer
showsum
bench_type
timer_type
timerDAT_type
timerMPI_type
timerOMP_type
timerSYS_type
Example usage ⛓
3 use iso_fortran_env,
only:
error_unit
11 type(benchMulti_type) :: benchMulti
12 real(RKS) :: unifrnd_RKS
13 real(RKS) :: unifsum_RKS
= 0._RKS
14 real(RKD) :: unifrnd_RKD
15 real(RKD) :: unifsum_RKD
= 0._RKD
16 real(RKQ) :: unifrnd_RKQ
17 real(RKQ) :: unifsum_RKQ
= 0._RKQ
19 type(display_type) :: disp
23 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
24 call disp%show(
"!Benchmark the runtime cost of single, double, and quad precision exponentiaion.")
25 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
29 call disp%show(
"benchMulti = benchMulti_type([bench_type(SK_'rng_single', procwrap_RKS, overhead_RKS), bench_type(SK_'rng_double', procwrap_RKD, overhead_RKD), bench_type(SK_'rng_quadro', procwrap_RKQ, overhead_RKQ)])")
32 call disp%show(
"call benchMulti%showsum(unit = disp%unit, tabular = .true._LK) ! Display the results in a nice tabular format.")
33 call benchMulti
%showsum(
unit = disp%unit, tabular
= .true._LK)
34 call disp%show(
"call benchMulti%showsum(unit = disp%unit, tabular = .false._LK) ! Display the results in the default CSV format.")
35 call benchMulti
%showsum(
unit = disp%unit, tabular
= .false._LK)
40 write(
error_unit,
*) unifsum_RKS
+ unifsum_RKD
+ unifsum_RKQ
44 subroutine overhead_RKS(); call random_number(unifrnd_RKS); unifsum_RKS
= unifsum_RKS
+ unifrnd_RKS; end
45 subroutine overhead_RKD(); call random_number(unifrnd_RKD); unifsum_RKD
= unifsum_RKD
+ unifrnd_RKD; end
46 subroutine overhead_RKQ(); call random_number(unifrnd_RKQ); unifsum_RKQ
= unifsum_RKQ
+ unifrnd_RKQ; end
47 subroutine procwrap_RKS(); call random_number(unifrnd_RKS); unifsum_RKS
= unifsum_RKS
+ 2._RKS**unifrnd_RKS; end
48 subroutine procwrap_RKD(); call random_number(unifrnd_RKD); unifsum_RKD
= unifsum_RKD
+ 2._RKD**unifrnd_RKD; end
49 subroutine procwrap_RKQ(); call random_number(unifrnd_RKQ); unifsum_RKQ
= unifsum_RKQ
+ 2._RKQ**unifrnd_RKQ; end
Time the user-specified procedure wrappers in the case vector component of the parent object of type ...
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 abstract interfaces and types that facilitate benchmarking of different procedur...
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.
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
integer, parameter RKQ
The quadru-precision real kind in Fortran mode. On most platforms, this is an 128-bit real kind.
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...
integer, parameter RKS
The single-precision real kind in Fortran mode. On most platforms, this is an 32-bit real kind.
This is the class for creating object to perform multiple benchmarks and performance-profiling.
This is the class for creating benchmark and performance-profiling objects.
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 ⛓
8call benchMulti
%showsum(
unit = disp%unit, tabular
= .true._LK)
10 benchmark | avg runtime [s] | std runtime [s]
11---------- |
--------------- |
---------------
12rng_single |
0.854479872E-08 |
0.542901301E-07
13rng_single |
0.879775149E-08 |
0.579796298E-07
14rng_double |
0.172906932E-07 |
0.340737213E-07
15rng_double |
0.178083248E-07 |
0.537361665E-07
16rng_quadro |
0.114816465E-05 |
0.600950518E-06
17rng_quadro |
0.118718101E-05 |
0.204671955E-06
19call benchMulti
%showsum(
unit = disp%unit, tabular
= .false._LK)
20benchmark,avg runtime [s],std runtime [s]
21rng_single,
0.854479872E-8,
0.542901301E-7
22rng_single,
0.879775149E-8,
0.579796298E-7
23rng_double,
0.172906932E-7,
0.340737213E-7
24rng_double,
0.178083248E-7,
0.537361665E-7
25rng_quadro,
0.114816465E-5,
0.600950518E-6
26rng_quadro,
0.118718101E-5,
0.204671955E-6
- 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 at Austin
Definition at line 735 of file pm_bench.F90.