Skip to Content.
Sympa Menu

charm - Re: [charm] [ppl] Extern in conv-ldb

charm AT lists.cs.illinois.edu

Subject: Charm++ parallel programming system

List archive

Re: [charm] [ppl] Extern in conv-ldb


Chronological Thread 
  • From: Hrushit Parikh <parikhhrushit AT hotmail.com>
  • To: Yanhua Sun <sun51 AT illinois.edu>
  • Cc: "charm AT cs.uiuc.edu" <charm AT cs.uiuc.edu>
  • Subject: Re: [charm] [ppl] Extern in conv-ldb
  • Date: Fri, 29 Aug 2014 04:11:51 -0400
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/charm/>
  • List-id: CHARM parallel programming system <charm.cs.uiuc.edu>

Hi,
Yes, you are right.
The Makefile I was using was building 2 executables: -balance neighbour
-balance workstealing

So I was getting the error because in linking the workstealing balancer it could not find a reference to findLoad() as it is only defined in cldb.neighbour.c

Building only the -balance neighbour executable worked. 
Thank you for your help! 

Hrushit

On 28-Aug-2014, at 12:08 PM, "Yanhua Sun" <sun51 AT illinois.edu> wrote:

If you add '-balancer neighbor', that should be correctly linked. If you do not add this, it will link other modules by default.
In this case, you need to add 'int findLoad(int m, char *msg )' in other cldb.*.c files. That should fix the problem.

Yanhua


On Sat, Aug 23, 2014 at 10:28 PM, Hrushit Parikh <parikhhrushit AT hotmail.com> wrote:
Hi,
I have a function " int findLoad(int m, char *msg ) " in charm/src/conv-ldb/cldb.neighbour.c
I wish to call this function in charm/src/conv-core/convcore.c

I declared extern void findLoad(int, char *) in convcore.c and tried calling the function. The charm library builds fine but when I make any charm++ example I get an error:
convcore.c:(.text+0x1911): undefined reference to `findLoad()'

How do I call this function in convcore.c?

I am surprised this does not work because an exactly similar approach is used in convcore.c to call CldModuleInit(char **argv). This function is declared in cldb.neighbour.c. It is defined as an extern in convcore.c and then called subsquently and this works perfectly.

So why is it not work for a user-defined function call? 

Thank you,
Hrushit

_______________________________________________
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




--
Yours Sincerely,
Yanhua Sun 
University of Illinois at Urbana-Champaign,



Archive powered by MHonArc 2.6.16.

Top of Page