This is an archive of the discontinued LLVM Phabricator instance.

Add new envirable KMP_TEAMS_THREAD_LIMIT
ClosedPublic

Authored by tlwilmar on Jul 28 2017, 11:28 AM.

Details

Summary

This change adds a new environment variable, KMP_TEAMS_THREAD_LIMIT, which is used to set a new global variable, kmp_teams_max_nth, which is checked when determining the size and quantity of teams that will be created in the teams construct. Specifically, it is a limit on the total number of threads in a given teams construct. It differentiates the limits for the teams construct from the limits for regular parallel regions (KMP_DEVICE_THREAD_LIMIT/kmp_max_nth and OMP_THREAD_LIMIT/__kmp_cg_max_nth). When each individual team is formed, it is still subject to those limits. After the clauses to the teams construct are parsed and calculated, we check to make sure we are within this limit, and if not, reduce num_threads per team and/or number of teams, accordingly. The default value is set to the number of available processors on the system.

Diff Detail

Repository
rL LLVM

Event Timeline

tlwilmar created this revision.Jul 28 2017, 11:28 AM
hbae accepted this revision.Jul 28 2017, 12:39 PM

LGTM.

This revision is now accepted and ready to land.Jul 28 2017, 12:39 PM
This revision was automatically updated to reflect the committed changes.