Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gha3mi/forbenchmark
ForBenchmark - A Fortran library for benchmarking (with support for coarrays).
https://github.com/gha3mi/forbenchmark
benchmark coarray fortran fortran-package-manager
Last synced: about 1 month ago
JSON representation
ForBenchmark - A Fortran library for benchmarking (with support for coarrays).
- Host: GitHub
- URL: https://github.com/gha3mi/forbenchmark
- Owner: gha3mi
- License: bsd-3-clause
- Created: 2023-12-25T03:54:36.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-27T20:42:38.000Z (about 1 year ago)
- Last Synced: 2023-12-28T02:37:03.198Z (about 1 year ago)
- Topics: benchmark, coarray, fortran, fortran-package-manager
- Language: Fortran
- Homepage:
- Size: 1.22 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![GitHub](https://img.shields.io/badge/GitHub-ForBenchmark-blue.svg?style=social&logo=github)](https://github.com/gha3mi/forbenchmark)
[![Version](https://img.shields.io/github/release/gha3mi/forbenchmark.svg)](https://github.com/gha3mi/forbenchmark/releases/latest)
[![Documentation](https://img.shields.io/badge/ford-Documentation%20-blueviolet.svg)](https://gha3mi.github.io/forbenchmark/)
[![License](https://img.shields.io/github/license/gha3mi/forbenchmark?color=green)](https://github.com/gha3mi/forbenchmark/blob/main/LICENSE)
[![Build](https://github.com/gha3mi/forbenchmark/actions/workflows/CI_test.yml/badge.svg)](https://github.com/gha3mi/forbenchmark/actions/workflows/CI_test.yml)**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
- [dot_product](https://github.com/gha3mi/forbenchmark/tree/main/benchmarks/dot)
- [matmul](https://github.com/gha3mi/forbenchmark/tree/main/benchmarks/matmul) (Under development)This list will be updated. Feel free to add new benchmarks.
## Simple Usage
```fortran
use forbenchmarktype(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
```fortran
! initialize the benchmark
call bench%init(nmarks, title, filename, nloops, timer)
``````fortran
! start benchmark
call bench%start_benchmark(imark, method, description, argi, argr)
``````fortran
! stop benchmark
call bench%stop_benchmark(flops)
``````fortran
! 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:
```toml
[dependencies]
forbenchmark = {git="https://github.com/gha3mi/forbenchmark.git"}
```## How to Run the Demo
**Clone the repository:**
Clone the `ForBenchmark` repository from GitHub using:
```shell
git clone https://github.com/gha3mi/forbenchmark.git
cd forbenchmark
```**Run the demo:**
For non-coarray benchmarking:
```shell
fpm run --example demo --profile release
```For coarray programs benchmarking using the Intel Fortran compiler:
```shell
fpm run --example demo --profile release --compiler ifx --flag "-coarray -coarray-num-images=4 -DUSE_COARRAY"
``````shell
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:
```shell
python results/export.py demo_.data
```This command will produce graphical representations and an HTML table showcasing benchmarking metrics:
| Elapsed Time | Performance |
|--------------|-------------|
| | || Speedup | Average Weighted Speedup |
|---------|--------------------------|
| | |For Coarray benchmarks, execute:
```shell
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](https://sphinx-gallery.github.io/stable/auto_examples/.index.html)
- [ ] Add settings to set units.
- [ ] Add and update benchmarks for matmul and matmul_co,...
- [ ] Add MPI module.## API documentation
The most up-to-date API documentation for the main branch is available
[here](https://gha3mi.github.io/forbenchmark/).
To generate the API documentation for `ForBenchmark` using
[ford](https://github.com/Fortran-FOSS-Programmers/ford) run the following
command:```shell
ford ford.yml
```## Contributing
Contributions to `ForBenchmark` are welcome!
If you find any issues or would like to suggest improvements, please open an issue.