Skip to Content.
Sympa Menu

charm - Re: [charm] charm++ compiling problem

charm AT lists.cs.illinois.edu

Subject: Charm++ parallel programming system

List archive

Re: [charm] charm++ compiling problem


Chronological Thread 
  • From: Phil Miller <mille121 AT illinois.edu>
  • To: Haowei Huang <huangh AT in.tum.de>
  • Cc: Charm Mailing List <charm AT cs.illinois.edu>
  • Subject: Re: [charm] charm++ compiling problem
  • Date: Fri, 28 May 2010 08:04:18 -0500
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/charm>
  • List-id: CHARM parallel programming system <charm.cs.uiuc.edu>

On Fri, May 28, 2010 at 07:44, Haowei Huang
<huangh AT in.tum.de>
wrote:
> Hi Phil:
>
>         I encounter such a problem when I compile my program:
>
> Main.decl.h:325: error: ‘Particle’ was not declared in this scope
> Main.decl.h:325: error: template argument 1 is invalid
>
>
>         in Main.ci
>        array [3D] Patch {
>           .....
>           entry void receiveParticles(CkVec<Particle> updates);
>           .....
>       };
>
>        Particle is just a normal C++ class and included in Main.h. Patch
> object needs to call functions in Particle.
>
>       I don't know how to specify the Particle class in Main.ci or somewhere
> else. Should I define Particle as a chare also?

No, you only need to define things with entry methods as chares in the
ci file. Though apparently undocumented, the ci file supports
inclusion directives that emit a #include in the decl.h file. Before
array [3D] Patch
add a line saying
include "Main.h";
or whatever more specific header defines the Particle objects.

On a more general note, while each Patch having a collection of
Particle objects seems to be good object-oriented design, it tends to
result in poor performance. This is the classic issue of
array-of-structures vs structure-of-arrays layout giving
non-contiguous memory access patterns. There's a further issue with
array-of-structures, in that vector arithmetic on the elements using
modern SIMD hardware would require cycles to pack and unpack the
vector registers, while structure-of-arrays allows them to be loaded
and stored directly.

Phil





Archive powered by MHonArc 2.6.16.

Top of Page