Skip to content

feat(cpu) - CPU persistent threads - #63

Open
ekondis wants to merge 2 commits into
masterfrom
cpu-persistent-threads
Open

feat(cpu) - CPU persistent threads#63
ekondis wants to merge 2 commits into
masterfrom
cpu-persistent-threads

Conversation

@ekondis

@ekondis ekondis commented Jul 12, 2026

Copy link
Copy Markdown
Owner

This PR reduces measurement overhead in mixbench's CPU/OpenMP implementation. Previously, every timed repetition entered and exited an OpenMP parallel for region. That repeatedly requires the runtime to assemble and synchronize a worker team, allowing runtime-management cost to become part of a short kernel's reported duration.

The benchmark now creates one OpenMP team per thread-count configuration and executes all repetitions inside that persistent region. The benchmark kernel uses omp for to share work across the already-active team. A single thread records the start and end timestamps, while OpenMP synchronization makes the duration represent the complete parallel operation rather than only the timing thread's work.

The sampling strategy remains a best-case microbenchmark policy: the first iteration of each configuration is treated as warm-up and excluded, then the minimum retained duration is reported. The benchmark still evaluates both the maximum OpenMP thread count and, when more than one thread is available, half that count. This retains the full-/half-thread comparison while removing parallel-region creation and teardown from the repeated timed path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant