Skip to main content
Top

2019 | OriginalPaper | Chapter

Hunting Superfluous Locks with Model Checking

Authors : Viet-Anh Nguyen, Wendelin Serwe, Radu Mateescu, Eric Jenn

Published in: From Software Engineering to Formal Methods and Tools, and Back

Publisher: Springer International Publishing

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

Abstract

Parallelization of existing sequential programs to increase their performance and exploit recent multi and many-core architectures is a challenging but inevitable effort. One increasingly popular parallelization approach is based on OpenMP, which enables the designer to annotate a sequential program with constructs specifying the parallel execution of code blocks. These constructs are then interpreted by the OpenMP compiler and runtime, which assigns blocks to threads running on a parallel architecture. Although this scheme is very flexible and not (very) intrusive, it does not prevent the occurrence of synchronization errors (e.g., deadlocks) or data races on shared variables. In this paper, we propose an iterative method to assist the OpenMP parallelization by using formal methods and verification. In each iteration, potential data races are identified by applying to the OpenMP program a lockset analysis, which computes the set of shared variables that potentially need to be protected by locks. To avoid the insertion of superfluous locks, an abstract, action-based formal model of the OpenMP program is extracted and analyzed using the ACTL on-the-fly model checker of the CADP formal verification toolbox. We describe the method, compare it with existing work, and illustrate its practical use.

Dont have a licence yet? Then find out more about our products and how to get one now:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Footnotes
3
However, OpenMP does neither require nor guarantee that parallel and sequential executions produce the same results; also, executing the same program with a different number of threads may yield different results [33, Section 1.3].
 
4
The meaning of “work unit” (in the comments) can be found in Sect. 3.2.
 
