1
CnC-Babel
A Multi-Language Implementation of the Concurrent Collections model
Adrian Prantl
adrian@llnl.gov adrian@llnl.gov
LLNL
Shams Imam, Vivek Sarkar
shams@rice.edu, shams@rice.edu, vsarkar@rice.edu vsarkar@rice.edu
Motivation for Multi-language CnC Current CnC runtimes require steps - - PowerPoint PPT Presentation
CnC-Babel A Multi-Language Implementation of the Concurrent Collections model Shams Imam, Vivek Sarkar Adrian Prantl adrian@llnl.gov adrian@llnl.gov shams@rice.edu, shams@rice.edu, vsarkar@rice.edu vsarkar@rice.edu LLNL Rice University 1
1
adrian@llnl.gov adrian@llnl.gov
shams@rice.edu, shams@rice.edu, vsarkar@rice.edu vsarkar@rice.edu
2
Current CnC runtimes require steps be written in
Domain experts
may prefer other dynamic languages like Python may prefer reusing existing code (in another
Language interoperability issue!
3
LLNL's language
designed for fast,
handles generation
4
programming language-neutral interface
supports
5
First, define the interface in SIDL
import cncapi; package partitionstring version 1.0 { interface SpansInputCollection { string get(in CncTag tag); bool containsTag(in CncTag tag); } interface SpansOutputCollection { void put(in CncTag tag, in string value); } class SpansCollection implements-all SpansInputCollection, SpansOutputCollection { }
6
Next, use the Babel compiler with the SIDL file
generates code for skeleton and intermediate object
generates empty blocks expecting user code
generates code for stub and IOR user code uses the stub to make method calls into
7
Example flow while calling from Java into Python
8
HabaneroJava is a fork of IBM X10
Babel supports HJ!
9
HJ
10
HJ
Java/Python/C/C++/Fortran Java/Python/C/C++/Fortran
11
wrap and expose HJ Tag and Item collections require a well-defined type for a Tag for use in
require a native version of ConcurrentMap for
get() and put() on native Item Collections need
12
user writes textual description of CnC graph user annotates graph with extra information to be
user runs translator to generate code
user writes Step code and initialization logic user runs code using HJ
13
HJ/Java Python C++
14
Babel reports less than one percent overhead in
HJ-CnC-Babel impl. of Cholesky [2000×2000]
15
HJ-CnC-Babel runtime available:
code generation in progress
16
extended CnC-HJ runtime via Babel to allow
17