Skip to Content.
Sympa Menu

charm - Re: [charm] Multiple SDAG triggers

charm AT lists.cs.illinois.edu

Subject: Charm++ parallel programming system

List archive

Re: [charm] Multiple SDAG triggers


Chronological Thread 
  • From: "Mikida, Eric P" <mikida2 AT illinois.edu>
  • To: Jozsef Bakosi <jbakosi AT lanl.gov>
  • Cc: charm <charm AT lists.cs.illinois.edu>
  • Subject: Re: [charm] Multiple SDAG triggers
  • Date: Tue, 27 Jun 2017 01:41:17 +0000
  • Accept-language: en-US

Hi Jozsef,

If I understand the dependences correctly, I think what you actually want is
to use the overlap clause and have something like the following:

when B() {
overlap {
when A() serial { C(); }
serial { D(); }
}
}

This would wait for a single instance of B(), and then process the overlap
clause when B() arrives. The overlap allows for the blocks contained within
it to execute in either order. In this case, those to blocks are ‘when A()
serial { C(); }’, and ‘serial { D(); }’. This forces C to wait for both A and
B as intended, and D only has to wait for B.

When you have it structured this way, it also gets rid of the need for entry
methods f and g in your examples.

Let me know if that clears things up.
Eric Mikida

> On Jun 26, 2017, at 12:26 PM, Jozsef Bakosi
> <jbakosi AT lanl.gov>
> wrote:
>
> Hi folks,
>
> I feel like I have a serious gap in my understanding regarding SDAG
> triggers.
> Consider the following SDAG and code:
>
> SDAG:
>
> A -- C
> /
> B -/
>
> B -- D
>
> In words:
> * Task C can only start when both A and B have completed.
> * Task D can only start when B has completed.
>
> First implementation:
>
> .ci:
>
> entry void wait4C {
> when A_complete(), B_complete() serial { C(); } };
>
> entry void wait4D {
> when B_complete() serial { D(); } };
>
> .C:
>
> void f() {
> ...
> A_complete();
> }
>
> void g() {
> ...
> B_complete();
> B_complete();
> }
>
> Second implementation:
>
> .ci:
>
> entry void wait4C {
> when A_complete(), B1_complete() serial { C(); } };
>
> entry void wait4D {
> when B2_complete() serial { D(); } };
>
> .C:
>
> void f() {
> ...
> A_complete();
> }
>
> void g() {
> ...
> B1_complete();
> B2_complete();
> }
>
> Thus, the only difference is that in the second implementation the SDAG
> triggers
> have unique names B1_complete and B2_complete.
>
> My understanding, based on
> https://lists.cs.illinois.edu/lists/arc/charm/2016-09/msg00002.html, has
> been so
> that if I have two SDAG triggers (or messages) that will be consumed at two
> different when clauses, I have to put it in the queue twice, hence the code
> in
> g(). I also assumed that giving unique names to B1 and B2 in this case
> should
> not change the logic, since they will just be consumed once at two different
> when statements.
>
> I tried this at one part of my code and it worked, or at least I thought it
> did.
> However, I was just able to produce an example, doing the same at another
> part
> of my code, where the first one works while the second one hangs, which
> tells me
> that I'm missing something.
>
> Can someone please explain what I might be doing wrong? Or rather how I am
> thinking about this the wrong way? Also, can this behavior be influenced by
> other logic in the code?
>
> In case you want to reproduce the problem, please see
> https://github.com/quinoacomputing/quinoa/pull/146#discussion_r124055283.
>
> Thanks,
> Jozsef




Archive powered by MHonArc 2.6.19.

Top of Page