Locality and Singularity for Store-Atomic Memory Models

  • Egor Derevenetc
  • Roland Meyer
  • Sebastian Schweizer
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10299)


Robustness is a correctness notion for concurrent programs running under relaxed consistency models. The task is to check that the relaxed behavior coincides (up to traces) with sequential consistency (SC). Although computationally simple on paper (robustness has been shown to be PSPACE-complete for TSO, PGAS, and Power), building a practical robustness checker remains a challenge. The problem is that the various relaxations lead to a dramatic number of computations, only few of which violate robustness.

In the present paper, we set out to reduce the search space for robustness checkers. We focus on store-atomic consistency models and establish two completeness results. The first result, called locality, states that a non-robust program always contains a violating computation where only one thread delays commands. The second result, called singularity, is even stronger but restricted to programs without lightweight fences. It states that there is a violating computation where a single store is delayed.

As an application of the results, we derive a linear-size source-to-source translation of robustness to SC-reachability. It applies to general programs, regardless of the data domain and potentially with an unbounded number of threads and with unbounded buffers. We have implemented the translation and verified, for the first time, PGAS algorithms in a fully automated fashion. For TSO, our analysis outperforms existing tools.


Global Memory Consistency Model Concurrent Program Sequential Consistency Helper Thread 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. 1.
    Abdulla, P.A., Atig, M.F., Chen, Y.-F., Leonardsson, C., Rezine, A.: Counter-example guided fence insertion under TSO. In: Flanagan, C., König, B. (eds.) TACAS 2012. LNCS, vol. 7214, pp. 204–219. Springer, Heidelberg (2012). doi: 10.1007/978-3-642-28756-5_15 CrossRefGoogle Scholar
  2. 2.
    Abdulla, P.A., Atig, M.F., Ngo, T.-P.: The best of both worlds: trading efficiency and optimality in fence insertion for TSO. In: Vitek, J. (ed.) ESOP 2015. LNCS, vol. 9032, pp. 308–332. Springer, Heidelberg (2015). doi: 10.1007/978-3-662-46669-8_13 CrossRefGoogle Scholar
  3. 3.
    Alglave, J., Kroening, D., Nimal, V., Poetzl, D.: Don’t sit on the fence – a static analysis approach to automatic fence insertion. In: Biere, A., Bloem, R. (eds.) CAV 2014. LNCS, vol. 8559, pp. 508–524. Springer, Cham (2014). doi: 10.1007/978-3-319-08867-9_33 Google Scholar
  4. 4.
    Alglave, J., Kroening, D., Nimal, V., Tautschnig, M.: Software verification for weak memory via program transformation. In: Felleisen, M., Gardner, P. (eds.) ESOP 2013. LNCS, vol. 7792, pp. 512–532. Springer, Heidelberg (2013). doi: 10.1007/978-3-642-37036-6_28 CrossRefGoogle Scholar
  5. 5.
    Alglave, J., Kroening, D., Tautschnig, M.: Partial orders for efficient bounded model checking of concurrent software. In: Sharygina, N., Veith, H. (eds.) CAV 2013. LNCS, vol. 8044, pp. 141–157. Springer, Heidelberg (2013). doi: 10.1007/978-3-642-39799-8_9 CrossRefGoogle Scholar
  6. 6.
    Alglave, J., Maranget, L.: Stability in weak memory models. In: Gopalakrishnan, G., Qadeer, S. (eds.) CAV 2011. LNCS, vol. 6806, pp. 50–66. Springer, Heidelberg (2011). doi: 10.1007/978-3-642-22110-1_6 CrossRefGoogle Scholar
  7. 7.
    Alglave, J., Maranget, L., Sarkar, S., Sewell, P.: Fences in weak memory models. In: Touili, T., Cook, B., Jackson, P. (eds.) CAV 2010. LNCS, vol. 6174, pp. 258–272. Springer, Heidelberg (2010). doi: 10.1007/978-3-642-14295-6_25 CrossRefGoogle Scholar
  8. 8.
    Alglave, J., Maranget, L., Tautschnig, M.: Herding cats: modelling, simulation, testing, and data mining for weak memory. ACM TOPLAS 36(2), 7:1–7:74 (2014)CrossRefGoogle Scholar
  9. 9.
    Atig, M.F., Bouajjani, A., Burckhardt, S., Musuvathi, M.: What’s Decidable about Weak Memory Models? In: Seidl, H. (ed.) ESOP 2012. LNCS, vol. 7211, pp. 26–46. Springer, Heidelberg (2012). doi: 10.1007/978-3-642-28869-2_2 CrossRefGoogle Scholar
  10. 10.
    Atig, M.F., Bouajjani, A., Parlato, G.: Getting rid of store-buffers in TSO analysis. In: Gopalakrishnan, G., Qadeer, S. (eds.) CAV 2011. LNCS, vol. 6806, pp. 99–115. Springer, Heidelberg (2011). doi: 10.1007/978-3-642-22110-1_9 CrossRefGoogle Scholar
  11. 11.
    Bonachea, D.: GASNet specification, v1.1. Technical report UCB/CSD-02-1207, University of California, Berkeley (2002)Google Scholar
  12. 12.
    Bouajjani, A., Calin, G., Derevenetc, E., Meyer, R.: Lazy TSO reachability. In: Egyed, A., Schaefer, I. (eds.) FASE 2015. LNCS, vol. 9033, pp. 267–282. Springer, Heidelberg (2015). doi: 10.1007/978-3-662-46675-9_18 Google Scholar
  13. 13.
    Bouajjani, A., Derevenetc, E., Meyer, R.: Checking and enforcing robustness against TSO. In: Felleisen, M., Gardner, P. (eds.) ESOP 2013. LNCS, vol. 7792, pp. 533–553. Springer, Heidelberg (2013). doi: 10.1007/978-3-642-37036-6_29 CrossRefGoogle Scholar
  14. 14.
    Bouajjani, A., Meyer, R., Möhlmann, E.: Deciding robustness against total store ordering. In: Aceto, L., Henzinger, M., Sgall, J. (eds.) ICALP 2011. LNCS, vol. 6756, pp. 428–440. Springer, Heidelberg (2011). doi: 10.1007/978-3-642-22012-8_34 CrossRefGoogle Scholar
  15. 15.
    Burckhardt, S., Alur, R., Martin, M.M.K.: Bounded model checking of concurrent data types on relaxed memory models: a case study. In: Ball, T., Jones, R.B. (eds.) CAV 2006. LNCS, vol. 4144, pp. 489–502. Springer, Heidelberg (2006). doi: 10.1007/11817963_45 CrossRefGoogle Scholar
  16. 16.
    Burckhardt, S., Alur, R., Martin, M.: Checkfence: checking consistency of concurrent data types on relaxed memory models. In: PLDI, pp. 12–21. ACM (2007)Google Scholar
  17. 17.
    Burckhardt, S., Musuvathi, M.: Effective program verification for relaxed memory models. In: Gupta, A., Malik, S. (eds.) CAV 2008. LNCS, vol. 5123, pp. 107–120. Springer, Heidelberg (2008). doi: 10.1007/978-3-540-70545-1_12 CrossRefGoogle Scholar
  18. 18.
    Burnim, J., Sen, K., Stergiou, C.: Sound and complete monitoring of sequential consistency for relaxed memory models. In: Abdulla, P.A., Leino, K.R.M. (eds.) TACAS 2011. LNCS, vol. 6605, pp. 11–25. Springer, Heidelberg (2011). doi: 10.1007/978-3-642-19835-9_3 CrossRefGoogle Scholar
  19. 19.
    Calin, G., Derevenetc, E., Majumdar, R., Meyer, R.: A theory of partitioned global address spaces. In: FSTTCS, pp. 127–139 (2013)Google Scholar
  20. 20.
    Chapman, B., Curtis, T., Pophale, S., Poole, S., Kuehn, J., Koelbel, C., Smith, L.: Introducing OpenSHMEM: SHMEM for the PGAS community. In: PGAS, p. 2. ACM (2010)Google Scholar
  21. 21.
    UPC Consortium. UPC language specification v1.2. Technical report (2005)Google Scholar
  22. 22.
    Dan, A., Meshman, Y., Vechev, M., Yahav, E.: Effective abstractions for verification under relaxed memory models. In: D’Souza, D., Lal, A., Larsen, K.G. (eds.) VMCAI 2015. LNCS, vol. 8931, pp. 449–466. Springer, Heidelberg (2015). doi: 10.1007/978-3-662-46081-8_25 Google Scholar
  23. 23.
    Derevenetc, E., Meyer, R.: Robustness against power is PSPACE-complete. In: Esparza, J., Fraigniaud, P., Husfeldt, T., Koutsoupias, E. (eds.) ICALP 2014. LNCS, vol. 8573, pp. 158–170. Springer, Heidelberg (2014). doi: 10.1007/978-3-662-43951-7_14 Google Scholar
  24. 24.
    Derevenetc, E., Meyer, R., Schweizer, S.: Locality and singularity for store-atomic memory models (2017). arXiv:1703.04603
  25. 25.
    Fang, X., Lee, J., Midkiff, S.: Automatic fence insertion for shared memory multiprocessing. In: SC, pp. 285–294. ACM (2003)Google Scholar
  26. 26.
    Global address space programming interface.
  27. 27.
    Hilfinger, P.N., Bonachea, D.O., Datta, K., Gay, D., Graham, S.L., Liblit, B.R., Pike, G., Su, J.Zh., Yelick, K.A.: Titanium language reference manual, version 2.19. Technical report UCB/EECS-2005-15, UC Berkeley (2005)Google Scholar
  28. 28.
    Kuperstein, M., Vechev, M., Yahav, E.: Automatic inference of memory fences. In: FMCAD, pp. 111–119. IEEE (2010)Google Scholar
  29. 29.
    Kuperstein, M., Vechev, M.T., Yahav, E.: Partial-coherence abstractions for relaxed memory models. In: PLDI, pp. 187–198. ACM (2011)Google Scholar
  30. 30.
    Kuperstein, M., Vechev, M.T., Yahav, E.: Automatic inference of memory fences. SIGACT News 43(2), 108–123 (2012)CrossRefGoogle Scholar
  31. 31.
    Lamport, L.: Time, clocks, and the ordering of events in a distributed system. CACM 21(7), 558–565 (1978)CrossRefzbMATHGoogle Scholar
  32. 32.
    Lamport, L.: How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Trans. Comput. 28(9), 690–691 (1979)CrossRefzbMATHGoogle Scholar
  33. 33.
    Machado, R., Lojewski, C.: The Fraunhofer virtual machine: a communication library and runtime system based on the RDMA model. Comput. Sci. Res. Dev. 23(3–4), 125–132 (2009)CrossRefGoogle Scholar
  34. 34.
    Marino, D., Singh, A., Millstein, T., Musuvathi, M., Narayanasamy, S.: A case for an SC-preserving compiler. In: PLDI, pp. 199–210. ACM (2011)Google Scholar
  35. 35.
    Meshman, Y., Dan, A., Vechev, M., Yahav, E.: Synthesis of memory fences via refinement propagation. In: Müller-Olm, M., Seidl, H. (eds.) SAS 2014. LNCS, vol. 8723, pp. 237–252. Springer, Cham (2014). doi: 10.1007/978-3-319-10936-7_15 Google Scholar
  36. 36.
    Nieplocha, J., Carpenter, B.: ARMCI: a portable remote memory copy library for distributed array libraries and compiler run-time systems. In: Rolim, J., et al. (eds.) IPPS 1999. LNCS, vol. 1586, pp. 533–546. Springer, Heidelberg (1999). doi: 10.1007/BFb0097937 CrossRefGoogle Scholar
  37. 37.
    Numrich, R.W., Reid, J.: Co-array Fortran for parallel programming. In: ACM Sigplan Fortran Forum, vol. 17, pp. 1–31. ACM (1998)Google Scholar
  38. 38.
    Sarkar, S., Sewell, P., Alglave, J., Maranget, L., Williams, D.: Understanding POWER multiprocessors. In: PLDI, pp. 175–186. ACM (2011)Google Scholar
  39. 39.
    Sewell, P., Sarkar, S., Owens, S., Nardelli, F.Z., Myreen, M.O.: x86-TSO: a rigorous and usable programmer’s model for x86 multiprocessors. CACM 53, 89–97 (2010)CrossRefGoogle Scholar
  40. 40.
    Shasha, D., Snir, M.: Efficient and correct execution of parallel programs that share memory. ACM TOPLAS 10(2), 282–312 (1988)CrossRefGoogle Scholar
  41. 41.
    Singh, A., Narayanasamy, S., Marino, D., Millstein, T., Musuvathi, M.: End-to-end sequential consistency. In: ISCA, pp. 524–535. IEEE (2012)Google Scholar
  42. 42.
    Vafeiadis, V., Zappa Nardelli, F.: Verifying fence elimination optimisations. In: Yahav, E. (ed.) SAS 2011. LNCS, vol. 6887, pp. 146–162. Springer, Heidelberg (2011). doi: 10.1007/978-3-642-23702-7_14 CrossRefGoogle Scholar
  43. 43.
    Weaver, D., Germond, T. (eds.): The SPARC Architecture Manual Version 9. PTR Prentice Hall, Upper Saddle River (1994)Google Scholar

Copyright information

© Springer International Publishing AG 2017

Authors and Affiliations

  • Egor Derevenetc
    • 1
    • 3
  • Roland Meyer
    • 2
  • Sebastian Schweizer
    • 3
  1. 1.Fraunhofer ITWMKaiserslauternGermany
  2. 2.TU BraunschweigBraunschweigGermany
  3. 3.TU KaiserslauternKaiserslauternGermany

Personalised recommendations