added a reduction operation "nop" which does nothing.
authorGengbin Zheng <gzheng@illinois.edu>
Thu, 17 Mar 2011 01:20:23 +0000 (20:20 -0500)
committerGengbin Zheng <gzheng@illinois.edu>
Thu, 17 Mar 2011 01:20:23 +0000 (20:20 -0500)
src/ck-core/cknodegroupreduction.h
src/ck-core/ckreduction.C
tests/charm++/megatest/groupcast.C

index b5204321967c0b424c5b2907037471cfb5a1869a..850952c37635b9ea52327bfbb889672e7894ef0e 100644 (file)
@@ -37,6 +37,7 @@ public:
        typedef enum {
        //A placeholder invalid reduction type
                invalid=0,
+                nop,
        //Compute the sum the numbers passed by each element.
                sum_int,sum_float,sum_double,
 
index a0dc85bef79f8d66c1dbef992ffa038d9e5399cd..b7a4c74a9a631f83fcdd0209ff537e6807966967 100644 (file)
@@ -1350,6 +1350,11 @@ static CkReductionMsg *invalid_reducer(int nMsg,CkReductionMsg **msg)
        return NULL;
 }
 
+static CkReductionMsg *nop(int nMsg,CkReductionMsg **msg)
+{
+  return CkReductionMsg::buildNew(0,NULL, CkReduction::invalid, msg[0]);
+}
+
 #define SIMPLE_REDUCTION(name,dataType,typeStr,loop) \
 static CkReductionMsg *name(int nMsg,CkReductionMsg **msg)\
 {\
@@ -1542,6 +1547,7 @@ int CkReduction::nReducers=CkReduction::lastSystemReducer;
 
 CkReduction::reducerFn CkReduction::reducerTable[CkReduction::MAXREDUCERS]={
     ::invalid_reducer,
+    ::nop,
   //Compute the sum the numbers passed by each element.
     ::sum_int,::sum_float,::sum_double,
 
index 14b1b6a768b845ec3a614e71cdbed11fd15c3ed0..2651745cd89a59f1964b52c26d629e3984ccc8d2 100644 (file)
@@ -39,7 +39,7 @@ void groupcast_group::doBroadcast(groupcast_BCMsg *bcm) {
   }
   delete bcm;
   CkCallback cb(CkIndex_groupcast_main::groupReady(),myMain);
-  contribute(0,0,CkReduction::sum_int,cb);
+  contribute(0,0,CkReduction::nop,cb);
 }
 
 MEGATEST_REGISTER_TEST(groupcast,"mjlang",1)