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: Gengbin Zheng <zhenggb AT gmail.com>
  • 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 15:31:21 -0600
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/charm>
  • List-id: CHARM parallel programming system <charm.cs.uiuc.edu>

Hi,

Please look at an example at charm/tests/charm++/megatest/synctest.*
Basically, the [sync] is used to an entry function that returns a
result message to the caller. The caller needs to be [threaded]
because it will be suspended, otherwise the main thread is suspended.

Gengbin

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