Skip to Content.
Sympa Menu

charm - [charm] messages, pup, and C++ templates

charm AT lists.cs.illinois.edu

Subject: Charm++ parallel programming system

List archive

[charm] messages, pup, and C++ templates


Chronological Thread 
  • From: Jonah Miller <jonah.maxwell.miller AT gmail.com>
  • To: "charm AT cs.uiuc.edu" <charm AT cs.uiuc.edu>
  • Subject: [charm] messages, pup, and C++ templates
  • Date: Thu, 25 Jun 2015 10:07:28 -0400
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/charm/>
  • List-id: CHARM parallel programming system <charm.cs.uiuc.edu>

Hello everyone,

I would like to template a new message type by a variable type so that I can treat it as a generic variable container. However, I'm having a bit of trouble. The following code is in my module file:

template<typename value_t> message ValueMsg;

and the commensurate implementation is:

template<typename value_t>
class ValueMsg : public CMessage_ValueMsg<value_t> {
public:
value_t value;
ValueMsg() { }
ValueMsg(value_t v) {
value = v;
}
};

In the linking stage of compilation, I get a bunch of errors of the following type:

In function `CMessage_ValueMsg<int>::operator delete(void*)':
/home/jmiller/programming/charmploration/fibonacci-futures/fib.decl.h:105: undefined reference to `CMessage_ValueMsg<int>::dealloc(void*)'
/home/jmiller/programming/charmploration/fibonacci-futures/fib.cpp:53: undefined reference to `CMessage_ValueMsg<int>::operator new(unsigned long, int)'

Is there something I'm doing wrong? Or is templating messages simply not possible?

Alternatively, is it possible to use the PUP framework to define the serialization for a message, if I want to, for example use futures?

Thanks in advance for your help!

Best,
Jonah Miller




Archive powered by MHonArc 2.6.16.

Top of Page