Skip to Content.
Sympa Menu

charm - Re: [charm] [ppl] [ppl-local] Q on Entry method

charm AT lists.cs.illinois.edu

Subject: Charm++ parallel programming system

List archive

Re: [charm] [ppl] [ppl-local] Q on Entry method


Chronological Thread 
  • From: Phil Miller <mille121 AT illinois.edu>
  • To: Nikhil Jain <nikhil.life AT gmail.com>
  • Cc: Charm Mailing List <charm AT cs.illinois.edu>
  • Subject: Re: [charm] [ppl] [ppl-local] Q on Entry method
  • Date: Fri, 28 Dec 2012 13:55:16 -0600
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/charm/>
  • List-id: CHARM parallel programming system <charm.cs.uiuc.edu>

On Fri, Dec 28, 2012 at 1:43 PM, Nikhil Jain
<nikhil.life AT gmail.com>
wrote:
> I think you have mis-interpreted my question - I knew how SDAG works. The
> question is different - let me try to rephrase it.
>
> 1 When a sdag method is being executed (which in turn is a series of
> expected message flow), can a method which is not the next method as per
> sdag flow be executed? If yes, what is restriction on such a message (am
> sure at least it can't be a method which appears in the message flow of
> sdag - how does Charm know?).

Yes, other methods can execute. The runtime delivers a message to a
particular entry method. That entry method's body runs.

If the entry method was defined by the developer in a block of C++
code, then there's no constraint - that block of C++ code will execute
when the message gets delivered. SDAG doesn't say anything about
methods it wasn't used to define.

If the entry method was defined by a when clause in SDAG, then charmxi
generated code *in that entry method* to decide what to do when a
message gets delivered to it. If a flow of control has reached it, the
flow of control proceeds through the subsequent block of code. If a
flow of control hasn't reached it, then the generated code buffers the
message. In a sense, a when clause is like a blocking receive - both
the incoming message and the local flow of control have to reach it
before code following it executes.

All of this is handled by generated code in the chare's entry methods.
None of it is handled by the runtime. You can see all of this code
(it's not too hard to follow) in the generated def.h file for some
chare class with SDAG code.

> 2 If an sdag method is not being executed, can an entry method which is
> defined using "when" inside an sdag method be executed? If yes, what if
> the message which triggered the execution was meant for consumption in an
> sdag method which would have been invoked soon the chare - is it
> programmer's responsibility to ensure that it doesn't happen?

As described above, the entry method *will* execute. The first thing
in its body is a check whether there's any trigger waiting on it. If
there isn't, the generated code buffers the message so that a future
trigger might find it. That is the essence of what SDAG provides -
sequential flow of control.




Archive powered by MHonArc 2.6.16.

Top of Page