180 likes | 318 Views
An Orchestration Language for Parallel Objects. Laxmikant Kal é , Mark Hills, Chao Huang Parallel Programming Lab University of Illinois. Outline. Motivation Charm++ and Virtualization Language Design Program Structure Orchestration Statements Communication Patterns Code Example
E N D
An Orchestration Language for Parallel Objects Laxmikant Kalé, Mark Hills, Chao Huang Parallel Programming Lab University of Illinois
Outline • Motivation • Charm++ and Virtualization • Language Design • Program Structure • Orchestration Statements • Communication Patterns • Code Example • Implementation • Jade and MSA • Future Work charm.cs.uiuc.edu
System implementation User View Motivation • Charm++/AMPI and migratable parallel objects (VPs) • User partitions work into parallel objects • RTS maps objects onto physical processors • Asynchronous method invocation on Chares and ChareArray elements charm.cs.uiuc.edu
Solid Solid Solid . . . Fluid Fluid Fluid 1 2 P . . . Solid1 Solid2 Solid3 Solidn . . . Fluid1 Fluid2 Fluidm Motivation (cont.) • Rocket simulation example under traditional MPI vs. Charm++/AMPI framework • Benefit: load balance, communication optimizations, modularity • Problem: flow of control buried in asynchronous method invocations charm.cs.uiuc.edu
Motivation (cont.) • Car-Parrinello Ab Initio Molecular Dynamics (CPAIMD) charm.cs.uiuc.edu
Language Design • Program consists of • Orchestration (.or) code • Chare arrays declaration • Orchestration with parallel constructs • Global flow of control • User code • User variables • Sequential methods charm.cs.uiuc.edu
Language Design (cont.) • Array creation classes MyArrayType : ChareArray1D; Pairs : ChareArray2D; end-classes vars myWorkers : MyArrayType[10]; myPairs : Pairs[8][8]; otherPairs : Pair[2][2]; end-vars • Invoking method on an array myWorkers[i].foo(); myWorkers.foo(); charm.cs.uiuc.edu
Language Design (cont.) • Orchestration Statements • forall forall i in myWorkers myWorkers[i].doWork(1,100); end-forall • Whole set of elements (abbreviated) forall in myWorkers doWork(1,100); end-forall • Subset of elements forall i:0:10:2 in myWorkers forall <i,j:0:8:2> in myPairs charm.cs.uiuc.edu
Language Design (cont.) • Orchestration Statements • overlap overlap forall i in worker1 ... end-forall forall i in worker2 ... end-forall end-overlap charm.cs.uiuc.edu
Language Design (cont.) • Communication Patterns • Input and output of method invocations forall i in workers <..,q[i],..>:=workers[i].f(..,p[(i+1)%N],..); end-forall • Method workers::fproduces the value q, and consumes value p. (p and q can overlap) • Producer-consumer model: Values of p and q can be used as soon as they are made available during the method execution • Produces value with same index i; e(i) for consumed value must be affine expression charm.cs.uiuc.edu
Language Design (cont.) • Communication Patterns • Point-to-point <p[i]> := A[i].f(..); <..> := B[i].g(p[i]); • Multicast <p[i]> := A[i].f(...); <...> := B[i].g(p[i-1], p[i], p[i+1]); charm.cs.uiuc.edu
Language Design (cont.) • Communication Patterns • Reduction <..,+e,..> := B[i,j].g(..); • All-to-All forall i in A <rows[i,j:0:N-1]> := A[i].1Dforward(...); end-forall forall k in B ... := B[k].2Dforward(rows[l:0:N-1, k]); end-forall charm.cs.uiuc.edu
Language Design (cont.) • Code Example • Jacobi 1D begin forall i in J <lb[i],rb[i]> := J[i].init(); end-forall while (e > threshold) forall i in J <+e, lb[i], rb[i]> := J[i].compute(rb[i-1],lb[i+1]); end-forall end-while end charm.cs.uiuc.edu
Language Design (cont.) • CPAIMD Revisited charm.cs.uiuc.edu
Implementation • Jade • Java-like parallel language supporting Chares and ChareArrays • Simple interface, everything in one file • Translated to Charm++ and compiled • Multi-phase Shared Array (MSA) • Restricted shared-memory abstraction • Provides global view of data to parallel objects • Accesses are divided into phases: read, write, accumulate • Reduced synchronization traffic charm.cs.uiuc.edu
Implementation (cont.) • Current implementation • Orchestration code (.or) file translated into Jade (.java) • Chare array declaration, control flow code, etc, will be generated • Sequential method definition and additional variables integrated into the target file • Translated as Jade, compiled and run as a Charm++ program charm.cs.uiuc.edu
Future Work • Design details • MSA vs. Message based communication • Implicit method: Inlining user code in orchestration • Support for sparse chare arrays • Implementation • Dependence analysis • Producer-consumer communication • Productivity • Interoperability with Charm++/AMPI • Integrate libraries charm.cs.uiuc.edu
Thank You Parallel Programming Lab at University of Illinois http://charm.cs.uiuc.edu charm.cs.uiuc.edu