1 / 14

Using Charm++ with Arrays

Using Charm++ with Arrays. Laxmikant (Sanjay) Kale Parallel Programming Lab Department of Computer Science, UIUC charm.cs.uiuc.edu. Proxy Objects. Entry methods for each chare are invoked using proxy objects--lightweight handles to potentially remote chares. August 01, 2009.

nalsup
Download Presentation

Using Charm++ with Arrays

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. Using Charm++ with Arrays • Laxmikant (Sanjay) Kale • Parallel Programming Lab • Department of Computer Science, UIUC • charm.cs.uiuc.edu

  2. Proxy Objects • Entry methods for each chare are invoked using proxy objects--lightweight handles to potentially remote chares. August 01, 2009 Charm++ Tutorial

  3. Limitations of Plain Proxies • In a large program, keeping track of all the proxies is difficult • A simple proxy doesn’t tell you anything about the chare other than its type. • Managing collective operations like broadcast and reduce is complicated. August 01, 2009 Charm++ Tutorial

  4. Example: Molecular Dynamics • Patches: blocks of space containing particles. • Computes: chares which compute the interactions between particles in two patches. August 01, 2009 Charm++ Tutorial

  5. Example: Molecular Dynamics • We could write this program using just chares and plain proxies • But, it’ll be much simpler if we use Chare Arrays. note: you can find complete MD code in examples/charm++/Molecular2D in the Charm distribution. August 01, 2009 Charm++ Tutorial

  6. Chare Arrays • Arrays organize chares into indexed collections. • Each chare in the array has a proxy for the other array elements, accessible using simple syntax • sampleArray[i] // i’th proxy August 01, 2009 Charm++ Tutorial

  7. Array Dimensions • Anything can be used as array indices • integers • tuples • bit vectors • user-defined types August 01, 2009 Charm++ Tutorial

  8. Arrays in MD • array [2D] Patch { ... } • array [4D] Compute { ... } • note: arrays can be sparse x and y coordinates of patch x and y coordinates of both patches involved August 01, 2009 Charm++ Tutorial

  9. Managing Mapping • Arrays let the programmer control the mapping of array elements to PEs. • Round-robin, block-cyclic, etc • User defined mapping August 01, 2009 Charm++ Tutorial

  10. Broadcasts • Simple way to invoke the same entry method on each array element • Syntax: • // call on one element • sampleArray[i].method() • // broadcast to whole array • sampleArray.method() August 01, 2009 Charm++ Tutorial

  11. Broadcasts in MD • Used to fire off the first timestep after initialization is complete • // All chares are created, time to • // start the simulation • patchArray.start(); August 01, 2009 Charm++ Tutorial

  12. Reductions • No global flow of control, so each chare must contribute data independently using contribute(). • A user callback (created using CkCallback) is invoked when the reduction is complete. August 01, 2009 Charm++ Tutorial

  13. Reductions • Runtime system assembles reduction tree • User specifies reduction operation • At root of tree, a callback is performed on a specified chare August 01, 2009 Charm++ Tutorial

  14. Reductions in MD • Used to determine when all computes have been created. • // all local computes have been created • contribute(0, 0, CkReduction::concat, // do nothing • CkCallback( • CkIndex_Main::computeCreationDone(), • mainProxy)); Function to call Chare to handle callback function August 01, 2009 Charm++ Tutorial

More Related