[Openmp-dev] kmp_set_blocktime

Churbanov, Andrey via Openmp-dev openmp-dev at lists.llvm.org
Mon Jul 4 07:50:20 PDT 2016


Hi Yonghong!

The documentation says:
Sets the number of milliseconds that a thread should wait, after completing the execution of a parallel region, before sleeping. This routine affects the block time setting for the calling thread and any OpenMP* team threads formed by the calling thread.

The key words here is “formed by the calling thread”.  That means there is no race conditions here as each thread only sets its own control variable.  Calling the setter from inside the parallel region will affect nested parallel regions created by the calling thread, this does not affect current team members.

Regards,
Andrey

From: Openmp-dev [mailto:openmp-dev-bounces at lists.llvm.org] On Behalf Of Yonghong Yan via Openmp-dev
Sent: Friday, July 1, 2016 11:02 PM
To: openmp-dev at lists.llvm.org
Subject: [Openmp-dev] kmp_set_blocktime

I am a bit confused with the usage and purpose of kmp_set_blocktime:

From
https://software.intel.com/en-us/node/522688#4ED418BA-EE4F-4A37-BCB9-88B114D8FA21 and the source code (__kmp_aux_set_blocktime<http://vm:8080/llvm/s?refs=__kmp_aux_set_blocktime>), the set_block_time change the block time for the calling thread and the team threads, no body else.

If the function is called in the sequential region, there is no team during the region. if it should be called in the parallel region, it should be in a critical section (or called by one thread only) so do not introduce traces since the call clearly updates some fields in the team object. I assume the intention is the latter case, which is for impacting the waiting behavior of the team thread after a parallel region. It however would not impact the them after the parallel region since the team is gone by that. did I miss anything?

Yonghong

--------------------------------------------------------------------
Joint Stock Company Intel A/O
Registered legal address: Krylatsky Hills Business Park,
17 Krylatskaya Str., Bldg 4, Moscow 121614,
Russian Federation

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20160704/748c3702/attachment-0001.html>


More information about the Openmp-dev mailing list