Skip to Content.
Sympa Menu

charm - Re: [charm] Could entry method argument type be a template argument?

charm AT lists.cs.illinois.edu

Subject: Charm++ parallel programming system

List archive

Re: [charm] Could entry method argument type be a template argument?


Chronological Thread 
  • From: Phil Miller <mille121 AT illinois.edu>
  • To: 董理 <dongli AT lasg.iap.ac.cn>
  • Cc: Charm Mailing List <charm AT cs.illinois.edu>
  • Subject: Re: [charm] Could entry method argument type be a template argument?
  • Date: Thu, 10 Mar 2016 15:12:25 -0600

The user can specify the instantiations in their module.

On Thu, Mar 10, 2016 at 6:43 AM, 董理 <dongli AT lasg.iap.ac.cn> wrote:
Dear Phil,

Thanks for quick replying! I just read chapter 15 of the manual, but I still have a concern that do we need to specify all the instantiations explicitly, which is feasible for native types, but not for user defined types?

Best regards,
Li

在 2016年3月10日,上午11:56,Phil Miller <mille121 AT illinois.edu> 写道:

You can put "template <typename DataType>" before the "chare Foo" declaration, just like in your class declaration. You'll also need to have specific instantiations declared explicitly. See the Charm++ manual for more details.

Individual entry methods can also be declared as templates.

On Mar 9, 2016 7:48 PM, "董理" <dongli AT lasg.iap.ac.cn> wrote:
Dear all,

I would like to know if the argument type of an entry method is a template argument, how to deal with it? The following is a simplified example:

chare Foo {
  entry void bar(<DataType> x); // <— How to express ‘DataType’?
};

template <typename DataType>
class Foo : public CBase_Foo {
public:
  void bar(DataType x);
};

The reason why I am using template on chare object is that the user of my codes can use different data type, such as double, int.

Best regards,
Li





Archive powered by MHonArc 2.6.16.

Top of Page