Go to file
Patrick Lipka d53f0d883c Initial commit 2024-12-13 00:33:08 +01:00
include Initial commit 2024-12-13 00:33:08 +01:00
src Initial commit 2024-12-13 00:33:08 +01:00
.gitignore Initial commit 2024-12-13 00:33:08 +01:00
LICENSE Initial commit 2024-12-13 00:30:40 +01:00
Makefile Initial commit 2024-12-13 00:33:08 +01:00
README.md Initial commit 2024-12-13 00:33:08 +01:00

README.md

pkbf - Parallel Kernel Benchmarking Framework

This project provides a benchmarking framework for parallel computing kernels, where the execution of the kernels can be parallelized using OpenMP or Eventify to compare both for the FlexFMM collaborative project. The application is designed to make adding kernels and parallelization strategies as easy as possible.

Features

  • Kernel Registry: A registry that allows the user to register and execute different computational kernels easily.
  • Parallelization Strategies: Two strategies for parallelizing the execution of kernel loops:
    • OpenMP: Uses OpenMP directives to parallelize the outermost loop.
    • Eventify: Uses the Eventify tasking system for parallelism.
  • Kernel Execution: Kernels such as STREAM TRIAD and DAXPY are implemented, and their execution can be timed and compared across different parallelization strategies.

Project Structure

. ├── bin/ # Compiled executable ├── include/ # Header files │ ├── kernels.hpp # Kernel and KernelRegistry declarations │ ├── strategy.hpp # Parallelization strategies (OpenMP, Eventify) │ └── utils.hpp # Utility functions for initialization ├── src/ # Source files │ ├── kernels.cpp # Kernel and KernelRegistry implementations │ ├── strategy.cpp # Parallelization strategies (OpenMP, Eventify) │ ├── main.cpp # Main entry point for benchmarking ├── Makefile # Makefile to build the project └── README.md # Project documentation

Requirements

  • C++20 or higher
  • OpenMP support (for OpenMP parallelization strategy)
  • Eventify library (for Eventify parallelization strategy)

Dependencies:

  • Eventify: Ensure that the Eventify library is properly installed and the environment variable EVENTIFY_ROOT points to the root directory of the Eventify installation.

Building the Project

To build the project, run:

make

This will compile the source files and generate an executable called benchmark in the bin/ directory.

Clean Up

To remove all compiled files and the executable, run:

make clean

Usage

Running the Benchmark

To run a kernel benchmark, use the following command:

./bin/benchmark <kernel_name> <strategy> <num_threads_or_tasks>
  • <kernel_name>: The name of the kernel to run. Example: stream_triad
  • <strategy>: The parallelization strategy to use. Available options: omp (for OpenMP) and eventify (for Eventify).
  • <num_threads_or_tasks>: The number of threads or tasks to use for parallel execution. This depends on the parallelization strategy (e.g., number of threads for OpenMP, number of tasks for Eventify).

Example:

To run the stream_triad kernel with the OpenMP strategy using 4 threads:

./bin/benchmark stream_triad omp 4

To run the daxpy kernel with the Eventify strategy using 8 tasks:

./bin/benchmark daxpy eventify 8

Error Handling

  • If an invalid kernel name is provided, the program will print an error message and list available kernels.

Example of an invalid kernel name:

$ ./bin/benchmark invalid_kernel omp 4
Kernel not found: invalid_kernel
Available kernels are:
  - stream_triad
  - daxpy

Contributing

Feel free to submit issues or pull requests to improve the project.

License

This project is licensed under the MIT License.