How can Microsoft's OpenMP spinlock time be controlled?

ぐ巨炮叔叔 提交于 2019-12-07 02:28:50

问题


The OpenMP used by the Intel compiler supports an environment variable KMP_BLOCKTIME (docs) which I believe controls the busy-waiting (spinlocked) time the threads will spend waiting for new work (linked document claims this defaults to 200ms).

The OpenMP used by the Gnu compiler supports an environment variable GOMP_SPINCOUNT (docs) which I believe also controls that library's equivalent implementation detail (although apparently expressed as an iteration count rather than a time).

My question is: what control(s) (if any) do Microsoft provide to control this parameter in the OpenMP used by the Microsoft compiler? (It's VS2010 that interests me currently.)

(I'm well aware that if my program's parallelism was entirely OpenMP based there would be little reason to worry about this, but my interest is provoked by some vtune traces from a large complex system which also makes significant use of TBB.)


回答1:


Microsoft Visual Studio 2010 SP1 and higher seem to do support OMP_WAIT_POLICY as seen in this Knowledge base article

setting OMP_WAIT_POLICY to PASSIVE does fix the issue for me when compiling with Visual Studio 2013.



来源:https://stackoverflow.com/questions/20748066/how-can-microsofts-openmp-spinlock-time-be-controlled

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!