forbenchmark_coarray Module

A Fortran module for benchmarking and performance evaluation for coarray codes.


Uses

    • kinds
    • fortime
  • module~~forbenchmark_coarray~~UsesGraph module~forbenchmark_coarray forbenchmark_coarray fortime fortime module~forbenchmark_coarray->fortime kinds kinds module~forbenchmark_coarray->kinds

Used by

  • module~~forbenchmark_coarray~~UsedByGraph module~forbenchmark_coarray forbenchmark_coarray module~forbenchmark forbenchmark module~forbenchmark->module~forbenchmark_coarray program~demo demo program~demo->module~forbenchmark

Derived Types

type, private ::  mark_co

Derived type for each method being benchmarked in each image.

Components

Type Visibility Attributes Name Initial
type(timer), public :: time

Timer object to measure elapsed time in each image

real(kind=rk), public :: elapsed_time

Elapsed time for the benchmark in each image

real(kind=rk), public :: flops

Floating-point operations per second in each image

type, private ::  mark

Derived type for each method being benchmarked in all images.

Components

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

real(kind=rk), public :: elapsed_time_min

Minimum elapsed time for the benchmark in all images

real(kind=rk), public :: elapsed_time_average

Average elapsed time for the benchmark in all images

real(kind=rk), public :: elapsed_time_max

Maximum elapsed time for the benchmark in all images

real(kind=rk), public :: flops_total

Total floating-point operations per second in all images

real(kind=rk), public :: speedup_max_total

Maximum speedup in all images compared to the reference benchmark

Type-Bound Procedures

procedure, private :: finalize_mark ../../

Finalize procedure for mark type

type, public ::  benchmark

Derived type for benchmarking and performance evaluation.

Components

Type Visibility Attributes Name Initial
type(mark_co), public, dimension(:), allocatable :: marks_co[:]

Array of mark_co type for each method being benchmarked in each image

type(mark), public, dimension(:), allocatable :: marks

Array of mark type for each method being benchmarked in all images

character(len=:), public, allocatable :: filename

Filename for storing the benchmark data in all images

character(len=:), public, allocatable :: filename_image

Filename for storing the benchmark data in each image

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 the current benchmark

Type-Bound Procedures

procedure, public :: init ../../

Initialization 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


Functions

private impure function current_date_and_time() result(datetime)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause License

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".

Arguments

None

Return Value character(len=21)

Character containing the current date and time


Subroutines

private impure elemental subroutine init(this, nmarks, title, filename, nloops, timer)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause License

Initialize the benchmark object.

Arguments

Type IntentOptional Attributes Name
class(benchmark), intent(inout) :: this

Benchmark object

integer, intent(in) :: nmarks

Number of methods being benchmarked

character(len=*), intent(in), optional :: title

Title of the benchmark

character(len=*), intent(in), optional :: filename

Filename for storing the 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)

private impure subroutine start_benchmark(this, imark, method, description, argi, argr)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause License

Start a specific benchmark.

Arguments

Type IntentOptional 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 benchmarks (optional)

real(kind=rk), intent(in), optional, dimension(:) :: argr

Real arguments for benchmarks (optional)

private impure subroutine stop_benchmark(this, flops)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause License

Stops the currently active benchmark, calculates performance metrics, and writes the results to the file and terminal.

Arguments

Type IntentOptional Attributes Name
class(benchmark), intent(inout) :: this

Benchmark object

procedure(Fun), optional :: flops

Function to calculate Floating Point Operations Per Second (optional)

private impure subroutine write_benchmark(this)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause License

Writes the benchmark data to a specified file, including method, speedup, elapsed time, flops, and other details.

Arguments

Type IntentOptional Attributes Name
class(benchmark), intent(inout) :: this

Benchmark object

private pure elemental subroutine finalize_mark(this)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause License

Finalizes the mark object by deallocating allocated memory for method and description.

Arguments

Type IntentOptional Attributes Name
class(mark), intent(inout) :: this

Mark object to be finalized

private impure elemental subroutine finalize(this)

Author
Seyed Ali Ghasemi
License
BSD 3-Clause License

Finalizes the benchmark object by deallocating memory and performs necessary cleanup.

Arguments

Type IntentOptional Attributes Name
class(benchmark), intent(inout) :: this

Benchmark object to be finalized