Skip to main content

A User-Guided Locking API for the OpenMP* Application Program Interface

  • Conference paper
Using and Improving OpenMP for Devices, Tasks, and More (IWOMP 2014)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 8766))

Included in the following conference series:

Abstract

Although the OpenMP API specification defines a set of runtime 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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Bihari, B.L., Wong, M., Wang, A., de Supinski, B.R., Chen, W.: A Case for Including Transactions in OpenMP II: Hardware Transactional Memory. In: Chapman, B.M., Massaioli, F., Müller, M.S., Rorro, M. (eds.) IWOMP 2012. LNCS, vol. 7312, pp. 44–58. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  2. Bull, J.M.: Measuring Synchronisation and Scheduling Overheads in OpenMP. In: Proc. of the 1st European Workshop on OpenMP, Lund, Sweden, pp. 99–105 (1999)

    Google Scholar 

  3. Drepper, U.: Futexes are Tricky. Technical report, Redhat, Version 1.6 (2011) http://www.akkadia.org/drepper/futex.pdf .

  4. Drepper, U., Molnar, I.: The Native POSIX Thread Library for Linux. Technical report, Redhat (2003)

    Google Scholar 

  5. Feng, H., Van der Wijngaart, R.F., Biswas, R., Mavriplis, C.: Unstructured Adaptive (UA) NAS Parallel Benchmark, Version 1.0. Technical Report NAS-04-006, NASA (2004)

    Google Scholar 

  6. Haring, R.A., Ohmacht, M., Fox, T.W., Gschwind, M.K., Satterfield, D.L., Sugavanam, K., Coteus, P.W., Heidelberger, P., Blumrich, M.A., Wisniewski, R.W., Gara, A., Chiu, G.L.-T., Boyle, P.A., Christ, N.H., Kim, C.: The IBM Blue Gene/Q Compute Chip. IEEE Micro 32(2), 48–60 (2013)

    Article  Google Scholar 

  7. IBM XL C/C++ for Blue Gene/Q, V12.1 (2012), http://pic.dhe.ibm.com/infocenter/compbg/v121v141/index.jsp?topic=

  8. Intel Corporation. Intel® Architecture Instruction Set Extensions Programming Reference, Document number 319433-014 (2012)

    Google Scholar 

  9. Kleen, A.: Lock Elision in the GNU C Library. LWN.net 12(1) (2013), http://lwn.net/Articles/534758/

  10. Mellor-Crummey, J.M., Scott, M.L.: Algorithms for Scalable Synchronization on Shared-memory Multiprocessors. ACM Trans. Comput. Syst. 9(1), 21–65 (1991)

    Article  Google Scholar 

  11. Miller, D.: The GNU C Library version 2.18 is now available, Announcement on the info-gnu mailing list (2013), http://lists.gnu.org/archive/html/info-gnu/2013-08/msg00003.html

  12. OpenMP Architecture Review Board. OpenMP Application Program Interface, Version 4.0 (2013), http://www.openmp.org/

  13. Schindewolf, M., Bihari, B., Gyllenhaal, J., Schulz, M., Wang, A., Karl, W.: What Scientific Applications Can Benefit from Hardware Transactional Memory? In: Proc. of the Intl. Conf. on High Performance Computing, Networking, Storage and Analysis, SC 2012, Salt Lake City, pp. 90:1–90:11 (2012)

    Google Scholar 

  14. Wong, M., Bihari, B.L., de Supinski, B.R., Wu, P., Michael, M., Liu, Y., Chen, W.: A Case for Including Transactions in OpenMP. In: Sato, M., Hanawa, T., Müller, M.S., Chapman, B.M., de Supinski, B.R. (eds.) IWOMP 2010. LNCS, vol. 6132, pp. 149–160. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  15. Yoo, R.M., Hughes, C.J., Lai, K., Rajwar, R.: Performance Evaluation of Intel® Transactional Synchronization Extensions for High-performance Computing. In: Proc. of the Intl. Conf. on High Performance Computing, Networking, Storage and Analysis, Denver, CO, pp. 19:1–19:11 (2013)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Bae, H., Cownie, J., Klemm, M., Terboven, C. (2014). A User-Guided Locking API for the OpenMP* Application Program Interface. In: DeRose, L., de Supinski, B.R., Olivier, S.L., Chapman, B.M., Müller, M.S. (eds) Using and Improving OpenMP for Devices, Tasks, and More. IWOMP 2014. Lecture Notes in Computer Science, vol 8766. Springer, Cham. https://doi.org/10.1007/978-3-319-11454-5_13

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-11454-5_13

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-11453-8

  • Online ISBN: 978-3-319-11454-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics