This is an archive of the discontinued LLVM Phabricator instance.

Force runtime to honor nthreads-var and thread-limit-var inside the teams construct on host.
ClosedPublic

Authored by AndreyChurbanov on Aug 16 2019, 7:42 AM.

Details

Summary

This patch fixes https://bugs.llvm.org/show_bug.cgi?id=42906, via adding adjustment of number of threads on enter to the teams construct on host according to user settings. This allows to pass checks and avoid assertions at time of team of threads creation.

Diff Detail

Event Timeline

hbae accepted this revision.Aug 19 2019, 9:33 AM

LGTM.

This revision is now accepted and ready to land.Aug 19 2019, 9:33 AM
simoatze added a comment.EditedAug 20 2019, 10:28 AM

Will this fix make it to the 9.0 release? Thank you!

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 20 2019, 12:38 PM

Will this fix make it to the 9.0 release? Thank you!

Sorry for late reply, I was on vacation w/o internet access.
I guess no. We are probably missing 9.0 release. Do you think it is important enough to request its pull at this (late) stage of the release process?

I think this can wait at this point. I noticed the problem on Power when I was doing performance tests. On Power using all the available threads (including HT) was causing slow downs with SPEC Accel OMP, so I had to set the OMP_THREAD_LIMIT and noticed the seg faults. I can patch my own runtime and wait for the next release that will integrate this fix. Thanks!

BTW, there is also workaround without runtime patching, - set KMP_TEAMS_THREAD_LIMIT to the same value as OMP_THREAD_LIMIT. This avoids runtime segfault with old library.