Skip to Content.
Sympa Menu

charm - Re: [charm] sending an object using PUP

charm AT lists.siebelschool.illinois.edu

Subject: Charm++ parallel programming system

List archive

Re: [charm] sending an object using PUP


Chronological Thread 
  • From: "Kale, Laxmikant V" <kale AT illinois.edu>
  • To: Nicolas Bock <nicolasbock AT gmail.com>, "charm AT cs.uiuc.edu" <charm AT cs.uiuc.edu>
  • Subject: Re: [charm] sending an object using PUP
  • Date: Fri, 8 Nov 2013 13:58:48 +0000
  • Accept-language: en-US
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/charm/>
  • List-id: CHARM parallel programming system <charm.cs.uiuc.edu>

I will let someone else will respond with more details. But here is my quick attempt:

Sure, you can send any instance of a foo class in a method invocation, just using parameter marshaling as usual. There is no problem with that (and it satisfies what you asked for in the text). But your example is using a return value of type foo. The only  entry methods that can return anything are "sync" methods, and they must be called from entry methods tagged as "threaded". More pertinently, the return value is required to be a message. So, your example as stated will not work. 

It may be possible to define a different return type that’s puppable, and implement it with additional copying, but the extra copying is not worth it, I think. (note: the foo class does not include the message envelope). 

--- 
Laxmikant (Sanjay) Kale         http://charm.cs.uiuc.edu
Professor, Computer Science     kale AT illinois.edu
201 N. Goodwin Avenue           Ph:  (217) 244-0094
Urbana, IL  61801-2302          FAX: (217) 265-6582


On 11/7/13 2:31 PM, "Nicolas Bock" <nicolasbock AT gmail.com> wrote:

Hi,

suppose I use the foo class as in the example code in chapter 6 and I include an instance of it as a field in a chare. Since foo defines pup(), the chare can be migrated.

Now suppose I would like to send the foo instance to some other chare. I could write a CMessage and define pack(), unpack(), and alloc(), but it seems that since foo already defines pup(), there should be a much simpler way.

To make this more concrete, I would like to do something like the following:

class Bar : public CBase_Bar {
  private:
    foo myFoo;
  public:
    foo getFoo (void);
};

class Flo : public CBase_Flo {
  private:
    CProxy_Bar bar;
  public:
    void work (void) {
      foo theFoo = bar.getFoo();
    }
};

Thanks already,

nick




Archive powered by MHonArc 2.6.16.

Top of Page