[Openmp-commits] [PATCH] D135162: [OPENMP] New api ompx_get_team_procs(devid)
Greg Rodgers via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Wed Oct 5 13:15:44 PDT 2022
gregrodgers added a comment.
In D135162#3835298 <https://reviews.llvm.org/D135162#3835298>, @tianshilei1992 wrote:
> The new interface to query the number of physical processors (or whatever it should be called) is fine, but the name is a little bit questionable. It implies how an OpenMP team is mapped to the low level model. I think it is possible that the execution model mapping is per-kernel. It doesn't sound great to have that implication in a general interface name.
Thank you for the comment. It is the detail of the execution model as implemented by the plugin that we need to expose, namely the team. I cannot think of a model or implementation that does not map one or more teams to something physical (hence word "proc"). This commit updates all the plugins that have devices including generic-elf-64bit. I can imagine an implementation that maps a team to a host socket in a multi-socket system. This is why I did not put the word "target" in the name because the devid could be the host or initial device. This is why ompx_get_team_proc(omp_get_initial_device()) returns 1.
To minimize cross team communication, one needs to know the minimum teams to activate all hardware. See https://reviews.llvm.org/D135299 for how ompx_get_team_procs(devid) will be used to allocate storage for cross team (xteam) communication.
There is an existing api omp_get_num_procs() which currently maps to the number of hardware threads in block. This is callable in a target region and I believe it is typically the number of threads. But the number of teams is much different than the physical location of where a team can run.
Currently ompx_get_team_procs(devid) is only callable from host.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135162/new/
https://reviews.llvm.org/D135162
More information about the Openmp-commits
mailing list