1 / 18

Charisma: Orchestrating Migratable Parallel Objects

Charisma: Orchestrating Migratable Parallel Objects. Chao Huang , Laxmikant Kale Parallel Programming Lab University of Illinois at Urbana-Champaign. Motivation. Complex structures in modern applications Large number of components Complicated interactions Parallel programming productivity

field
Download Presentation

Charisma: Orchestrating Migratable Parallel Objects

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Charisma: Orchestrating Migratable Parallel Objects Chao Huang, Laxmikant Kale Parallel Programming Lab University of Illinois at Urbana-Champaign

  2. Motivation • Complex structures in modern applications • Large number of components • Complicated interactions • Parallel programming productivity • Traditional SPMD paradigms break modularity • Object-based paradigm obscures global control flow • Goal • A language for expressing global view of control HPDC 2007

  3. Outline • Motivation • Expressing Flow of Control • Language Design and Implementation • Code Examples • Results • Performance and Productivity Studies • Related Work • Future Work HPDC 2007

  4. Example: MD MPI_Recv(angle_buf,…, ANGLE_SRC, ANGLE_TAG,…); /* calculate angle forces */ MPI_Recv(pair_left_buf,…, PAIR_LEFT_SRC, PAIR_LEFT_TAG,…); MPI_Recv(pair_right_buf,…, PAIR_RIGHT_SRC, PAIR_RIGHT_TAG,…); /* calculate pairwise forces */ • Structure of a simple MD simulation MPI_Recv(buf,..., MPI_ANY_SOURCE, MPI_ANY_TAG,…); switch(GET_TYPE(buf)){ case (FOR_ANGLE): /* calculate angle forces */ case (FOR_PAIR_LEFT): /* calculate pairwise forces */ case (FOR_PAIR_RIGHT): /* calculate pairwise forces */ } patch (cell) compute (cellpair) HPDC 2007

  5. Expressing Flow of Control • Charm++: fragmented in object code MainChare::MainChare{ cell.sendCoords();}MainChare::reduceEnergy(energy){ totalEnerty+= energy; if iter++ ( MAX_ITER cells.sendCoords(); else CkExit();} Cellpair::recvCoords(coords){ if not coords from both cells received buffer(coords); return; else // all coords ready force = calcForces(); for index in 2 cells cells(index).recvForces(forces);} Cell::sendCoords(){ for index in 26 neighbor cellpairs cellpairs(index).recvCoords(coords);}Cell::recvForces(forces){ totalforces += forces; if not all forces from all cellpairs received return; else // neighborhood reduction completed integrate(); mainProxy.reduceEnergy(energy);} HPDC 2007

  6. Charisma • Expressing global view of control • Parallel constructs in orchestration code • Sequential code separately in user C++ code • Features • High level abstraction of control • Separation of parallel constructs and sequential code • Generating Charm++ code • Automatic load balancing, adaptive overlap, etc HPDC 2007

  7. Language Design • foreach statement • Invokes method on all elements: object-level parallelism • Producer-consumer model • Sequential code unaware of source of input values and destination of output values • Data is sent out as soon as it becomes available • Various communication patterns • Control constructs: loop, if-then-else, overlap foreach i in workers workers[i].doWork(); end-foreach foreach i in workers (p[i]) <- workers[i].foo(); workers[i].bar(p[i+1]); end-foreach HPDC 2007

  8. Code Example: MD with Charisma • Orchestration code: global view of controlforeach i,j,k in cells (coords[i,j,k]) <- cells[i,j,k].produceCoords(); end-foreach for iter = 1 to MAX_ITER foreach i1,j1,k1,i2,j2,k2 in cellpairs (+forces[i1,j1,k1],+forces[i2,j2,k2]) <- cellpairs[i1,j1,k1,i2,j2,k2]. calcForces(coords[i1,j1,k1],coords[i2,j2,k2]); end-foreach foreach i,j,k in cells (coords[i,j,k],+energy) <- cells[i,j,k].integrate(forces[i,j,k]); end-foreach MDMain.updateEnergy(energy); end-for HPDC 2007

  9. Code Example: MD with Charisma • Orchestration code: global view of controlforeach i,j,k in cells (coords[i,j,k]) <- cells[i,j,k].produceCoords(); end-foreach for iter = 1 to MAX_ITER foreach i1,j1,k1,i2,j2,k2 in cellpairs (+forces[i1,j1,k1],+forces[i2,j2,k2]) <- cellpairs[i1,j1,k1,i2,j2,k2]. calcForces(coords[i1,j1,k1],coords[i2,j2,k2]); end-foreach foreach i,j,k in cells (coords[i,j,k],+energy) <- cells[i,j,k].integrate(forces[i,j,k]); end-foreach MDMain.updateEnergy(energy); end-for HPDC 2007

  10. Code Example: MD with Charisma • Orchestration code: global view of controlforeach i,j,k in cells (coords[i,j,k]) <- cells[i,j,k].produceCoords(); end-foreach for iter = 1 to MAX_ITER foreach i1,j1,k1,i2,j2,k2 in cellpairs (+forces[i1,j1,k1],+forces[i2,j2,k2]) <- cellpairs[i1,j1,k1,i2,j2,k2]. calcForces(coords[i1,j1,k1],coords[i2,j2,k2]); end-foreach foreach i,j,k in cells (coords[i,j,k],+energy) <- cells[i,j,k].integrate(forces[i,j,k]); end-foreach MDMain.updateEnergy(energy); end-for HPDC 2007

  11. Code Example: MD with Charisma • Sequential code void Cell::integrate(Force forces[], outport coords, outport energy){ for(int i=0;i<mySize;i++){ myAtoms[i].applyForces(forces[i]); myAtoms[i].update(); } produce(coords,myAtoms,mySize); double myEnergy = this->calculateEnergy(); reduce(energy, myEnergy, “+”); } HPDC 2007

  12. Language Implementation • Dependence analysis • Identify inports and outports • Organize dependence graph • Generate communications • Control transfer • Central control vs. Distributed control • Generated code optimization • Eliminating unnecessary memory copy • Migrating live variables • Library module support HPDC 2007

  13. Expressing Flow of Control (Cont.) • Example: Parallel 3D FFT • foreach x in planes1 • (pencils[x,*]) <- planes1[x].fft1d(); • end-foreach • foreach y in planes2 • planes2[y].fft2d(pencils[*,y]); • end-foreach HPDC 2007

  14. Results • Scalability Results 2D Jacobi (Size: 163842 on 4096 objects) 3D FFT (Size: 5123 on 256 objects) HPDC 2007

  15. Results • Productivity Study 2D Jacobi Wator HPDC 2007

  16. Related Work • Producer-consumer model • Fortran M • Composing from components • P-COM2 • Visual parallel dataflow languages • HeNCE and CODE • VPE HPDC 2007

  17. Future Work • Use dependence to optimize • Critical path analysis • Prefetch objects (out-of-core execution) • Assist communication optimizations • Orchestration for other fields • Stream-based applications HPDC 2007

  18. Thank You • Questions? • More details at http://charm.cs.uiuc.edu HPDC 2007

More Related