Charm overview - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

Charm overview

Description:

A user-defined C class. inherits from a system-defined class ... { CkPrintf('pi=: %f n', 4.0*count/100000); CkExit(); } piPart::piPart() { // declarations. ... – PowerPoint PPT presentation

Number of Views:14
Avg rating:3.0/5.0
Slides: 12
Provided by: laxmika
Learn more at: http://charm.cs.uiuc.edu
Category:
Tags: charm | class | overview

less

Transcript and Presenter's Notes

Title: Charm overview


1
Charm overview
  • L. V. Kale

2
Parallel Programming tasks
  • Decomposition (what to do in parallel)
  • Mapping
  • Scheduling (sequencing)
  • Machine dependent expression

3
Spectrum of parallel Languages
Leve l
MPI
Specialization
4
Charm
  • Data Driven Objects
  • Asynchronous method invocation
  • Object Arrays
  • Object Groups
  • global object with a representative on each PE
  • Prioritized scheduling

5
Data Driven Execution
Scheduler
Scheduler
Message Q
Message Q
6
Chares (Data driven Objects)
  • Regular C classes,
  • with some methods designated as remotely
    invokable (called entry methods)
  • entry methods have only one parameter of type
    message
  • Creation
  • CProxy_CckNew(msg)
  • Creates an instance of C on some pe
  • CProxy_CckNew(msg, pe)

7
Messages
  • A user-defined C class
  • inherits from a system-defined class
  • messages can be communicated to others as
    parameters
  • Has regular data fields
  • Declaration normal C,
  • inherit from a system defined class
  • Creation (just usual C)
  • MsgType m new MsgType

8
Remote method invocation
  • Proxy Classes
  • For each chare class, the system generates a
    proxy class. (C CProxy_C)
  • Each chare has a global ID (ChareID)
  • thishandle (analogous to this)
  • You can send thishandle in messages
  • Given a handle h, you can create a proxy
  • CProxy_C p(h) // or q new CProxy_C(h)
  • p.method(msg) // or q-gtmethod(msg)

9
Object Groups
  • A group of objects (chares)
  • with exactly one representative on each processor
  • A single Id for the group as a whole
  • invoke methods in a branch (asynchronously), all
    branches (broadcast), or in the local branch
  • creation
  • groupId CProxy_CckNew(msg)
  • remote invocation
  • CProxy_C p(groupId)
  • p.methodName(msg) // p.methodName(msg, peNum)
  • p.LocalBranch-gtf(.)

10
CkChareID mainhandle mainmain(CkArgMsg m)
int i, low 0 for (i0 ilt100 i)
new CProxy_piPart() responders 100 count
0 mainhandle thishandle // readonly
initialization void mainresults(DataMsg
msg) count msg-gtcount if (0
--responders) CkPrintf("pi f \n",
4.0count/100000) CkExit()
11
piPartpiPart() // declarations..
srand48((long) this) mySamples 100000/100
for (i 0 ilt mySamples i) x
drand48() y drand48() if ((xx yy)
lt 1.0) localCount DataMsg result
new DataMsg result-gtcount localCount
CProxy_main mainproxy(mainhandle)
mainproxy.results(result) delete this
Write a Comment
User Comments (0)
About PowerShow.com