Skip to main content

Safe Parallel Programming with Session Java

  • Conference paper
Coordination Models and Languages (COORDINATION 2011)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 6721))

Included in the following conference series:

Abstract

The session-typed programming language Session Java (SJ) has proved to be an effective tool for distributed programming, promoting structured programming for communications and compile-time safety. This paper investigates the use of SJ for session-typed parallel programming, and introduces new language primitives for chained iteration and multi-channel communication. These primitives allow the efficient coordination of parallel computation across multiple processes, thus enabling SJ to express the complex communication topologies often used by parallel algorithms. We demonstrate that the new primitives yield clearer and safer code for pipeline, ring and mesh topologies through implementations of representative parallel algorithms. We then present a semantics and session typing system including the new primitives, and prove type soundness and deadlock-freedom for our implementations. The benchmark results show that the new SJ is substantially faster than the original SJ and performs competitively against MPJ Express used as reference.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Bejleri, A., Hu, R., Yoshida, N.: Session-Based Programming for Parallel Algorithms. In: PLACES, EPTCS (2009)

    Google Scholar 

  2. Bocchi, L., Honda, K., Tuosto, E., Yoshida, N.: A theory of design-by-contract for distributed multiparty interactions. In: Gastin, P., Laroussinie, F. (eds.) CONCUR 2010. LNCS, vol. 6269, pp. 162–176. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  3. Casanova, H., Legrand, A., Robert, Y.: Parallel Algorithms. Chapman & Hall, Boca Raton (2008)

    MATH  Google Scholar 

  4. Deniélou, P.-M., Yoshida, N.: Dynamic Multirole Session Types. In: POPL 2011, pp. 435–446. ACM, New York (2011)

    Google Scholar 

  5. On-line appendix, http://www.doc.ic.ac.uk/~cn06/pub/2011/sj_parallel/

  6. Gay, S.J., Vasconcelos, V.T., Ravara, A., Gesbert, N., Caldeira, A.Z.: Modular Session Types for Distributed Object-Oriented Programming. In: POPL 2010, pp. 299–312. ACM, New York (2010)

    Google Scholar 

  7. Gropp, W., Lusk, E., Skjellum, A.: Using MPI: Portable Parallel Programming with the Message-Passing Interface. MIT Press, Cambridge (1999)

    MATH  Google Scholar 

  8. Honda, K., Vasconcelos, V.T., Kubo, M.: Language Primitives and Type Discipline for Structured Communication-Based Programming. In: Hankin, C. (ed.) ESOP 1998. LNCS, vol. 1381, pp. 122–138. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  9. Honda, K., Yoshida, N., Carbone, M.: Multiparty Asynchronous Session Types. In: POPL, pp. 273–284. ACM, New York (2008)

    Google Scholar 

  10. Hu, R.: Structured, Safe and High-level Communications Programming with Session Types. PhD thesis, Imperial College London (2010)

    Google Scholar 

  11. Hu, R., Kouzapas, D., Pernet, O., Yoshida, N., Honda, K.: Type-Safe Eventful Sessions in Java. In: D’Hondt, T. (ed.) ECOOP 2010. LNCS, vol. 6183, pp. 329–353. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  12. Hu, R., Yoshida, N., Honda, K.: Session-Based Distributed Programming in Java. In: Vitek, J. (ed.) ECOOP 2008. LNCS, vol. 5142, pp. 516–541. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  13. Message Passing Interface, http://www.mcs.anl.gov/research/projects/mpi/

  14. MPJ Express homepage, http://mpj-express.org/

  15. Ng, N.: High Performance Parallel Design based on Session Programming. MEng thesis, Department of Computing, Imperial College London (2010)

    Google Scholar 

  16. Shafi, A., Carpenter, B., Baker, M.: Nested Parallelism for Multi-core HPC Systems using Java. Journal of Parallel and Distributed Computing 69(6), 532–545 (2009)

    Article  Google Scholar 

  17. Sivaramakrishnan, K.C., Nagaraj, K., Ziarek, L., Eugster, P.: Efficient Session Type Guided Distributed Interaction. In: Clarke, D., Agha, G. (eds.) COORDINATION 2010. LNCS, vol. 6116, pp. 152–167. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  18. Spring, J.H., Privat, J., Guerraoui, R., Vitek, J.: StreamFlex: High-Throughput Stream Programming in Java. In: OOPSLA 2007, pp. 211–228. ACM, New York (2007)

    Google Scholar 

  19. Vo, A., Vakkalanka, S., DeLisi, M., Gopalakrishnan, G., Kirby, R.M., Thakur, R.: Formal Verification of Practical MPI Programs. In: PPoPP 2009, pp. 261–270. ACM, New York (2009)

    Google Scholar 

  20. Yoshida, N., Deniélou, P.-M., Bejleri, A., Hu, R.: Parameterised Multiparty Session Types. In: Ong, C.-H.L. (ed.) FOSSACS 2010. LNCS, vol. 6014, pp. 128–145. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  21. Yoshida, N., Vasconcelos, V.T.: Language Primitives and Type Discipline for Structured Communication-Based Programming Revisited: Two Systems for Higher-Order Session Communication. ENTCS 171(4), 73–93 (2007)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 IFIP International Federation for Information Processing

About this paper

Cite this paper

Ng, N., Yoshida, N., Pernet, O., Hu, R., Kryftis, Y. (2011). Safe Parallel Programming with Session Java. In: De Meuter, W., Roman, GC. (eds) Coordination Models and Languages. COORDINATION 2011. Lecture Notes in Computer Science, vol 6721. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-21464-6_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-21464-6_8

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-21463-9

  • Online ISBN: 978-3-642-21464-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics