]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve documentation.
authorWolfgang Bangerth <bangerth@colostate.edu>
Sun, 5 Dec 2021 23:13:37 +0000 (16:13 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 6 Dec 2021 03:34:03 +0000 (20:34 -0700)
include/deal.II/base/work_stream.h

index 9a6f04754c7283675c3459ff033cf236f44e371c..6c5e94adcacf6b9dd849c6e36b57ee556a6c9ec7 100644 (file)
@@ -480,7 +480,13 @@ namespace WorkStream
                                                             ScratchData,
                                                             CopyData>::ItemType;
 
-        // create the three stages of the pipeline
+        // Create the three stages of the pipeline:
+
+        //
+        // ----- Stage 1 -----
+        //
+        // The first stage is the one that provides us with chunks of data
+        // to work on (the stream of "items"). This stage runs sequentially.
         IteratorRangeToItemStream<Iterator, ScratchData, CopyData>
              iterator_range_to_item_stream(begin,
                                         end,
@@ -499,6 +505,11 @@ namespace WorkStream
               }
           });
 
+        //
+        // ----- Stage 2 -----
+        //
+        // The second stage is the one that does the actual work. This is the
+        // stage that runs in parallel
         auto tbb_worker_filter = tbb::make_filter<ItemType *, ItemType *>(
           tbb::filter::parallel,
           [worker =
@@ -599,6 +610,12 @@ namespace WorkStream
             return current_item;
           });
 
+
+        //
+        // ----- Stage 3 -----
+        //
+        // The last stage is the one that copies data from the CopyData objects
+        // to the final destination. This stage runs sequentially again.
         auto tbb_copier_filter = tbb::make_filter<ItemType *, void>(
           tbb::filter::serial,
           [copier = std::function<void(const CopyData &)>(copier)](
@@ -628,6 +645,10 @@ namespace WorkStream
             current_item->currently_in_use = false;
           });
 
+
+        //
+        // ----- The pipeline -----
+        //
         // Now create a pipeline from these stages and execute it:
         tbb::parallel_pipeline(queue_length,
                                tbb_item_stream_filter & tbb_worker_filter &

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.