Safe Parallelism: Compiler Analysis Techniques for Ada and OpenMP

  • Sara Royuela
  • Xavier Martorell
  • Eduardo Quiñones
  • Luis Miguel Pinho
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10873)


There is a growing need to support parallel computation in Ada to cope with the performance requirements of the most advanced functionalities of safety-critical systems. In that regard, the use of parallel programming models is paramount to exploit the benefits of parallelism.

Recent works motivate the use of OpenMP for being a de facto standard in high-performance computing for programming shared memory architectures. These works address two important aspects towards the introduction of OpenMP in Ada: the compatibility of the OpenMP syntax with the Ada language, and the interoperability of the OpenMP and the Ada runtimes, demonstrating that OpenMP complements and supports the structured parallelism approach of the tasklet model.

This paper addresses a third fundamental aspect: functional safety from a compiler perspective. Particularly, it focuses on race conditions and considers the fine-grain and unstructured capabilities of OpenMP. Hereof, this paper presents a new compiler analysis technique that: (1) identifies potential race conditions in parallel Ada programs based on OpenMP or Ada tasks or both, and (2) provides solutions for the detected races.



This work was supported by the Spanish Ministry of Science and Innovation under contract TIN2015-65316-P, and by the FCT (Portuguese Foundation for Science and Technology) within the CISTER Research Unit (CEC/04234).

Supplementary material


  1. 1.
  2. 2.
  3. 3.
    Pinho, L.M., Moore, B., Michell, S.: Parallelism in Ada: status and prospects. In: George, L., Vardanega, T. (eds.) Ada-Europe 2014. LNCS, vol. 8454, pp. 91–106. Springer, Cham (2014). Scholar
  4. 4.
    Taft, S.T., Moore, B., Pinho, L.M., Michell, S.: Safe parallel programming in Ada with language extensions. ACM SIGAda Ada Lett. 34(3), 87–96 (2014)CrossRefGoogle Scholar
  5. 5.
    Pinho, L.M., Moore, B., Michell, S., Tucker Taft, S.: An execution model for fine-grained parallelism in Ada. In: de la Puente, J.A., Vardanega, T. (eds.) Ada-Europe 2015. LNCS, vol. 9111, pp. 196–211. Springer, Cham (2015). Scholar
  6. 6.
    Pinho, L.M., Moore, B., Michell, S., Taft, S.T.: Real-time fine-grained parallelism in Ada. ACM SIGAda Ada Lett. 35(1), 46–58 (2015)CrossRefGoogle Scholar
  7. 7.
    Taft, T., Moore, B., Pinho, L.M., Michell, S.: Reduction of parallel computation in the parallel model for Ada. ACM SIGAda Ada Lett. 36(1), 9–24 (2016)CrossRefGoogle Scholar
  8. 8.
    Royuela, S., Martorell, X., Quiñones, E., Pinho, L.M.: OpenMP tasking model for Ada: safety and correctness. In: Blieberger, J., Bader, M. (eds.) Ada-Europe 2017. LNCS, vol. 10300, pp. 184–200. Springer, Cham (2017). Scholar
  9. 9.
    Royuela, S., Pinho, L.M., Quiñones, E.: Converging safety and high-performance domains: integrating OpenMP into Ada. In: Design, Automation & Test in Europe, March 2018Google Scholar
  10. 10.
    OpenMP Architecture Review Board: OpenMP Application Programming Interface 4.5 (2015).
  11. 11.
    Royuela, S., Duran, A., Serrano, M.A., Quiñones, E., Martorell, X.: A functional safety OpenMP\(^{*}\) for critical real-time embedded systems. In: de Supinski, B.R., Olivier, S.L., Terboven, C., Chapman, B.M., Müller, M.S. (eds.) IWOMP 2017. LNCS, vol. 10468, pp. 231–245. Springer, Cham (2017). Scholar
  12. 12.
    Ada Resource Association: Ada 95 Reference Manual. ISO/IEC 8652:1995(E) with COR.1 (2000).
  13. 13.
    Burns, A., Dobbing, B., Romanski, G.: The Ravenscar tasking profile for high integrity real-time programs. In: Asplund, L. (ed.) Ada-Europe 1998. LNCS, vol. 1411, pp. 263–275. Springer, Heidelberg (1998). Scholar
  14. 14.
    Barnes, J.G.P.: High Integrity Software: The Spark Approach to Safety and Security: Sample Chapters. Pearson Education, London (2003)Google Scholar
  15. 15.
    Taft, S.T., Schanda, F., Moy, Y.: High-integrity multitasking in SPARK: static detection of data races and locking cycles. In: 17th International Symposium on High Assurance Systems Engineering, pp. 238–239. IEEE (2016)Google Scholar
  16. 16.
    Michell, S., Moore, B., Pinho, L.M.: Tasklettes – a fine grained parallelism for Ada on multicores. In: Keller, H.B., Plödereder, E., Dencker, P., Klenk, H. (eds.) Ada-Europe 2013. LNCS, vol. 7896, pp. 17–34. Springer, Heidelberg (2013). Scholar
  17. 17.
    Serrano, M.A., Melani, A., Vargas, R., Marongiu, A., Bertogna, M., Quiñones, E.: Timing characterization of OpenMP4 tasking model. In: International Conference on Compilers, Architecture and Synthesis for Embedded Systems, pp. 157–166. IEEE Press, October 2015Google Scholar
  18. 18.
    Serrano, M.A., Melani, A., Bertogna, M., Quiñones, E.: Response-time analysis of DAG tasks under fixed priority scheduling with limited preemptions. In: Design, Automation & Test in Europe, pp. 1066–1071. IEEE, March 2016Google Scholar
  19. 19.
    Melani, A., Serrano, M.A., Bertogna, M., Cerutti, I., Quiñones, E., Buttazzo, G.: A static scheduling approach to enable safety-critical OpenMP applications. In: 22nd Asia and South Pacific Design Automation Conference, pp. 659–665. IEEE, January 2017Google Scholar
  20. 20.
    Sun, J., Guan, N., Wang, Y., He, Q., Yi, W.: Scheduling and analysis of real-time OpenMP task systems with tied tasks. In: Proceedings of Real-Time Systems Symposium (2017)Google Scholar
  21. 21.
    Kroening, D., Poetzl, D., Schrammel, P., Wachter, B.: Sound static deadlock analysis for C/Pthreads. In: 31st International Conference on Automated Software Engineering, pp. 379–390. IEEE, September 2016Google Scholar
  22. 22.
    Ma, H., Diersen, S.R., Wang, L., Liao, C., Quinlan, D., Yang, Z.: Symbolic analysis of concurrency errors in OpenMP programs. In: 42nd International Conference on Parallel Processing, pp. 510–516. IEEE, October 2013Google Scholar
  23. 23.
    Basupalli, V., Yuki, T., Rajopadhye, S., Morvan, A., Derrien, S., Quinton, P., Wonnacott, D.: ompVerify: polyhedral analysis for the OpenMP programmer. In: Chapman, B.M., Gropp, W.D., Kumaran, K., Müller, M.S. (eds.) IWOMP 2011. LNCS, vol. 6665, pp. 37–53. Springer, Heidelberg (2011). Scholar
  24. 24.
    Royuela, S., Ferrer, R., Caballero, D., Martorell, X.: Compiler analysis for OpenMP tasks correctness. In: 12th International Conference on Computing Frontiers, p. 7. ACM, May 2015Google Scholar
  25. 25.
    Evangelista, S., Kaiser, C., Pradat-Peyre, J.-F., Rousseau, P.: Quasar: a new tool for concurrent Ada programs analysis. In: Rosen, J.-P., Strohmeier, A. (eds.) Ada-Europe 2003. LNCS, vol. 2655, pp. 168–181. Springer, Heidelberg (2003). Scholar
  26. 26.
    Fechete, R., Kienesberger, G., Blieberger, J.: A framework for CFG-based static program analysis of Ada programs. In: Kordon, F., Vardanega, T. (eds.) Ada-Europe 2008. LNCS, vol. 5026, pp. 130–143. Springer, Heidelberg (2008). Scholar
  27. 27.
    Qi, X., Xu, B.: An approach to slicing concurrent Ada programs based on program reachability graphs. Int. J. Comput. Sci. Netw. Secur. 6(1), 29–37 (2005)Google Scholar
  28. 28.
    Mohaqeqi, M., Abdullah, J., Guan, N., Yi, W.: Schedulability analysis of synchronous digraph real-time tasks. In: 28th Euromicro Conference on Real-Time Systems, pp. 176–186. IEEE, July 2016Google Scholar
  29. 29.
    Wang, B., Gao, H., Cheng, J.: Definition-use net and system dependence net generators for Ada 2012 programs and their applications. Ada User J. 38(1), 37–55 (2017)Google Scholar
  30. 30.
    Faria, J.M., Martins, J., Pinto, J.S.: An approach to model checking Ada programs. In: Brorsson, M., Pinho, L.M. (eds.) Ada-Europe 2012. LNCS, vol. 7308, pp. 105–118. Springer, Heidelberg (2012). Scholar
  31. 31.
    Holzmann, G.J.: The model checker SPIN. IEEE Trans. Softw. Eng. 23(5), 279–295 (1997)CrossRefGoogle Scholar
  32. 32.
    AdaCore, Altran, Astrium Space Transportation, CEA-LIST, ProVal at INRIA and Thales Communications: Project Hi-Lite: GNATprove (2017).
  33. 33.
  34. 34.
    Meyer, B.: Object-Oriented Software Construction, vol. 2. Prentice Hall, New York (1988)Google Scholar
  35. 35.
    Ada Resource Association: Ada Reference Manual, ISO/IEC 8652:2012(E) (2012).
  36. 36.
    Royuela, S., Duran, A., Liao, C., Quinlan, D.J.: Auto-scoping for OpenMP tasks. In: Chapman, B.M., Massaioli, F., Müller, M.S., Rorro, M. (eds.) IWOMP 2012. LNCS, vol. 7312, pp. 29–43. Springer, Heidelberg (2012). Scholar
  37. 37.
    Royuela, S., Duran, A., Martorell, X.: Compiler automatic discovery of OmpSs task dependencies. In: Kasahara, H., Kimura, K. (eds.) LCPC 2012. LNCS, vol. 7760, pp. 234–248. Springer, Heidelberg (2013). Scholar
  38. 38.
    Burns, A., Dobbing, B., Vardanega, T.: Guide for the use of the Ada Ravenscar Profile in high integrity systems. ACM SIGAda Ada Lett. 24(2), 1–74 (2004)CrossRefGoogle Scholar
  39. 39.
    Burns, A., Wellings, A.J.: HRT-HOOD: a structured design method for hard real-time systems. Real-Time Syst. 6(1), 73–114 (1994)CrossRefGoogle Scholar
  40. 40.
    Duran, A., Ayguadé, E., Badia, R.M., Labarta, J., Martinell, L., Martorell, X., Planas, J.: OmpSs: a proposal for programming heterogeneous multi-core architectures. Parallel Process. Lett. 21(02), 173–193 (2011)MathSciNetCrossRefGoogle Scholar
  41. 41.
    Lippe, E., van Oosterom, N.: Operation-based merging. In: Proceedings of the Fifth ACM SIGSOFT Symposium on Software Development Environments, SDE 5, pp. 78–87. ACM, New York (1992)Google Scholar

Copyright information

© Springer International Publishing AG, part of Springer Nature 2018

Authors and Affiliations

  • Sara Royuela
    • 1
  • Xavier Martorell
    • 1
  • Eduardo Quiñones
    • 1
  • Luis Miguel Pinho
    • 2
  1. 1.Barcelona Supercomputing CenterBarcelonaSpain
  2. 2.CISTER/INESC-TEC, ISEPPolytechnic Institute of PortoPortoPortugal

Personalised recommendations