Use typedef for some sanity in test program
authorRamprasad Venkataraman <ramv@illinois.edu>
Tue, 3 Apr 2012 22:33:16 +0000 (17:33 -0500)
committerPhil Miller <mille121@illinois.edu>
Thu, 5 Apr 2012 21:18:01 +0000 (16:18 -0500)
tests/charm++/method_templates/pgm.C

index 0c1c2a65ddc8248c49ae8a2ace843e680b634332..218beeb620de00ea935721ed8ddffaebf737478d 100644 (file)
@@ -9,6 +9,7 @@
 #include <functional>
 #include <iterator>
 
+typedef count< std::less<libdtype> > cntType;
 // Temporary initproc to register the instantiated EPs
 void register_instantiations()
 {
@@ -21,7 +22,7 @@ void register_instantiations()
     CkIndex_libArray::doSomething(comparator, foo, bar);
     CkIndex_libArray::doSomething(avger, foo, bar);
     CkReductionTarget(pgm, acceptResults<avg>);
-    CkReductionTarget(pgm, acceptResults< count< std::less<libdtype> > >);
+    CkReductionTarget(pgm, acceptResults< cntType >);
 };
 
 
@@ -32,7 +33,7 @@ CkReduction::reducerType avgReducer;
 // Register reducer functions
 void register_reducers()
 {
-    countReducer = CkReduction::addReducer(count< std::less<libdtype> >::reduce_count);
+    countReducer = CkReduction::addReducer(cntType::reduce_count);
     avgReducer   = CkReduction::addReducer(avg::reduce_avg);
 }
 
@@ -58,8 +59,8 @@ class pgm : public CBase_pgm
             arrProxy.doSomething(avg(), avgReducer, avgCB);
 
             // Setup a redn cb and start the parallel count of num elements less than given threshold
-            CkCallback cntCB(CkReductionTarget(pgm, acceptResults< count< std::less<libdtype> > >), thisProxy);
-            arrProxy.doSomething( count< std::less<libdtype> >(0.5), countReducer, cntCB );
+            CkCallback cntCB(CkReductionTarget(pgm, acceptResults< cntType >), thisProxy);
+            arrProxy.doSomething( cntType(0.5), countReducer, cntCB );
         }
 
         template <typename T>