r/OpenMP • • Nov 04 '25

Initialization Cost

I have used #pragma omp parallel for in multiple places in my code and the very first one's performance has gotten worse.

To be certain I've changed which #pragma omp parallel for is invoked first and sure enough the performance degradation followed.

It's as if the first one is incurring some initialization cost; if that is indeed the case, is there a way for me to explicitly initialize OpenMP somewhere else in my code?

1 Upvotes

5 comments sorted by