Skip to content

Commit

Permalink
Fix Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
gha3mi committed Jan 7, 2024
1 parent 1cb765f commit 4da85c9
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 22 deletions.
3 changes: 2 additions & 1 deletion src/forbenchmark.f90
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module forbenchmark
!! summary: This module is used to switch between the default and coarray versions of the benchmark
!! This module is used to switch between the default and coarray versions of the benchmark
!!
!! author: Seyed Ali Ghasemi
!! version: {!VERSION!}
!! license: {!LICENSE!}
Expand Down
33 changes: 22 additions & 11 deletions src/forbenchmark_coarray.f90
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module forbenchmark_coarray
!! summary: A Fortran module for benchmarking and performance evaluation for coarray codes.
!! A Fortran module for benchmarking and performance evaluation for coarray codes.
!!
!! author: Seyed Ali Ghasemi
!! version: {!VERSION!}
!! license: {!LICENSE!}
Expand All @@ -17,7 +18,8 @@ module forbenchmark_coarray

!===============================================================================
type :: mark_co
!! summary: Derived type for each method being benchmarked in each image.
!! Derived type for each method being benchmarked in each image.
!!
!! author: Seyed Ali Ghasemi
type(timer) :: time !! Timer object to measure elapsed time in each image
real(rk) :: elapsed_time !! Elapsed time for the benchmark in each image
Expand All @@ -28,7 +30,8 @@ module forbenchmark_coarray

!===============================================================================
type :: mark
!! summary: Derived type for each method being benchmarked in all images.
!! Derived type for each method being benchmarked in all images.
!!
!! author: Seyed Ali Ghasemi
character(:), allocatable :: method !! Name of the method being benchmarked
character(:), allocatable :: description !! Description of the method being benchmarked
Expand All @@ -45,7 +48,8 @@ module forbenchmark_coarray

!===============================================================================
type :: benchmark
!! summary: Derived type for benchmarking and performance evaluation.
!! Derived type for benchmarking and performance evaluation.
!!
!! author: Seyed Ali Ghasemi
type(mark_co), dimension(:), allocatable :: marks_co[:] !! Array of mark_co type for each method being benchmarked in each image
type(mark), dimension(:), allocatable :: marks !! Array of mark type for each method being benchmarked in all images
Expand All @@ -69,7 +73,8 @@ module forbenchmark_coarray

!===============================================================================
elemental impure subroutine init(this, nmarks, title, filename, nloops, timer)
!! summary: Initialization the benchmark object.
!! Initialization the benchmark object.
!!
!! author: Seyed Ali Ghasemi

use, intrinsic :: iso_fortran_env, only: compiler_version, compiler_options
Expand Down Expand Up @@ -199,7 +204,8 @@ end subroutine init

!===============================================================================
impure subroutine start_benchmark(this, imark, method, description, argi, argr)
!! summaray: Start a specific benchmark.
!! Start a specific benchmark.
!!
!! author: Seyed Ali Ghasemi

use face
Expand Down Expand Up @@ -278,7 +284,8 @@ end subroutine start_benchmark

!===============================================================================
impure subroutine stop_benchmark(this, flops)
!! summary: Stops the currently active benchmark, calculates performance metrics, and writes the results to the file and terminal.
!! Stops the currently active benchmark, calculates performance metrics, and writes the results to the file and terminal.
!!
!! author: Seyed Ali Ghasemi

use face
Expand Down Expand Up @@ -394,7 +401,8 @@ end subroutine stop_benchmark

!===============================================================================
impure subroutine write_benchmark(this)
!! summary: Writes the benchmark data to a specified file, including method, speedup, elapsed time, flops, and other details.
!! Writes the benchmark data to a specified file, including method, speedup, elapsed time, flops, and other details.
!!
!! author: Seyed Ali Ghasemi

class(benchmark), intent(inout) :: this !! Benchmark object
Expand Down Expand Up @@ -449,7 +457,8 @@ end subroutine write_benchmark

!===============================================================================
pure elemental subroutine finalize_mark(this)
!! summary: Finalizes the mark object by deallocating allocated memory for method and description.
!! Finalizes the mark object by deallocating allocated memory for method and description.
!!
!! author: Seyed Ali Ghasemi

class(mark), intent(inout) :: this !! Mark object to be finalized
Expand All @@ -462,7 +471,8 @@ end subroutine finalize_mark

