]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Minor cleanup. The initialization of ring buffer elements is now no longer expensive.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 19 Jul 2013 16:04:06 +0000 (16:04 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 19 Jul 2013 16:04:06 +0000 (16:04 +0000)
git-svn-id: https://svn.dealii.org/trunk@30059 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/base/work_stream.h

index c4623adc18d1577a2c452981ac07d74c10ca6091..d4c9f9f619ba5972b219eb9cf1dc1048f9692962 100644 (file)
@@ -290,19 +290,19 @@ namespace WorkStream
         n_emitted_items (0),
         chunk_size (chunk_size)
       {
-        // initialize copies of
-        // additional_data. since
-        // this is frequently
-        // expensive (creating
-        // FEValues objects etc) do
-        // that in parallel
-        Threads::TaskGroup<> tasks;
-        for (unsigned int i=0; i<ring_buffer.size(); ++i)
-          tasks += Threads::new_task (&IteratorRangeToItemStream::init_buffer_elements,
-                                      *this,
-                                      i,
-                                      std_cxx1x::cref(sample_copy_data));
-        tasks.join_all ();
+       // initialize the elements of the ring buffer
+        for (unsigned int element=0; element<ring_buffer.size(); ++element)
+         {
+           Assert (ring_buffer[element].n_items == 0,
+                   ExcInternalError());
+
+           ring_buffer[element].work_items.resize (chunk_size,
+                                                   remaining_iterator_range.second);
+           ring_buffer[element].scratch_data = &thread_local_scratch;
+           ring_buffer[element].sample_scratch_data = &sample_scratch_data;
+           ring_buffer[element].copy_datas.resize (chunk_size,
+                                                   sample_copy_data);
+         }
       }
 
       /**

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.