Compiling first-order functions to session-typed parallel code
File(s)main.pdf (765.96 KB)
Accepted version
Author(s)
Castro-Perez, David
Yoshida, Nobuko
Type
Conference Paper
Abstract
Building correct and efficient message-passing parallel pro-grams still poses many challenges. The incorrect use ofmessage-passing constructs can introduce deadlocks, anda bad task decomposition will not achieve good speedups.Current approaches focus either on correctness or efficiency,but limited work has been done on ensuring both. In thispaper, we propose a new parallel programming framework,PAlg, which is a first-order language withparticipant anno-tationsthat ensuresdeadlock-freedom by construction.PAlgprograms are coupled with an abstraction of their communi-cation structure, aglobal typefrom the theory ofmultipartysession types(MPST). This global type serves as an outputfor the programmer to assess the efficiency of their achievedparallelisation.PAlgis implemented as an EDSL in Haskell,from which we can: 1. compile to low-level message-passingC code; 2. compile to sequential C code, or interpret as se-quential Haskell functions; and, 3. infer the communicationprotocol followed by the compiled message-passing program.We use the properties of the inferred global types to performbasic message reordering optimisations to the compiled Ccode. We prove theextensional equivalenceof our outputparallelisation, as well as theprotocol compliance. We eval-uate our approach on a number of benchmarks. We achievelinear speedups on a shared-memory 12-core machine, anda speedup of 16 on a 2-node, 24-core NUMA.
Date Issued
2020-02-22
Date Acceptance
2019-12-24
Citation
CC 2020: Proceedings of the 29th International Conference on Compiler Construction, 2020, pp.143-154
ISBN
9781450371209
Publisher
ACM
Start Page
143
End Page
154
Journal / Book Title
CC 2020: Proceedings of the 29th International Conference on Compiler Construction
Copyright Statement
Copyright © 2020 ACM. This is the author's version of the work. It is posted here by permission of ACM for your personal use. Not for redistribution. The definitive version was published at: https://dl.acm.org/doi/abs/10.1145/3377555.3377889
Sponsor
Engineering & Physical Science Research Council (E
Engineering & Physical Science Research Council (E
Engineering & Physical Science Research Council (EPSRC)
Engineering & Physical Science Research Council (EPSRC)
Engineering & Physical Science Research Council (E
Engineering & Physical Science Research Council (EPSRC)
Grant Number
ERI 025567 (EP/K034413/1)
PO 20131167
EP/K011715/1
EP/N027833/1
20103649
EP/T006544/1
Source
ACM SIGPLAN 2020 International Conference on Compiler Construction (CC 2020)
Publication Status
Published
Start Date
2020-02-22
Finish Date
2020-02-23
Coverage Spatial
San Diego, CA, USA