GithubHelp home page GithubHelp logo

jalvesz / forbenchmark Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gha3mi/forbenchmark

0.0 1.0 0.0 58.02 MB

ForBenchmark - A Fortran library for benchmarking (with support for coarrays).

Home Page: https://gha3mi.github.io/forbenchmark/

License: BSD 3-Clause "New" or "Revised" License

Python 22.98% Fortran 23.63% HTML 53.39%

forbenchmark's Introduction

GitHub Version Documentation License Build

ForBenchmark: A Fortran library for benchmarking (with support for coarrays).

ForBenchmark can measure various time metrics including elapsed wall time, CPU time, OpenMP (OMP) time, MPI time, and date_and_time. Furthermore, it can compute flops based on a provided function.

Benchmark Results

This list will be updated. Feel free to add new benchmarks.

Simple Usage

use forbenchmark

type(benchmark) :: bench

! initialize the benchmark
call bench%init(nmarks)

! start benchmark
call bench%start_benchmark(imark, method)
! loop over nloops
do nl = 1, bench%nloops

    ! call your function or subroutine or ...

end do
! stop benchmark
call bench%stop_benchmark()

! finalize the benchmark
call bench%finalize()

Procedures

! initialize the benchmark
call bench%init(nmarks, title, filename, nloops, timer)
! start benchmark
call bench%start_benchmark(imark, method, description, argi, argr)
! stop benchmark
call bench%stop_benchmark(flops)
! finalize the benchmark
call bench%finalize()

Refer to example/demo.f90 for a complete demonstration.

fpm dependency

To use ForBenchmark as a dependency in your fpm project, include the following line in your fpm.toml file:

[dependencies]
forbenchmark = {git="https://github.com/gha3mi/forbenchmark.git"}

How to Run the Demo

Clone the repository:

Clone the ForBenchmark repository from GitHub using:

git clone https://github.com/gha3mi/forbenchmark.git
cd forbenchmark

Run the demo:

For non-coarray benchmarking:

fpm run --example demo --profile release

For coarray programs benchmarking using the Intel Fortran compiler:

fpm run --example demo  --profile release --compiler ifx --flag "-coarray -coarray-num-images=4 -DUSE_COARRAY"
fpm run --example demo  --profile release --compiler ifort --flag "-coarray -coarray-num-images=4 -DUSE_COARRAY"

After execution, the results will be displayed in the terminal and stored in the 'results' folder. See results/demo.data, results/demo_im1.data for instance.

Visualizing and exporting demo results:

To generate visual representations and export benchmarking metrics, execute the following commands in Python. Specify the relevant data file as an argument:

python results/export.py demo_<compiler>.data

This command will produce graphical representations and an HTML table showcasing benchmarking metrics:

Elapsed Time Performance
demo_elapsed_time demo_performance
Speedup Average Weighted Speedup
demo_speedup demo_speedup

For Coarray benchmarks, execute:

python results/export_co.py demo_co.data
python results/export_im.py demo_im1.data

The outputs can be found in the results directory.

TODO

  • Add sphinx-gallery
  • Add settings to set units.
  • Add benchmarks for matmul_co, dot_co, ...
  • Add MPI module.

API documentation

The most up-to-date API documentation for the main branch is available here. To generate the API documentation for ForBenchmark using ford run the following command:

ford ford.yml

Contributing

Contributions to ForBenchmark are welcome! If you find any issues or would like to suggest improvements, please open an issue.

forbenchmark's People

Contributors

gha3mi avatar github-actions[bot] avatar jalvesz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.