This repository contains a benchmark suite comparing OpenMP (C) and Rayon (Rust) across various concurrency dimensions including performance, scalability, thread overhead, and programmability.
.
├── README.md
├── c_program/ # C programs for OpenMP report (takes input)
├── rust_code/ # Rust Rayon programs (some take input, some benchmarked with fixed sizes)
└── scalability_and_performance_c/ # C programs with predefined input/thread settings (benchmark-only)
Navigate to the respective folder and use make:
cd c_program
make
# or
cd scalability_and_performance_c
make- Programs in
c_program/take input arguments such as input size, thread count, or execution mode. - Programs in
scalability_and_performance_c/are benchmark variants with fixed/predefined settings.
1. Programmability
programmability_mandelbrot
2. Amount of Control
amount_of_control_charfreqamount_of_control_task
3. Thread Overhead
overhead_create_deleteoverhead_sync
4. Performance
performance_piperformance_mergesort
5. Scalability
scalability_factorialscalability_heatdist
cd rust_code
cargo buildYou can:
- Use
cargo runfor argument-based binaries:cargo run --bin performance_merge_sort -- 1000000 32 parallel
- Or run prebuilt binaries directly:
cd target/debug ./benchmark4_perf_msort
** Benchmark Programs** (predefined inputs, no command-line arguments):
benchmark1_scale_pibenchmark2_scale_heatdistbenchmark3_perf_factorialbenchmark4_perf_msort
** Input-Driven Programs** (require arguments: input size, thread count, execution mode):
programmability_mandelbrotamount_of_control_charfreqamount_of_control_taskoverhead_create_deleteoverhead_syncperformance_factorialperformance_merge_sortscalability_piscalability_jacobi
Example:
cargo run --bin scalability_pi -- 100000000 32 2- Requires a compiler that supports OpenMP (e.g.,
gcc-14) for all C programs. - I have run this program using cargo v1.86.0 and gcc-14.
- Rust benchmarks use the Rayon crate.
- Programs in
scalability_and_performance_c/are equivalent to the Rustbenchmarkbinaries — they don’t take arguments and run preset test cases.