skip to main content

CAMP: cost-aware multiparty session protocols

Published:13 November 2020Publication History
Skip Abstract Section

Abstract

This paper presents CAMP, a new static performance analysis framework for message-passing concurrent and distributed systems, based on the theory of multiparty session types (MPST). Understanding the run-time performance of concurrent and distributed systems is of great importance for the identification of bottlenecks and optimisation opportunities. In the message-passing setting, these bottlenecks are generally communication overheads and synchronisation times. Despite its importance, reasoning about these intensional properties of software, such as performance, has received little attention, compared to verifying extensional properties, such as correctness. Behavioural protocol specifications based on sessions types capture not only extensional, but also intensional properties of concurrent and distributed systems. CAMP augments MPST with annotations of communication latency and local computation cost, defined as estimated execution times, that we use to extract cost equations from protocol descriptions. CAMP is also extendable to analyse asynchronous communication optimisation built on a recent advance of session type theories. We apply our tool to different existing benchmarks and use cases in the literature with a wide range of communication protocols, implemented in C, MPI-C, Scala, Go, and OCaml. Our benchmarks show that, in most of the cases, we predict an upper-bound on the real execution costs with < 15% error.

Skip Supplemental Material Section

Supplemental Material

Auxiliary Presentation Video

This paper presents CAMP, a new static performance analysis framework for message-passing communicating systems based on multiparty session types (MPST). Understanding the run-time performance of systems is of great importance for the identification of bottlenecks and optimisation opportunities. However, reasoning about performance has received little attention compared to correctness. CAMP augments MPST with annotations of communication latency and local computation cost, defined as estimated execution times, that we use to extract cost equations from protocol descriptions. CAMP is also extendable to analyse asynchronous communication optimisation built on a recent advance of session type theories. We apply our tool to different existing benchmarks and use cases in the literature with a wide range of communication protocols, implemented in C, MPI-C, Scala, Go, and OCaml. In most of our benchmarks, CAMP's predictions are within a 15% of the real execution costs.

