added a reduction operation "nop" which does nothing.
[charm.git] / src / ck-core / ckreduction.C
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,