]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix tbb quicktest
authorTimo Heister <timo.heister@gmail.com>
Thu, 6 Feb 2014 16:17:10 +0000 (16:17 +0000)
committerTimo Heister <timo.heister@gmail.com>
Thu, 6 Feb 2014 16:17:10 +0000 (16:17 +0000)
git-svn-id: https://svn.dealii.org/trunk@32419 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/tests/quick_tests/tbb.cc

index 0e8110caf9433f0db790d9acfecdc73487f173a6..31da6440d783019bc0edbc4d419f7497f3dc06db 100644 (file)
@@ -51,9 +51,7 @@ void assemble(const std::vector<int>::iterator &it,
              scratch_data &scratch,
              copy_data &data)
 {
-  std::cout << "hello!" << std::endl;
-
-  data.value +=(*it)*(*it);
+  data.value = (*it);
 }
 
 void copy(int & value, const copy_data &data)
@@ -62,11 +60,11 @@ void copy(int & value, const copy_data &data)
 }
 
 void test2()
-{ 
-  std::vector<int> v(3);
-  v[0] = 3;
-  v[1] = 5;
-  v[2] = 1;
+{
+  const int maxi = 10000;
+  std::vector<int> v(maxi);
+  for (unsigned int i=0;i<v.size();++i)
+    v[i] = i+1;
   int result = 0;
   WorkStream::run(v.begin(),
                  v.end(),
@@ -77,7 +75,7 @@ void test2()
                  scratch_data(), copy_data());
   std::cout << "result: " << result << std::endl;
 
-  if (result != (3*3+5*5+1*1))
+  if (result != maxi*(maxi+1)/2)
     exit(2);
 }
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.