omp_places中的等价物?

时间:2016-06-09 07:16:13

标签: multithreading parallel-processing openmp affinity

我在使用omp_places时遇到了一些麻烦,似乎找到了相互矛盾的信息 来自http://openmp.org/mp-documents/OpenMP_Examples_4.0.1.pdf

我发现:

omp_places={0:2}:8:2

相当于:

omp_places="{0,1},{2,3},{4,5},{6,7},{8,9},{10,11},{12,13},{14,15}"

在我的代码中,我根据系统中检测到的核心数量以及有关numa传播等的用户规范自动构建字符串。

当没有传播时,我经常会得到以下字符串:

OMP_PLACES={0:16}:1:16

我认为相当于:

OMP_PLACES={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}

问题是第一个会抛出一个警告,告诉线程试图绑定到ID 16-31,这超出了范围。

我猜我的问题是OMP_PLACES行中的最后一个16,但我真的不明白为什么。

我对这些参数的作用的理解如下:

OMP_PLACES={a:b}:c:d

a = first thread ID in a group
b = number of threads to bind in this grouping
c = number of groups to create
d = the shift in first thread ID from one group to the following

现在很明显我的理解有问题,所以有人可以赐教我吗?

0 个答案:

没有答案