This is an archive of the discontinued LLVM Phabricator instance.

Initial Dynamic Lock Dispatch Code in OpenMP
ClosedPublic

Authored by jlpeyton on Feb 13 2015, 3:43 PM.

Details

Reviewers
AndreyChurbanov
Summary

There are a lot of changes in this one.

Changes based off paper: “A User-Guided Locking API for the OpenMP* Application Program Interface”
This change is rather large, but currently is disabled. One can turn it on by changing the value of KMP_USE_DYNAMIC_LOCK in kmp_os.h to 1
Abstract.
Although the OpenMP API specification defines a set of run-time routines for simple and nested locks, there is no standardized way to select different lock implementations. Programmers have to use vendor extensions to globally alter the lock implementation for the application; fine-grained control is not possible. Proper use of hardware-based speculative locks can achieve significant runtime improvements but, if used inappropriately, they can lead to severe performance penalties. Thus programmers need to be able to explicitly choose the right lock implementation on a per-lock basis. In this paper, we extend the OpenMP API for locks with functions to provide such hints to the implementation. We also extend the syntax and semantics of the critical construct with clauses to contain hints. Our performance results for micro-benchmarks show that the runtime selection of lock implementations does not add any noticeable overhead. We also show that using an appropriate runtime hint can improve application performance.

Diff Detail

Repository
rL LLVM

Event Timeline

jlpeyton updated this revision to Diff 19942.Feb 13 2015, 3:43 PM
jlpeyton retitled this revision from to Initial Dynamic Lock Dispatch Code in OpenMP.
jlpeyton updated this object.
jlpeyton edited the test plan for this revision. (Show Details)
jlpeyton set the repository for this revision to rL LLVM.
jlpeyton added a subscriber: Unknown Object (MLST).
jlpeyton abandoned this revision.Feb 17 2015, 8:04 AM
jlpeyton reclaimed this revision.Feb 18 2015, 9:09 AM

This change is rather large, but currently is disabled. One can turn it on by changing the value of KMP_USE_DYNAMIC_LOCK in kmp_os.h to 1

Why is it disabled by default? Are you planning to enable this by default?

Our performance results for micro-benchmarks show that the runtime selection of lock implementations does not add any noticeable overhead. We also show that using an appropriate runtime hint can improve application performance.

Looking toward the hopefully-not-so-distant future when we have regression tests for this library, could you please commit these microbenchmarks to the repository somewhere? This will help me to review this patch, and can also serve as the basis for tests for this feature.

Looking toward the hopefully-not-so-distant future when we have regression tests for this library, could you please commit these microbenchmarks to the repository somewhere? This will help me to review this patch, and can also serve as the basis for tests for this feature.

I know this revision is old and committed already, but is it ok if we create a new directory openmp/testsuite/tests_to_integrate/
and put these hinted_lock_tests.[cf] tests in there? I have been looking at the testsuite format and am going to add these soon.

Looking toward the hopefully-not-so-distant future when we have regression tests for this library, could you please commit these microbenchmarks to the repository somewhere? This will help me to review this patch, and can also serve as the basis for tests for this feature.

I know this revision is old and committed already, but is it ok if we create a new directory openmp/testsuite/tests_to_integrate/
and put these hinted_lock_tests.[cf] tests in there? I have been looking at the testsuite format and am going to add these soon.

Yes, sounds good to me.

AndreyChurbanov accepted this revision.May 6 2015, 10:31 AM
AndreyChurbanov edited edge metadata.

Committed 20/2/2015 revision 230030.

This revision is now accepted and ready to land.May 6 2015, 10:31 AM
jlpeyton closed this revision.May 6 2015, 11:18 AM

Ok! We will push the unit tests upstream soon.