charmplusplus / charm

The Charm++ parallel programming system. Visit https://charmplusplus.org/ for more information.
Apache License 2.0
206 stars 50 forks source link

Overloaded reduction targets result in compilation error #1700

Open nilsdeppe opened 7 years ago

nilsdeppe commented 7 years ago

Original issue: https://charm.cs.illinois.edu/redmine/issues/1700


In my ci file I have:

<code class="cpp">
template <typename ReceiveTag, typename ReceiveData_t>
entry[reductiontarget] void receive_data(TemporalId&, ReceiveData_t&,
                                         bool enable_if_disabled);
template <typename ReceiveTag, typename ReceiveData_t>
entry[reductiontarget] void receive_data(TemporalId&, ReceiveData_t&);
</code>

which leads to a compilation error:

<code class="text">
/AlgorithmGroup.decl.h:221:16: error: class member cannot be
      redeclared
    static int redn_wrapper_receive_data(CkReductionMsg* impl_msg) { return idx_redn_wrapper_receive_data_m...
               ^
/AlgorithmGroup.decl.h:180:16: note: previous definition is
      here
    static int redn_wrapper_receive_data(CkReductionMsg* impl_msg) { return idx_redn_wrapper_receive_data_m...
               ^
In file included from /Test_AlgorithmParallel.cpp:6:
In file included from /AlgorithmNodegroup.hpp:8:
/AlgorithmNodegroup.decl.h:221:16: error: class member cannot
      be redeclared
    static int redn_wrapper_receive_data(CkReductionMsg* impl_msg) { return idx_redn_wrapper_receive_data_m...
               ^
/AlgorithmNodegroup.decl.h:180:16: note: previous definition
      is here
    static int redn_wrapper_receive_data(CkReductionMsg* impl_msg) { return idx_redn_wrapper_receive_data_m...
               ^
</code>

Do I only need to mark one of the entry methods a [reductiontarget] to get the correct behavior?

PhilMiller commented 5 years ago

Original date: 2017-10-06 15:58:44


I'm not sure you'll get the correct behavior even with just one of those methods - what does the contribute call to produce those arguments in a CkReductionMsg even look like? The only things we current support in arguments to [reductiontarget] methods are single scalar values, or an array of such with a count argument.

I thought the .ci file translater would error on this, but I guess not.