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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Bejleri, A., Hu, R., Yoshida, N.: Session-Based Programming for Parallel Algorithms. In: PLACES, EPTCS (2009)
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)
Casanova, H., Legrand, A., Robert, Y.: Parallel Algorithms. Chapman & Hall, Boca Raton (2008)
Deniélou, P.-M., Yoshida, N.: Dynamic Multirole Session Types. In: POPL 2011, pp. 435–446. ACM, New York (2011)
On-line appendix, http://www.doc.ic.ac.uk/~cn06/pub/2011/sj_parallel/
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)
Gropp, W., Lusk, E., Skjellum, A.: Using MPI: Portable Parallel Programming with the Message-Passing Interface. MIT Press, Cambridge (1999)
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)
Honda, K., Yoshida, N., Carbone, M.: Multiparty Asynchronous Session Types. In: POPL, pp. 273–284. ACM, New York (2008)
Hu, R.: Structured, Safe and High-level Communications Programming with Session Types. PhD thesis, Imperial College London (2010)
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)
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)
Message Passing Interface, http://www.mcs.anl.gov/research/projects/mpi/
MPJ Express homepage, http://mpj-express.org/
Ng, N.: High Performance Parallel Design based on Session Programming. MEng thesis, Department of Computing, Imperial College London (2010)
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)
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)
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)
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)
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)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)