Verification of Loop Parallelisations

  • Stefan Blom
  • Saeed Darabi
  • Marieke Huisman
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9033)

Abstract

Writing correct parallel programs becomes more and more difficult as the complexity and heterogeneity of processors increase. This issue is addressed by parallelising compilers. Various compiler directives can be used to tell these compilers where to parallelise. This paper addresses the correctness of such compiler directives for loop parallelisation. Specifically, we propose a technique based on separation logic to verify whether a loop can be parallelised. Our approach requires each loop iteration to be specified with the locations that are read and written in this iteration. If the specifications are correct, they can be used to draw conclusions about loop (in)dependences. Moreover, they also reveal where synchronisation is needed in the parallelised program. The loop iteration specifications can be verified using permission-based separation logic and seamlessly integrate with functional behaviour specifications. We formally prove the correctness of our approach and we discuss automated tool support for our technique. Additionally, we also discuss how the loop iteration contracts can be compiled into specifications for the code coming out of the parallelising compiler.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Baghdadi, R., Cohen, A., Guelton, S., Verdoolaege, S., Inoue, J., Grosser, T., Kouveli, G., Kravets, A., Lokhmotov, A., Nugteren, C., Waters, F., Donaldson, A.F.: PENCIL: Towards a Platform-Neutral Compute Intermediate Language for DSLs. CoRR, abs/1302.5586 (2013)Google Scholar
  2. 2.
    Barthe, G., Crespo, J.M., Gulwani, S., Kunz, C., Marron, M.: From relational verification to SIMD loop synthesis. In: PPoPP, pp. 123–134 (2013)Google Scholar
  3. 3.
    Blom, S., Darabi, S., Huisman, M.: Verifying parallel loops with separation logic. In: PLACES, pp. 47–53 (2014)Google Scholar
  4. 4.
    Blom, S., Huisman, M., Mihelčić, M.: Specification and verification of GPGPU programs. In: Science of Computer Programming (2014)Google Scholar
  5. 5.
    Bornat, R., Calcagno, C., O’Hearn, P., Parkinson, M.: Permission accounting in separation logic. In: Palsberg, J., Abadi, M. (eds.) POPL, pp. 259–270. ACM (2005)Google Scholar
  6. 6.
    Boyland, J.: Checking interference with fractional permissions. In: Cousot, R. (ed.) SAS 2003. LNCS, vol. 2694, pp. 55–72. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  7. 7.
    Dagum, L., Menon, R.: OpenMP: an industry standard API for shared-memory programming. IEEE Computational Science & Engineering 5(1), 46–55 (1998)CrossRefGoogle Scholar
  8. 8.
    Gedell, T., Hähnle, R.: Automating verification of loops by parallelization. In: LPAR, pp. 332–346 (2006)Google Scholar
  9. 9.
    Haack, C., Huisman, M., Hurlin, C.: Reasoning about java’s reentrant locks. In: Ramalingam, G. (ed.) APLAS 2008. LNCS, vol. 5356, pp. 171–187. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  10. 10.
    Hehner, E.: Specified blocks. In: Meyer, B., Woodcock, J. (eds.) VSTTE 2005. LNCS, vol. 4171, pp. 384–391. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  11. 11.
    Hoare, C.: An axiomatic basis for computer programming. Communications of the ACM 12(10), 576–580 (1969)CrossRefMATHGoogle Scholar
  12. 12.
    Juhasz, U., Kassios, I.T., Müller, P., Novacek, M., Schwerhoff, M., Summers, A.J.: Viper: A verification infrastructure for permission-based reasoning. Technical report, ETH Zurich (2014)Google Scholar
  13. 13.
  14. 14.
    Oancea, C.E., Rauchwerger, L.: Logical inference techniques for loop parallelization. SIGPLAN Not 47(6), 509–520 (2012)Google Scholar
  15. 15.
    O’Hearn, P.W.: Resources, concurrency and local reasoning. Theoretical Computer Science 375(1–3), 271–307 (2007)CrossRefMATHMathSciNetGoogle Scholar
  16. 16.
    Radoi, C., Dig, D.: Practical static race detection for java parallel loops. In: ISSTA, pp. 178–190 (2013)Google Scholar
  17. 17.
    Reynolds, J.: Separation logic: A logic for shared mutable data structures. In: Logic in Computer Science, pp. 55–74. IEEE Computer Society (2002)Google Scholar
  18. 18.
    Rus, S., Pennings, M., Rauchwerger, L.: Sensitivity analysis for automatic parallelization on multi-cores. In: Proceedings of the 21st Annual International Conference on Supercomputing, ICS, pp. 263–273. ACM (2007)Google Scholar
  19. 19.
    Salamanca, J., Mattos, L., Araujo, G.: Loop-carried dependence verification in openMP. In: DeRose, L., de Supinski, B.R., Olivier, S.L., Chapman, B.M., Müller, M.S. (eds.) IWOMP 2014. LNCS, vol. 8766, pp. 87–102. Springer, Heidelberg (2014)CrossRefGoogle Scholar
  20. 20.
  21. 21.
    Threading Building Blocks, http://threadingbuildingblocks.org
  22. 22.
    Tuch, H., Klein, G., Norrish, M.: Types, bytes, and separation logic. In: Hofmann, M., Felleisen, M. (eds.) POPL, pp. 97–108. ACM (2007)Google Scholar
  23. 23.

Copyright information

© Springer-Verlag Berlin Heidelberg 2015

Authors and Affiliations

  • Stefan Blom
    • 1
  • Saeed Darabi
    • 1
  • Marieke Huisman
    • 1
  1. 1.University of TwenteEnschedeThe Netherlands

Personalised recommendations