Literature
4.
go back to reference Beckman, N.E.: A survey of methods for preventing race conditions (2006) Beckman, N.E.: A survey of methods for preventing race conditions (2006)
7.
go back to reference Cramer, T., Schwitanski, S., Münchhalfen, F., Terboven, C., Müller, M.S.: An OpenMP epoch model for correctness checking. In: 2016 45th International Conference on Parallel Processing Workshops (ICPPW), pp. 299–308, August 2016. https://doi.org/10.1109/ICPPW.2016.51 Cramer, T., Schwitanski, S., Münchhalfen, F., Terboven, C., Müller, M.S.: An OpenMP epoch model for correctness checking. In: 2016 45th International Conference on Parallel Processing Workshops (ICPPW), pp. 299–308, August 2016. https://​doi.​org/​10.​1109/​ICPPW.​2016.​51
10.
go back to reference Fantechi, A., Gnesi, S., Ristori, G.: From ACTL to mu-calculus. In: Proceedings of the ERCIM Workshop on Theory and Practice in Verification, Pisa, Italy, pp. 3–10, January 1992 Fantechi, A., Gnesi, S., Ristori, G.: From ACTL to mu-calculus. In: Proceedings of the ERCIM Workshop on Theory and Practice in Verification, Pisa, Italy, pp. 3–10, January 1992
12.
go back to reference Fantechi, A., Gnesi, S., Ristori, G.: Modelling transition systems within an action based logic. Technical report, IEI-CNR, Pisa (1996) Fantechi, A., Gnesi, S., Ristori, G.: Modelling transition systems within an action based logic. Technical report, IEI-CNR, Pisa (1996)
13.
go back to reference Garavel, H., Lang, F., Mateescu, R.: Compositional verification of asynchronous concurrent systems using CADP. Acta Informatica 52(4), 337–392 (2015)MathSciNetCrossRef Garavel, H., Lang, F., Mateescu, R.: Compositional verification of asynchronous concurrent systems using CADP. Acta Informatica 52(4), 337–392 (2015)MathSciNetCrossRef
14.
go back to reference Garavel, H., Lang, F., Mateescu, R., Serwe, W.: CADP 2011: a toolbox for the construction and analysis of distributed processes. Springer Int. J. Softw. Tools Technol. Transf. (STTT) 15(2), 89–107 (2013)CrossRef Garavel, H., Lang, F., Mateescu, R., Serwe, W.: CADP 2011: a toolbox for the construction and analysis of distributed processes. Springer Int. J. Softw. Tools Technol. Transf. (STTT) 15(2), 89–107 (2013)CrossRef
16.
go back to reference Gnesi, S., Mazzanti, F.: On the fly verification of network of automata. In: Arabnia, H.R. (ed.) Proceedings of the International Conference on Parallel and Distributed Processing Techniques and Applications, PDPTA 1999, Las Vegas, Nevada, USA, pp. 1040–1046. CSREA Press, June–July 1999 Gnesi, S., Mazzanti, F.: On the fly verification of network of automata. In: Arabnia, H.R. (ed.) Proceedings of the International Conference on Parallel and Distributed Processing Techniques and Applications, PDPTA 1999, Las Vegas, Nevada, USA, pp. 1040–1046. CSREA Press, June–July 1999
19.
go back to reference Ha, O.K., Kuh, I.B., Tchamgoue, G.M., Jun, Y.K.: On-the-fly detection of data races in OpenMP programs. In: Proceedings of the 2012 Workshop on Parallel and Distributed Systems: Testing, Analysis, and Debugging, PADTAD 2012, pp. 1–10. ACM (2012). https://doi.org/10.1145/2338967.2336808 Ha, O.K., Kuh, I.B., Tchamgoue, G.M., Jun, Y.K.: On-the-fly detection of data races in OpenMP programs. In: Proceedings of the 2012 Workshop on Parallel and Distributed Systems: Testing, Analysis, and Debugging, PADTAD 2012, pp. 1–10. ACM (2012). https://​doi.​org/​10.​1145/​2338967.​2336808
20.
go back to reference Henzinger, T.A., Jhala, R., Majumdar, R.: Race checking by context inference. In: Pugh, W., Chambers, C. (eds.) Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2004, Washington, D.C., USA, pp. 1–13. ACM, June 2004. https://doi.org/10.1145/996841.996844 Henzinger, T.A., Jhala, R., Majumdar, R.: Race checking by context inference. In: Pugh, W., Chambers, C. (eds.) Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2004, Washington, D.C., USA, pp. 1–13. ACM, June 2004. https://​doi.​org/​10.​1145/​996841.​996844
22.
go back to reference Kim, Y., Song, S., Jun, Y.: ADAT: an adaptable dynamic analysis tool for race detection in OpenMP programs. In: 2011 IEEE Ninth International Symposium on Parallel and Distributed Processing with Applications, pp. 304–310, May 2011. https://doi.org/10.1109/ISPA.2011.49 Kim, Y., Song, S., Jun, Y.: ADAT: an adaptable dynamic analysis tool for race detection in OpenMP programs. In: 2011 IEEE Ninth International Symposium on Parallel and Distributed Processing with Applications, pp. 304–310, May 2011. https://​doi.​org/​10.​1109/​ISPA.​2011.​49
24.
go back to reference Lang, F., Mateescu, R., Mazzanti, F.: Compositional verification of concurrent systems by combining bisimulations. In: ter Beek, M.H. et al. (eds.) FM 2019. LNCS, vol. 11800, pp. 196–213. Springer, Cham (2019) Lang, F., Mateescu, R., Mazzanti, F.: Compositional verification of concurrent systems by combining bisimulations. In: ter Beek, M.H. et al. (eds.) FM 2019. LNCS, vol. 11800, pp. 196–213. Springer, Cham (2019)
26.
27.
go back to reference Mateescu, R.: CAESAR\(\_\)SOLVE: a generic library for on-the-fly resolution of alternation-free boolean equation systems. Springer Int. J. Softw. Tools Technol. Transf. (STTT) 8(1), 37–56 (2006). Full Version Available as INRIA Research Report RR-5948, July 2006 Mateescu, R.: CAESAR\(\_\)SOLVE: a generic library for on-the-fly resolution of alternation-free boolean equation systems. Springer Int. J. Softw. Tools Technol. Transf. (STTT) 8(1), 37–56 (2006). Full Version Available as INRIA Research Report RR-5948, July 2006
28.
go back to reference Mateescu, R., Serwe, W.: Model checking and performance evaluation with CADP illustrated on shared-memory mutual exclusion protocols. Sci. Comput. Program. 78(7), 843–861 (2013)CrossRef Mateescu, R., Serwe, W.: Model checking and performance evaluation with CADP illustrated on shared-memory mutual exclusion protocols. Sci. Comput. Program. 78(7), 843–861 (2013)CrossRef
30.
go back to reference Mateescu, R., Wijs, A.: Property-dependent reductions adequate with divergence-sensitive branching bisimilarity. Sci. Comput. Program. 96(3), 354–376 (2014)CrossRef Mateescu, R., Wijs, A.: Property-dependent reductions adequate with divergence-sensitive branching bisimilarity. Sci. Comput. Program. 96(3), 354–376 (2014)CrossRef
37.
go back to reference Shah, D.: Analysis of an OpenMP program for race detection. Master’s thesis, San Jose State University (2009) Shah, D.: Analysis of an OpenMP program for race detection. Master’s thesis, San Jose State University (2009)
Metadata
Title
Hunting Superfluous Locks with Model Checking
Authors
Viet-Anh Nguyen
Wendelin Serwe
Radu Mateescu
Eric Jenn
Copyright Year
2019
DOI
https://doi.org/10.1007/978-3-030-30985-5_24

Premium Partner