A Fortran module for benchmarking and performance evaluation for non-coarray codes.
Derived type for each method being benchmarked.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=:), | public, | allocatable | :: | method |
Name of the method being benchmarked |
||
character(len=:), | public, | allocatable | :: | description |
Description of the method being benchmarked |
||
type(timer), | public | :: | time |
Timer object to measure elapsed time |
|||
real(kind=rk), | public | :: | elapsed_time |
Elapsed time for the benchmark |
|||
real(kind=rk), | public | :: | speedup |
Speedup relative to a reference benchmark |
|||
real(kind=rk), | public | :: | flops |
Floating-point operations per second |
procedure, private :: finalize_mark | ../../ Finalize procedure for mark type |
Derived type for benchmarking and performance evaluation.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(mark), | public, | dimension(:), allocatable | :: | marks |
Array of marks to store benchmark data |
||
character(len=:), | public, | allocatable | :: | filename |
Filename for storing benchmark data |
||
integer, | public | :: | nloops |
Number of loops for each benchmark |
|||
integer(kind=ik), | public, | dimension(:), allocatable | :: | argi |
Integer arguments for benchmarks |
||
real(kind=rk), | public, | dimension(:), allocatable | :: | argr |
Real arguments for benchmarks |
||
character(len=:), | public, | allocatable | :: | timer |
Timer object for measuring time |
||
integer, | public | :: | imark |
Index of current benchmark mark |
procedure, public :: init | ../../ Initialize the benchmark object |
procedure, public :: start_benchmark | ../../ Start a benchmark |
procedure, public :: stop_benchmark | ../../ Stop a benchmark |
procedure, private :: write_benchmark | ../../ Write benchmark data to file |
procedure, public :: finalize | ../../ Finalize the benchmark object |
Retrieves the current date and time and returns it as a string
It utilizes the intrinsic date_and_time
function to obtain system time information.
A string containing the current date and time in the format "YYYY.MM.DD - HH:MM:SS".
Character containing the current date and time
Initialize the benchmark object.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(benchmark), | intent(inout) | :: | this |
Benchmark object |
||
integer, | intent(in) | :: | nmarks |
Number of methods to be benchmarked |
||
character(len=*), | intent(in), | optional | :: | title |
Title of the benchmark |
|
character(len=*), | intent(in), | optional | :: | filename |
Filename for storing benchmark data |
|
integer, | intent(in), | optional | :: | nloops |
Number of loops for each benchmark (default: 10) |
|
character(len=*), | intent(in), | optional | :: | timer |
Timer object for measuring time (default: wall). The timer options available are 'wall', 'date_and_time', 'cpu', 'omp', and 'mpi'. |
Start a specific benchmark
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(benchmark), | intent(inout) | :: | this |
Benchmark object |
||
integer, | intent(in) | :: | imark |
Index of the current method |
||
character(len=*), | intent(in) | :: | method |
Name of the method being benchmarked |
||
character(len=*), | intent(in), | optional | :: | description |
Description of the method being benchmarked (optional) |
|
integer(kind=ik), | intent(in), | optional, | dimension(:) | :: | argi |
Integer arguments for the benchmark (optional) |
real(kind=rk), | intent(in), | optional, | dimension(:) | :: | argr |
Real arguments for the benchmark (optional) |
Stops the currently active benchmark, calculates performance metrics, and writes the results to the file and terminal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(benchmark), | intent(inout) | :: | this |
Benchmark object |
||
procedure(Fun), | optional | :: | flops |
Function to calculate Floating Point Operations Per Second (optional) |
Writes the benchmark data to a specified file, including method, speedup, elapsed time, flops, and other details.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(benchmark), | intent(inout) | :: | this |
Benchmark object |
Finalizes the mark object by deallocating allocated memory for method and description.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mark), | intent(inout) | :: | this |
Mark object to be finalized |
Finalizes the benchmark object by deallocating memory and performs necessary cleanup.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(benchmark), | intent(inout) | :: | this |
Benchmark object to be finalized |