Skip to Content.
Sympa Menu

charm - Re: [charm] Pb with inheritance

charm AT lists.cs.illinois.edu

Subject: Charm++ parallel programming system

List archive

Re: [charm] Pb with inheritance


Chronological Thread 
  • From: Filippo Gioachin <gioachin AT uiuc.edu>
  • To: Christian Perez <christian.perez AT inria.fr>
  • Cc: "charm AT cs.uiuc.edu" <charm AT cs.uiuc.edu>
  • Subject: Re: [charm] Pb with inheritance
  • Date: Thu, 3 Jun 2010 15:36:23 -0500
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/charm>
  • List-id: CHARM parallel programming system <charm.cs.uiuc.edu>

Christian, I tried your program (from the tar in the first email). It appears that when you call a->foo2() you actually end up running a->foo1(), as the output says:
[Main] main...
[Main] main... done
[A] created
[A] foo1 called
[Main] All done

There seems to be a problem in charm when multiple inheritance and virtual functions are used: the objects are not properly cast between types. Mainly because objects are stored internally as void*, and the superclasses I1, I2 of A are not at the same memory location as A is. This might require some modifications to allow multiple inheritance to work correctly. In the meanwhile, I would suggest limiting to single inheritance of chares.
Regards,
Filippo

On Tue, Jun 1, 2010 at 06:49, Christian Perez <christian.perez AT inria.fr> wrote:
In the ci file, A inherits from I1 and I2.
So, I guess I should be able to invoke foo1 or foo2 on
CProxy_A.

It is basically the same example as in
http://charm.cs.uiuc.edu/manuals/html/charm++/4_1.html
but with multiple inheritance.

Christian

On 06/01/2010 01:45 PM, Aaron Becker wrote:
> Notice that in your example code you are invoking foo1 and foo2 on an
> object of type CProxy_A, not type A. You can't invoke non-entry
> methods of an object through its proxy, except by calling ckLocal if
> it's a local chare. Otherwise you could call non-entry methods on
> remote objects, which will never work. The name resolution for
> CProxy_A finds the entry methods in the base classes because CProxy_A
> has no foo1 and foo2 methods of its own.
>
> Aaron
>
> On Tue, Jun 1, 2010 at 3:54 AM, Christian Perez
> <christian.perez AT inria.fr>  wrote:
>
>> Hello,
>>
>> please consider the attached example, where a chare A inherits from 2 others
>> chare I1&  I2:
>>
>>   chare I1
>>   {
>>      entry void foo1();
>>   };
>>
>>   chare I2
>>   {
>>      entry void foo2();
>>   };
>>
>>
>>   chare A : I1, I2
>>   {
>>      entry A();
>>   };
>>
>> When invoking foo2 on A, either foo2 of the class I2 is called (not A::foo2
>> !) if methods foo1&  foo2 are not virtual
>> or foo1 on A (vtable issue?) is invoked if they are virtual. Though class
>> inheritance is not virtual, can it be the same issue?
>>
>> Any help is welcome.
>>
>> Christian
>>
>> _______________________________________________
>> charm mailing list
>> charm AT cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/charm
>>
>>
>>

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




--
Filippo Gioachin
PhD Candidate
Department of Computer Science
University of Illinois at Urbana-Champaign
Ph: +1-217-333-4764



Archive powered by MHonArc 2.6.16.

Top of Page