This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Let primary thread gather topology info for each worker thread
ClosedPublic

Authored by jlpeyton on Jul 31 2023, 12:04 PM.

Details

Summary

This change has the primary thread create each thread's initial mask
and topology information so it is available immediately after
forking. The setting of mask/topology information is decoupled from the
actual binding. Also add this setting of topology information inside the
__kmp_partition_places mechanism for OMP_PLACES+OMP_PROC_BIND.

Without this, there could be a timing window after the primary
thread signals the workers to fork where worker threads have not yet
established their affinity mask or topology information.

Each worker thread will then bind to the location the primary thread sets.

Diff Detail