Space Efficient Breadth-First and Level Traversals of Consistent Global States of Parallel Programs

Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10548)


Enumerating consistent global states of a computation is a fundamental problem in parallel computing with applications to debugging, testing and runtime verification of parallel programs. Breadth-first search (BFS) enumeration is especially useful for these applications as it finds an erroneous consistent global state with the least number of events possible. The total number of executed events in a global state is called its rank. BFS also allows enumeration of all global states of a given rank or within a range of ranks. If a computation on n processes has m events per process on average, then the traditional BFS (Cooper-Marzullo and its variants) requires \(\mathcal {O}(\frac{m^{n-1}}{n})\) space in the worst case, whereas our algorithm performs the BFS requires \(\mathcal {O}(m^2n^2)\) space. Thus, we reduce the space complexity for BFS enumeration of consistent global states exponentially, and give the first polynomial space algorithm for this task. In our experimental evaluation of seven benchmarks, traditional BFS fails in many cases by exhausting the 2 GB heap space allowed to the JVM. In contrast, our implementation uses less than 60 MB memory and is also faster in many cases.


  1. 1.
    Alagappan, R., Ganesan, A., Patel, Y., Pillai, T.S., Arpaci-Dusseau, A.C., Arpaci-Dusseau, R.H.: Correlated crash vulnerabilities. In: 12th USENIX Symposium on Operating Systems Design and Implementation (OSDI 16), GA, pp. 151–167. USENIX Association (2016)Google Scholar
  2. 2.
    Alagar, S., Venkatesan, S.: Hierarchy in testing distributed programs. In: Fritzson, P.A. (ed.) AADEBUG 1993. LNCS, vol. 749, pp. 101–116. Springer, Heidelberg (1993). doi: 10.1007/BFb0019404 CrossRefGoogle Scholar
  3. 3.
    Alagar, S., Venkatesan, S.: Techniques to tackle state explosion in global predicate detection. IEEE Trans. Softw. Eng. 27, 412–417 (2001)CrossRefGoogle Scholar
  4. 4.
    Ball, T., Burckhardt, S., Coons, K.E., Musuvathi, M., Qadeer, S.: Preemption sealing for efficient concurrency testing. In: Esparza, J., Majumdar, R. (eds.) TACAS 2010. LNCS, vol. 6015, pp. 420–434. Springer, Heidelberg (2010). doi: 10.1007/978-3-642-12002-2_35 CrossRefGoogle Scholar
  5. 5.
    Bianco, L., Dell Olmo, P., Giordani, S.: An optimal algorithm to find the jump number of partially ordered sets. Comput. Optim. Appl. 8(2), 197–210 (1997)MathSciNetCrossRefzbMATHGoogle Scholar
  6. 6.
    Chandy, K.M., Lamport, L.: Distributed snapshots: determining global states of distributed systems. ACM Trans. Comput. Syst. 3(1), 63–75 (1985)CrossRefGoogle Scholar
  7. 7.
    Chang, Y., Garg, V.K.: Quicklex: a fast algorithm for consistent global states enumeration of distributed computations. In: 19th International Conference on Principles of Distributed Systems, OPODIS 2015, December 14–17, 2015, Rennes, France, pp. 25:1–25:17 (2015)Google Scholar
  8. 8.
    Chang, Y.-J., Garg, V.K.: A parallel algorithm for global states enumeration in concurrent systems. In: ACM SIGPLAN Notices, vol. 50, pp. 140–149. ACM (2015)Google Scholar
  9. 9.
    Chauhan, H., Garg, V.K.: Space efficient breadth-first and level traversals of consistent global states of parallel programs (extended version).
  10. 10.
    Chein, M., Habib, M.: The jump number of dags and posets: an introduction. Ann. Discrete Math. 9, 189–194 (1980)MathSciNetCrossRefzbMATHGoogle Scholar
  11. 11.
    Chen, F., Serbanuta, T.F., Roşu, G.: jPredictor: a predictive runtime analysis tool for java. In: Proceedings of the International Conference on Software Engineering, pp. 221–230 (2008)Google Scholar
  12. 12.
    Cooper, R., Marzullo, K.: Consistent detection of global predicates. In: Proceedings of the Workshop on Parallel and Distributed Debugging, Santa Cruz, CA, pp. 163–173, May 1991Google Scholar
  13. 13.
    Fidge, C.J.: Timestamps in message-passing systems that preserve the partial-ordering. In: Raymond, K. (ed.) Proceedings of the 11th Australian Computer Science Conference (ACSC), pp. 56–66, February 1988Google Scholar
  14. 14.
    Flanagan, C., Freund, S.N.: FastTrack: efficient and precise dynamic race detection. In: Proceedings of the Conference on Programming Language Design and Implementation, pp. 121–133 (2009)Google Scholar
  15. 15.
    Ganter, B.: Two basic algorithms in concept analysis. In: Kwuida, L., Sertkaya, B. (eds.) ICFCA 2010. LNCS, vol. 5986, pp. 312–340. Springer, Heidelberg (2010). doi: 10.1007/978-3-642-11928-6_22 CrossRefGoogle Scholar
  16. 16.
    Garg, V.K.: Enumerating global states of a distributed computation. In: Proceedings of the International Conference on Parallel and Distributed Computing Systems, pp. 134–139 (2003)Google Scholar
  17. 17.
    Garg, V.K., Waldecker, B.: Detection of weak unstable predicates in distributed programs. IEEE Trans. Parallel Distrib. Syst. 5(3), 299–307 (1994)CrossRefGoogle Scholar
  18. 18.
    Habib, M., Medina, R., Nourine, L., Steiner, G.: Efficient algorithms on distributive lattices. Discrete Appl. Math. 110(2–3), 169–187 (2001)MathSciNetCrossRefzbMATHGoogle Scholar
  19. 19.
    Huang, J., Zhang, C.: Persuasive prediction of concurrency access anomalies. In: Proceedings of the International Symposium on Software Testing and Analysis, pp. 144–154 (2011)Google Scholar
  20. 20.
    Jegou, R., Medina, R., Nourine, L.: Linear space algorithm for on-line detection of global predicates. In: Proceedings of the International Workshop on Structures in Concurrency Theory, pp. 175–189 (1995)Google Scholar
  21. 21.
    Lamport, L.: Time, clocks, and the ordering of events in a distributed system. Commun. ACM (CACM) 21(7), 558–565 (1978)CrossRefzbMATHGoogle Scholar
  22. 22.
    Lamport, L., et al.: Paxos made simple. ACM Sigact News 32(4), 18–25 (2001)Google Scholar
  23. 23.
    Lu, S., Tucek, J., Qin, F., Zhou, Y.: AVIO: detecting atomicity violations via access interleaving invariants. In: Proceedings of the International Conference on Architectural Support for Programming Languages and Operating Systems, pp. 37–48 (2006)Google Scholar
  24. 24.
    Mattern, F.: Virtual time and global states of distributed systems. In: Parallel and Distributed Algorithms: Proceedings of the Workshop on Distributed Algorithms (WDAG), pp. 215–226 (1989)Google Scholar
  25. 25.
    Musuvathi, M., Qadeer, S.: Iterative context bounding for systematic testing of multithreaded programs. In Proceedings of Conference on Programming Language Design and Implementation, pp. 446–455 (2007)Google Scholar
  26. 26.
    Pruesse, G., Ruskey, F.: Gray codes from antimatroids. Order 10, 239–252 (1993)MathSciNetCrossRefzbMATHGoogle Scholar
  27. 27.
    Song, W., Gkountouvas, T., Birman, K., Chen, Q., Xiao, Z.: The freeze-frame file system. In: ACM Symposium on Cloud Computing (SOCC) (2016)Google Scholar
  28. 28.
    Squire, M.B.: Enumerating the ideals of a poset. In: Ph.D. Dissertation, Department of Computer Science, North Carolina State University (1995)Google Scholar
  29. 29.
    Steiner, G.: An algorithm to generate the ideals of a partial order. Oper. Res. Lett. 5(6), 317–320 (1986)MathSciNetCrossRefzbMATHGoogle Scholar
  30. 30.
    Sysło, M.M.: Minimizing the jump number for partially ordered sets: a graph-theoretic approach. Order 1(1), 7–19 (1984)MathSciNetCrossRefzbMATHGoogle Scholar
  31. 31.
    von Praun, C., Gross, T.R.: Object race detection. In: Proceedings of the Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 70–82 (2001)Google Scholar

Copyright information

© Springer International Publishing AG 2017

Authors and Affiliations

  1. 1.University of Texas at AustinAustinUSA

Personalised recommendations