References

  1. Krste Asanovic, Rastislav Bodík, James Demmel, Tony Keaveny, Kurt Keutzer, John Kubiatowicz, Nelson Morgan, David A. Patterson, Koushik Sen, John Wawrzynek, David Wessel, and Katherine A. Yelick. 2009. A view of the parallel computing landscape. Commun. ACM 52, 10 ( 2009 ), 56-67. https://doi.org/10.1145/1562764.1562783 Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Martin Avanzini and Ugo Dal Lago. 2017. Automating sized-type inference for complexity analysis. PACMPL 1, ICFP ( 2017 ), 43 : 1-43 : 29. https://doi.org/10.1145/3110287 Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Massimo Bartoletti, Tiziana Cimoli, and Maurizio Murgia. 2017. Timed Session Types. Logical Methods in Computer Science 13, 4 ( 2017 ). https://doi.org/10.23638/LMCS-13 ( 4 :25) 2017 Google ScholarGoogle ScholarCross RefCross Ref
  4. Laura Bocchi, Julien Lange, and Nobuko Yoshida. 2015. Meeting Deadlines Together. In 26th International Conference on Concurrency Theory (LIPIcs, Vol. 42 ). Schloss Dagstuhl, 283-296.Google ScholarGoogle Scholar
  5. Laura Bocchi, Maurizio Murgia, Vasco Thudichum Vasconcelos, and Nobuko Yoshida. 2019. Asynchronous Timed Session Types-From Duality to Time-Sensitive Processes. In 28th European Symposium on Programming, ESOP 2019 (LNCS, Vol. 11423 ), Luís Caires (Ed.). Springer, 583-610. https://doi.org/10.1007/978-3-030-17184-1_21 Google ScholarGoogle ScholarCross RefCross Ref
  6. Laura Bocchi, Weizhen Yang, and Nobuko Yoshida. 2014. Timed Multiparty Session Types. In CONCUR 2014-Concurrency Theory-25th International Conference, CONCUR 2014, Rome, Italy, September 2-5, 2014. Proceedings (LNCS, Vol. 8704 ), Paolo Baldan and Daniele Gorla (Eds.). Springer, 419-434. https://doi.org/10.1007/978-3-662-44584-6_29 Google ScholarGoogle ScholarCross RefCross Ref
  7. Mario Bravetti, Marco Carbone, Julien Lange, Nobuko Yoshida, and Gianluigi Zavattaro. 2019. A Sound Algorithm for Asynchronous Session Subtyping. In 30th International Conference on Concurrency Theory (LIPIcs, Vol. 140 ). Schloss Dagstuhl-Leibniz-Zentrum für Informatik.Google ScholarGoogle Scholar
  8. Mario Bravetti, Marco Carbone, and Gianluigi Zavattaro. 2017. Undecidability of asynchronous session subtyping. Inf. Comput. 256 ( 2017 ), 300-320.Google ScholarGoogle Scholar
  9. Mario Bravetti, Marco Carbone, and Gianluigi Zavattaro. 2018. On the boundary between decidability and undecidability of asynchronous session subtyping. Theor. Comput. Sci. 722 ( 2018 ), 19-51. https://doi.org/10.1016/j.tcs. 2018. 02.010 Google ScholarGoogle ScholarCross RefCross Ref
  10. Luís Caires and Frank Pfenning. 2010. Session Types as Intuitionistic Linear Propositions. In CONCUR 2010-Concurrency Theory, 21th International Conference, CONCUR 2010, Paris, France, August 31-September 3, 2010. Proceedings (LNCS, Vol. 6269 ), Paul Gastin and François Laroussinie (Eds.). Springer, 222-236. https://doi.org/10.1007/978-3-642-15375-4_16 Google ScholarGoogle ScholarCross RefCross Ref
  11. Luís Caires, Frank Pfenning, and Bernardo Toninho. 2016. Linear logic propositions as session types. Mathematical Structures in Computer Science 26, 3 ( 2016 ), 367-423. https://doi.org/10.1017/S0960129514000218 Google ScholarGoogle ScholarCross RefCross Ref
  12. David Castro, Raymond Hu, Sung-Shik Jongmans, Nicholas Ng, and Nobuko Yoshida. 2019. Distributed Programming using Role-Parametric Session Types in Go (POPL'19). ACM, New York, NY, USA, 12 pages.Google ScholarGoogle Scholar
  13. David Castro-Perez and Nobuko Yoshida. 2020a. CAMP: Cost-Aware Multiparty Session Protocols. arXiv: 2010. 04449 [cs.PL].Google ScholarGoogle Scholar
  14. David Castro-Perez and Nobuko Yoshida. 2020b. Compiling First-Order Functions to Session-Typed Parallel Code. In Proc. of the 29th Int. Conf. on Compiler Construction (CC2020) (San Diego, CA, USA) ( CC 2020). ACM, New York, NY, USA, 143-154. https://doi.org/10.1145/3377555.3377889 Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Tzu-Chun Chen, Mariangiola Dezani-Ciancaglini, Alceste Scalas, and Nobuko Yoshida. 2017. On the Preciseness of Subtyping in Session Types. LMCS 13 ( 2017 ), 1-62. Issue 2.Google ScholarGoogle Scholar
  16. Tzu-Chun Chen, Mariangiola Dezani-Ciancaglini, and Nobuko Yoshida. 2014. On the Preciseness of Subtyping in Session Types. In PPDP. ACM Press, 135-146.Google ScholarGoogle Scholar
  17. Mario Coppo, Mariangiola Dezani-Ciancaglini, Luca Padovani, and Nobuko Yoshida. 2015. A Gentle Introduction to Multiparty Asynchronous Session Types. In 15th International School on Formal Methods for the Design of Computer, Communication and Software Systems: Multicore Programming (LNCS, Vol. 9104 ). Springer, 146-178.Google ScholarGoogle ScholarCross RefCross Ref
  18. Ankush Das, Jan Hofmann, and Frank Pfenning. 2018a. Parallel complexity analysis with temporal session types. PACMPL 2, ICFP ( 2018 ), 91 : 1-91 : 30. https://doi.org/10.1145/3236786 Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Ankush Das, Jan Hofmann, and Frank Pfenning. 2018b. Work Analysis with Resource-Aware Session Types. In Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2018, Oxford, UK, July 09-12, 2018, Anuj Dawar and Erich Grädel (Eds.). ACM, 305-314. https://doi.org/10.1145/3209108.3209146 Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Romain Demangeon and Kohei Honda. 2012. Nested Protocols in Session Types. In CONCUR 2012-Concurrency Theory, Maciej Koutny and Irek Ulidowski (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 272-286.Google ScholarGoogle Scholar
  21. Romain Demangeon and Nobuko Yoshida. 2015. On the Expressiveness of Multiparty Sessions. In FSTTCS 2015 (LIPIcs, Vol. 45 ), Prahladh Harsha and G. Ramalingam (Eds.). Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, 560-574. https://doi.org/10.4230/LIPIcs.FSTTCS. 2015.560 Google ScholarGoogle ScholarCross RefCross Ref
  22. Pierre-Malo Deniélou and Nobuko Yoshida. 2013. Multiparty Compatibility in Communicating Automata: Characterisation and Synthesis of Global Session Types. In Automata, Languages, and Programming-40th International Colloquium, ICALP 2013, Riga, Latvia, July 8-12, 2013, Proceedings, Part II (LNCS, Vol. 7966 ), Fedor V. Fomin, Rusins Freivalds, Marta Z. Kwiatkowska, and David Peleg (Eds.). Springer, 174-186. https://doi.org/10.1007/978-3-642-39212-2_18 Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Pierre-Malo Deniélou, Nobuko Yoshida, Andi Bejleri, and Raymond Hu. 2012. Parameterised Multiparty Session Types. Logical Methods in Computer Science 8, 4 ( 2012 ). https://doi.org/10.2168/LMCS-8( 4 :6) 2012 Google ScholarGoogle ScholarCross RefCross Ref
  24. Mariangiola Dezani-Ciancaglini, Silvia Ghilezan, Svetlana Jaksic, Jovanka Pantovic, and Nobuko Yoshida. 2016. Denotational and Operational Preciseness of Subtyping: A Roadmap. In Theory and Practice of Formal Methods-Essays Dedicated to Frank de Boer on the Occasion of His 60th Birthday. 155-172. https://doi.org/10.1007/978-3-319-30734-3_12 Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Julia Gabet and Nobuko Yoshida. 2020. Static Race Detection and Mutex Safety and Liveness for Go Programs (LIPIcs). Schloss Dagstuhl-Leibniz-Zentrum für Informatik. To appear in ECOOP' 20.Google ScholarGoogle Scholar
  26. Simon Gay and Antonio Ravara (Eds.). 2017. Behavioural Types: from Theory to Tools. River Publishers.Google ScholarGoogle Scholar
  27. Silvia Ghilezan, Jovanka Pantovic, Ivan Prokic, Alceste Scalas, and Nobuko Yoshida. 2021. Precise Subtyping for Asynchronous Multiparty Sessions. Proc. ACM Program. Lang. POPL ( 2021 ). To appear in POPL' 21.Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Stéphane Gimenez and Georg Moser. 2016. The complexity of interaction. In Proceedings of the 43rd Annual ACM SIGPLANSIGACT Symposium on Principles of Programming Languages, POPL 2016, St. Petersburg, FL, USA, January 20-22, 2016, Rastislav Bodík and Rupak Majumdar (Eds.). ACM, 243-255. https://doi.org/10.1145/2837614.2837646 Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Brian Goetz, Tim Peierls, Joshua J. Bloch, Joseph Bowbeer, David Holmes, and Doug Lea. 2006. Java Concurrency in Practice. Addison-Wesley.Google ScholarGoogle Scholar
  30. Martin A. T. Handley, Niki Vazou, and Graham Hutton. 2019. Liquidate Your Assets: Reasoning about Resource Usage in Liquid Haskell. Proc. ACM Program. Lang. 4, POPL, Article 24 ( Dec. 2019 ), 27 pages. https://doi.org/10.1145/3371092 Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Jan Hofmann, Klaus Aehlig, and Martin Hofmann. 2012. Multivariate amortized resource analysis. ACM Trans. Program. Lang. Syst. 34, 3 ( 2012 ), 14 : 1-14 : 62. https://doi.org/10.1145/2362389.2362393 Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Jan Hofmann and Zhong Shao. 2015. Automatic Static Cost Analysis for Parallel Programs. In 24th European Symposium on Programming, ESOP 2015 (LNCS, Vol. 9032 ), Jan Vitek (Ed.). Springer, 132-157. https://doi.org/10.1007/978-3-662-46669-8_6 Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Kohei Honda, Nobuko Yoshida, and Marco Carbone. 2008. Multiparty Asynchronous Session Types. In Proc. of 35th Symp. on Princ. of Prog. Lang. (San Francisco, California, USA) ( POPL '08). ACM, New York, NY, USA, 273-284. https: //doi.org/10.1145/1328438.1328472 Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Raymond Hu. 2017. Distributed Programming Using Java APIs Generated from Session Types. Behavioural Types: from Theory to Tools ( 2017 ), 287-308.Google ScholarGoogle Scholar
  35. Raymond Hu and Nobuko Yoshida. 2017. Explicit Connection Actions in Multiparty Session Types. In 20th Int. Conf. on Fundamental Approaches to Software Engineering, FASE 2017 (LNCS, Vol. 10202 ), Marieke Huisman and Julia Rubin (Eds.). Springer, 116-133. https://doi.org/10.1007/978-3-662-54494-5_7 Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. John Hughes, Lars Pareto, and Amr Sabry. 1996. Proving the Correctness of Reactive Systems Using Sized Types. In Conference Record of POPL'96: The 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Papers Presented at the Symposium, St. Petersburg Beach, Florida, USA, January 21-24, 1996, Hans-Juergen Boehm and Guy L. Steele Jr. (Eds.). ACM Press, 410-423. https://doi.org/10.1145/237721.240882 Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Keigo Imai, Rumyana Neykova, Nobuko Yoshida, and Shoji Yuen. 2020. Multiparty Session Programming with Global Protocol Combinators. https://github.com/keigoi/ocaml-mpst (LIPIcs). Schloss Dagstuhl-Leibniz-Zentrum für Informatik. To appear in ECOOP' 20.Google ScholarGoogle Scholar
  38. Shams M. Imam and Vivek Sarkar. 2014. Savina-An Actor Benchmark Suite: Enabling Empirical Evaluation of Actor Libraries. In Proc. of the 4th Int. Workshop on Programming Based on Actors Agents & Decentralized Control (Portland, Oregon, USA) (AGERE! ' 14 ). Association for Computing Machinery, New York, NY, USA, 67-80.Google ScholarGoogle Scholar
  39. Guoliang Jin, Linhai Song, Xiaoming Shi, Joel Scherpelz, and Shan Lu. 2012. Understanding and detecting real-world performance bugs. In ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ' 12, Beijing, China-June 11-16, 2012, Jan Vitek, Haibo Lin, and Frank Tip (Eds.). ACM, 77-88. https://doi.org/10.1145/2254064.2254075 Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. K. Krommydas et al. 2016. OpenDwarfs: Characterization of Dwarf-Based Benchmarks on Fixed and Reconfigurable Architectures. J Sign Process Syst 85 ( 2016 ), 373--392.Google ScholarGoogle Scholar
  41. Pavel Krčál and Wang yi. 2006. Communicating Timed Automata: The More Synchronous, the More Dificult to Verify. 249-262. https://doi.org/10.1007/11817963_24 Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Julien Lange, Nicholas Ng, Bernardo Toninho, and Nobuko Yoshida. 2018. A Static Verification Framework for Message Passing in Go using Behavioural Types. In 40th International Conference on Software Engineering. ACM, 1137-1148.Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Julien Lange and Nobuko Yoshida. 2017. On the Undecidability of Asynchronous Session Subtyping. In 20th International Conference on Foundations of Software Science and Computation Structures (LNCS, Vol. 10203 ). Springer, 441-457.Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Doug Lea. 1997. Concurrent programming in Java-design principles and patterns. Addison-Wesley-Longman.Google ScholarGoogle Scholar
  45. Dimitris Mostrous and Nobuko Yoshida. 2009. Session-Based Communication Optimisation for Higher-Order Mobile Processes. In Typed Lambda Calculi and Applications, 9th International Conference, TLCA 2009, Brasilia, Brazil, July 1-3, 2009. Proceedings (Lecture Notes in Computer Science, Vol. 5608 ), Pierre-Louis Curien (Ed.). Springer, 203-218. https: //doi.org/10.1007/978-3-642-02273-9_16 Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Dimitris Mostrous and Nobuko Yoshida. 2015. Session Typing and Asynchronous Subtying for Higher-Order π-Calculus. Info.& Comp. 241 ( 2015 ), 227-263.Google ScholarGoogle Scholar
  47. Dimitris Mostrous, Nobuko Yoshida, and Kohei Honda. 2009. Global Principal Typing in Partially Commutative Asynchronous Sessions. In ESOP (LNCS, Vol. 5502 ). Springer, 316-332.Google ScholarGoogle Scholar
  48. Rumyana Neykova, Laura Bocchi, and Nobuko Yoshida. 2017. Timed Runtime Monitoring for Multiparty Conversations. FAOC ( 2017 ), 1-34.Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Nicholas Ng, José Gabriel de Figueiredo Coutinho, and Nobuko Yoshida. 2015. Protocols by Default-Safe MPI Code Generation Based on Session Types. In 24th Int. Conf. on Compiler Construction, CC 2015 (LNCS, Vol. 9031 ), Björn Franke (Ed.). Springer, 212-232. https://doi.org/10.1007/978-3-662-46663-6_11 Google ScholarGoogle ScholarCross RefCross Ref
  50. Nicholas Ng and Nobuko Yoshida. 2016. Static deadlock detection for concurrent Go by global session graph synthesis. In Proceedings of the 25th International Conference on Compiler Construction, CC 2016, Barcelona, Spain, March 12-18, 2016, Ayal Zaks and Manuel V. Hermenegildo (Eds.). ACM, 174-184. https://doi.org/10.1145/2892208.2892232 Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. Nicholas Ng, Nobuko Yoshida, and Kohei Honda. 2012. Multiparty Session C: Safe Parallel Programming with Message Optimisation. In Objects, Models, Components, Patterns-50th International Conference, TOOLS 2012, Prague, Czech Republic, May 29-31, 2012. Proceedings (Lecture Notes in Computer Science, Vol. 7304 ), Carlo A. Furia and Sebastian Nanz (Eds.). Springer, 202-218. https://doi.org/10.1007/978-3-642-30561-0_15 Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. Benjamin C Pierce. 2002. Types and programming languages. The MIT Press.Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. Álvaro J. Rebón Portillo, Kevin Hammond, Hans-Wolfgang Loidl, and Pedro B. Vasconcelos. 2002. Cost Analysis Using Automatic Size and Time Inference. In Implementation of Functional Languages, 14th International Workshop, IFL 2002, Madrid, Spain, September 16-18, 2002, Revised Selected Papers (LNCS, Vol. 2670 ), Ricardo Pena and Thomas Arts (Eds.). Springer, 232-248. https://doi.org/10.1007/3-540-44854-3_15 Google ScholarGoogle ScholarCross RefCross Ref
  54. Thomas Rauber and Gudula Rünger. 2010. Parallel Programming-for Multicore and Cluster Systems. Springer. https: //doi.org/10.1007/978-3-642-04818-0 Google ScholarGoogle ScholarCross RefCross Ref
  55. The scribble authors. 2008. Scribble homepage. https://www.scribble.com.Google ScholarGoogle Scholar
  56. Gadi Taubenfeld. 2006. Synchronization algorithms and concurrent programming. Pearson Education.Google ScholarGoogle Scholar
  57. USENIX. 2020. Double-Bufering Algorithm (web). https://www.usenix.org/legacy/publications/library/proceedings/ usenix02/full_papers/huang/huang_html/node8.html.Google ScholarGoogle Scholar
  58. Pedro B. Vasconcelos. 2008. Space cost analysis using sized types. Ph.D. Dissertation. University of St Andrews, UK. http://hdl.handle. net/10023/564Google ScholarGoogle Scholar
  59. Nobuko Yoshida, Vasco Thudichum Vasconcelos, Hervé Paulino, and Kohei Honda. 2008. Session-Based Compilation Framework for Multicore Programming. In Formal Methods for Components and Objects, 7th International Symposium, FMCO 2008, Sophia Antipolis, France, October 21-23, 2008, Revised Lectures (Lecture Notes in Computer Science, Vol. 5751 ), Frank S. de Boer, Marcello M. Bonsangue, and Eric Madelaine (Eds.). Springer, 226-246. https://doi.org/10.1007/978-3-642-04167-9_12 Google ScholarGoogle ScholarDigital LibraryDigital Library
  60. Fangyi Zhou, Francisco Ferreira, Raymond Hu, Rumyana Neykova, and Nobuko Yoshida. 2020. Statically Verified Refinements for Multiparty Protocols. ( 2020 ). Conditionally Accepted by OOPSLA '20, Preprint on https://www.doc.ic.ac.uk/~fz315/ oopsla20-preprint.pdf.Google ScholarGoogle Scholar

Index Terms

  1. CAMP: cost-aware multiparty session protocols

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!