Issue with CPU affinity in teams in OpenMP 5.0

General OpenMP discussion
Forum rules
The OpenMP Forums are now closed to new posts. Please visit Stack Overflow if you are in need of help: https://stackoverflow.com/questions/tagged/openmp
Locked
kchndrs
Posts: 1
Joined: Wed May 06, 2020 6:16 am

Issue with CPU affinity in teams in OpenMP 5.0

Post by kchndrs »

I am trying to use teams on host, since with OpenMP 5.0 teams can work outside the target directive. I ran into an issue regarding affinity of teams in CPU. Threads from all teams seem to be mapped to the same set of cores, essentially resulting in a sequential execution of the teams. I am using gcc 9.3.
How do I resolve this issue so that threads from different teams are mapped to different cores?

Thanks,
Kavitha

MarkB
Posts: 808
Joined: Thu Jan 08, 2009 10:12 am
Location: EPCC, University of Edinburgh

Re: Issue with CPU affinity in teams in OpenMP 5.0

Post by MarkB »

In OpenMP 5.0, binding of (the initial thread of) teams to places (i.e. sockets, cores. hardware threads) is left up to the implementation - see lines 29-31 on page 83. I'm not aware of any compiler-specific support for this in gcc. Is using nested parallel regions not a possible solution for your use case?

Locked