!===============================================================================
elemental impure subroutine finalize(this)
!! summary: Finalizes the benchmark object by deallocating memory and performs necessary cleanup.
!! Finalizes the benchmark object by deallocating memory and performs necessary cleanup.
!!
!! author: Seyed Ali Ghasemi

class(benchmark), intent(inout) :: this !! Benchmark object to be finalized
Expand Down Expand Up @@ -503,9 +513,10 @@ end subroutine finalize

!===============================================================================
impure function current_date_and_time() result(datetime)
!! summary: Retrieves the current date and time and returns it as a string
!! 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".
!!
!! author: Seyed Ali Ghasemi

character(21) :: datetime !! Character containing the current date and time
Expand Down
30 changes: 20 additions & 10 deletions src/forbenchmark_default.f90
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module forbenchmark_default
!! summary: A Fortran module for benchmarking and performance evaluation for non-coarray codes.
!! A Fortran module for benchmarking and performance evaluation for non-coarray codes.
!!
!! author: Seyed Ali Ghasemi
!! version: {!VERSION!}
!! license: {!LICENSE!}
Expand All @@ -15,7 +16,8 @@ module forbenchmark_default

!===============================================================================
type :: mark
!! summary: Derived type for each method being benchmarked.
!! Derived type for each method being benchmarked.
!!
!! author: Seyed Ali Ghasemi

character(:), allocatable :: method !! Name of the method being benchmarked
Expand All @@ -32,7 +34,8 @@ module forbenchmark_default

!===============================================================================
type :: benchmark
!! summary: Derived type for benchmarking and performance evaluation.
!! Derived type for benchmarking and performance evaluation.
!!
!! author: Seyed Ali Ghasemi

type(mark), dimension(:), allocatable :: marks !! Array of marks to store benchmark data
Expand All @@ -55,7 +58,8 @@ module forbenchmark_default

!===============================================================================
elemental impure subroutine init(this, nmarks, title, filename, nloops, timer)
!! summary: Initialize the benchmark object
!! Initialize the benchmark object.
!!
!! author: Seyed Ali Ghasemi

use, intrinsic :: iso_fortran_env, only: compiler_version, compiler_options
Expand Down Expand Up @@ -147,7 +151,8 @@ end subroutine init

!===============================================================================
impure subroutine start_benchmark(this, imark, method, description, argi, argr)
!! summary: Start a specific benchmark
!! Start a specific benchmark
!!
!! author: Seyed Ali Ghasemi

use face
Expand Down Expand Up @@ -223,7 +228,8 @@ end subroutine start_benchmark

!===============================================================================
impure subroutine stop_benchmark(this, flops)
!! summary: Stops the currently active benchmark, calculates performance metrics, and writes the results to the file and terminal.
!! Stops the currently active benchmark, calculates performance metrics, and writes the results to the file and terminal.
!!
!! author: Seyed Ali Ghasemi

interface
Expand Down Expand Up @@ -286,7 +292,8 @@ end subroutine stop_benchmark

!===============================================================================
impure subroutine write_benchmark(this)
!! summary: Writes the benchmark data to a specified file, including method, speedup, elapsed time, flops, and other details.
!! Writes the benchmark data to a specified file, including method, speedup, elapsed time, flops, and other details.
!!
!! author: Seyed Ali Ghasemi

class(benchmark), intent(inout) :: this !! Benchmark object
Expand Down Expand Up @@ -320,7 +327,8 @@ end subroutine write_benchmark

!===============================================================================
elemental pure subroutine finalize_mark(this)
!! summary: Finalizes the mark object by deallocating allocated memory for method and description.
!! Finalizes the mark object by deallocating allocated memory for method and description.
!!
!! author: Seyed Ali Ghasemi

class(mark), intent(inout) :: this !! Mark object to be finalized
Expand All @@ -333,7 +341,8 @@ end subroutine finalize_mark

!===============================================================================
elemental impure subroutine finalize(this)
!! summary: Finalizes the benchmark object by deallocating memory and performs necessary cleanup.
!! Finalizes the benchmark object by deallocating memory and performs necessary cleanup.
!!
!! author: Seyed Ali Ghasemi

class(benchmark), intent(inout) :: this !! Benchmark object to be finalized
Expand Down Expand Up @@ -362,9 +371,10 @@ end subroutine finalize

!===============================================================================
impure function current_date_and_time() result(datetime)
!! summary: Retrieves the current date and time and returns it as a string
!! 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".
!!
!! author: Seyed Ali Ghasemi

character(21) :: datetime !! Character containing the current date and time
Expand Down

0 comments on commit 4da85c9

Please sign in to comment.