From: Bruno Turcksin Date: Thu, 7 Nov 2013 20:16:17 +0000 (+0000) Subject: Simplify code in WorkStream when graph coloring is used. X-Git-Tag: v8.1.0~366 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca0131c422b588726d22334d02344cba5c4baca1;p=dealii.git Simplify code in WorkStream when graph coloring is used. git-svn-id: https://svn.dealii.org/trunk@31574 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/base/work_stream.h b/deal.II/include/deal.II/base/work_stream.h index a029e9b0c5..85c8400f26 100644 --- a/deal.II/include/deal.II/base/work_stream.h +++ b/deal.II/include/deal.II/base/work_stream.h @@ -952,57 +952,30 @@ namespace WorkStream std::vector > coloring = graph_coloring::make_graph_coloring( begin,end,get_conflict_indices); - // colors that do not have cells, i.e., less than chunk_size times - // multithread_info.n_threads(), are gathered and the copier is - // called serially. + // For colors that do not have enough cells, i.e., less than chunk_size times + // multithread_info.n_threads(), the copier is called serially. const unsigned int serial_limit(chunk_size*multithread_info.n_threads()); std::vector serial_copying; for (unsigned int color=0; color - iterator_range_to_item_stream (coloring[color].begin(), coloring[color].end(), - queue_length, - chunk_size, - sample_scratch_data, - sample_copy_data); - - internal::Worker worker_filter (worker); - internal::Copier copier_filter (copier,false); - - // now create a pipeline from - // these stages - tbb::pipeline assembly_line; - assembly_line.add_filter (iterator_range_to_item_stream); - assembly_line.add_filter (worker_filter); - assembly_line.add_filter (copier_filter); - - // and run it - assembly_line.run (queue_length); - - assembly_line.clear (); - } - } - - // use the serial copier for all the colors that do not have enough cells - if (serial_copying.size()!=0) - { + serial = true; + // create the three stages of the + // pipeline internal::IteratorRangeToItemStream - iterator_range_to_item_stream (serial_copying.begin(), serial_copying.end(), + iterator_range_to_item_stream (coloring[color].begin(), coloring[color].end(), queue_length, chunk_size, sample_scratch_data, sample_copy_data); internal::Worker worker_filter (worker); - internal::Copier copier_filter (copier,true); + internal::Copier copier_filter (copier,serial); + // now create a pipeline from + // these stages tbb::pipeline assembly_line; assembly_line.add_filter (iterator_range_to_item_stream); assembly_line.add_filter (worker_filter);