diff --git a/doc/comm/poosc08_test.cc b/doc/comm/poosc08_test.cc index f597a2daa3d00c0f49f6ae54fc30b1de56ef0555..2bef041751b845bf4383af03c67f766ca58e1daa 100644 --- a/doc/comm/poosc08_test.cc +++ b/doc/comm/poosc08_test.cc @@ -19,11 +19,11 @@ template<typename T> struct AddData { typedef typename T::value_type IndexedType; - static double gather(const T& v, int i){ + static const IndexedType& gather(const T& v, int i){ return v[i]; } - static void scatter(T& v, double item, int i){ + static void scatter(T& v, const IndexedType& item, int i){ v[i]+=item; } }; @@ -32,11 +32,11 @@ template<typename T> struct CopyData { typedef typename T::value_type IndexedType; - static double gather(const T& v, int i){ + static const IndexedType& gather(const T& v, int i){ return v[i]; } - static void scatter(T& v, double item, int i){ + static void scatter(T& v, const IndexedType& item, int i){ v[i]=item; } }; @@ -127,7 +127,7 @@ void test() //bCommRedist.forward<CopyData<Container> >(s,t); // calculate on the redistributed array doCalculations(t); - //bCommRedist.backward<AddData<Container> >(s,t); + bCommRedist.backward<AddData<Container> >(s,t); } #endif // HAVE_MPI