Carlos
Carlos

Reputation: 421

OpenMP: what is the difference between "taskloop" and "omp for" performance wise?

"taskloop" is introduced in OpenMP 4.5. It can take clauses from both loop and task constructs (except depend clause AFAIK).

However, I'm wondering if "taskloop" and "omp for" constructs differ performance wise too.

Upvotes: 3

Views: 1722

Answers (1)

Laci
Laci

Reputation: 2818

I think it may depends on the actual problem. To parallelize a for loop omp for can be faster than tasks, because it offers several different scheduling scheme for your needs. In my experience (solving a particular problem using clang12 compiler) omp for produces a bit faster code than tasks (on Ryzen 5 7800X).

Upvotes: 1

Related Questions