Skip to Content.
Sympa Menu

charm - Re: [charm] [ppl] Using [sync] entry methods

charm AT lists.cs.illinois.edu

Subject: Charm++ parallel programming system

List archive

Re: [charm] [ppl] Using [sync] entry methods


Chronological Thread 
  • From: David Kunzman <kunzman2 AT illinois.edu>
  • To: Elliott Brossard <snowden AT cs.washington.edu>
  • Cc: charm AT cs.uiuc.edu
  • Subject: Re: [charm] [ppl] Using [sync] entry methods
  • Date: Thu, 18 Nov 2010 14:50:12 -0600
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/charm>
  • List-id: CHARM parallel programming system <charm.cs.uiuc.edu>

Hello Elliott,

   I'm not an expert on sync entry methods, but several people from PPL are at a conference at the moment, so I'll give it a shot.  I think there are two issues with the code that you sent.

   First, you should treat the constructor of the main chare object as being a bit special for other entry methods and even other constructors.  It is called while the runtime system is still in a startup phase (i.e. it's probably a bad idea to call a sync entry method from it, if it's even possible).

   Second, the way sync entry methods are intended to be called is by threaded entry methods.  My understanding of what should happen is basically this.  An threaded entry method calls a sync entry method, and in doing so, becomes suspended (i.e. the call blocks).  The sync entry method is executed.  The return value of the sync entry method is returned to the calling threaded entry method and the threaded entry method is reawakened to continue it's execution.

   Perhaps try the following.  In the main chare, call a second entry method from Main's constructor and make this new entry method threaded.  Once the main constructor returns, the Charm++ runtime should be fully initialized and the new entry method will be executed.  Then move the code that calls goToSleep() into the new threaded entry methods.  Hopefully that helps.

Thanks,
Dave K



On Thu, Nov 18, 2010 at 2:30 PM, Elliott Brossard <snowden AT cs.washington.edu> wrote:
Hello, both my advisor and I have been trying to use [sync] entry methods in Charm++ but without any luck. Here are the relevant bits of code:

From exclusive_chare.ci:
module exclusive_chare {
  array [1D] ExclusiveChare {
    entry ExclusiveChare();
    entry [sync] void goToSleep();
  };
};

From exclusive_chare.C:
void ExclusiveChare::goToSleep() {
    CkPrintf("Sleeping at index %d\n", thisIndex);

    for(int i = 0; i < 10; i ++)
        sleep(10);

    CkPrintf("Done sleeping at index %d\n", thisIndex);
}

From main.C:
Main::Main(CkArgMsg* msg) {
    int numChares = 10;
    mainProxy = thisProxy;

    exclusiveProxy = CProxy_ExclusiveChare::ckNew(numChares);
    for(int i = 0; i < 10; i ++) {
        CkPrintf("Calling sleep on chare %d\n", i);
        exclusiveProxy[i].goToSleep();
    }
}

However, when I compile and run the program, this is the output I see:
Charm++: scheduler running in netpoll mode.
Charm++> Running on 1 unique compute nodes (8-way SMP).
Charm++> Cpu topology info:
PE to node map: 0 0 0 0 0 0 0 0
Node to PE map:
Chip #0: 0 1 2 3 4 5 6 7
Charm++> cpu topology info is gathered in 0.010 seconds.
Calling sleep on chare 0

...after which there is no further output. It appears that Charm++ is blocking in a way that prevents the method from even being executed. Am I doing something wrong? If you could point me to a working example of [sync] entry methods that would be great.

Thank you,
Elliott Brossard
University of Washington
Department of Computer Science and Engineering


_______________________________________________
charm mailing list
charm AT cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/charm

_______________________________________________
ppl mailing list
ppl AT cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/ppl





Archive powered by MHonArc 2.6.16.

Top of Page