You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -406,7 +406,7 @@ both academic and industrial research projects in parallel
406
406
and heterogeneous computing.
407
407
If you are using Taskflow, please cite the following paper we publised at 2021 IEEE TPDS:
408
408
409
-
+ Tsung-Wei Huang, Dian-Lun Lin, Chun-Xun Lin, and Yibo Lin, "[Taskflow: A Lightweight Parallel and Heterogeneous Task Graph Computing System](https://tsung-wei-huang.github.io/papers/tpds21-taskflow.pdf)," <i>IEEE Transactions on Parallel and Distributed Systems (TPDS)</i>, accepted, 2021
409
+
+ Tsung-Wei Huang, Dian-Lun Lin, Chun-Xun Lin, and Yibo Lin, "[Taskflow: A Lightweight Parallel and Heterogeneous Task Graph Computing System](https://tsung-wei-huang.github.io/papers/tpds21-taskflow.pdf)," <i>IEEE Transactions on Parallel and Distributed Systems (TPDS)</i>, vol. 33, no. 6, pp. 1303-1320, June 2022
410
410
411
411
More importantly, we appreciate all Taskflow [contributors][contributors] and
412
412
the following organizations for sponsoring the Taskflow project!
Copy file name to clipboardExpand all lines: docs/ComposableTasking.html
+15-1Lines changed: 15 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,7 @@ <h3>Contents</h3>
54
54
<ul>
55
55
<li><ahref="#ComposeATaskflow">Compose a Taskflow</a></li>
56
56
<li><ahref="#CreateAModuleTask">Create a Module Task</a></li>
57
+
<li><ahref="#CreateACustomComposableGraph">Create a Custom Composable Graph</a></li>
57
58
</ul>
58
59
</div>
59
60
<p>Composition is a key to improve the programmability of a complex workflow. This chapter describes how to create a large parallel graph through composition of modular and reusable blocks that are easier to optimize.</p><sectionid="ComposeATaskflow"><h2><ahref="#ComposeATaskflow">Compose a Taskflow</a></h2><p>A powerful feature of <ahref="classtf_1_1Taskflow.html" class="m-doc">tf::<wbr/>Taskflow</a> is its <em>composable</em> interface. You can break down a large parallel workload into smaller pieces each designed to run a specific task dependency graph. This largely facilitates the <em>modularity</em> of writing a parallel task program.</p><preclass="m-code"><spanclass="mi">1</span><spanclass="o">:</span><spanclass="c1">// f1 has three independent tasks</span>
@@ -386,7 +387,20 @@ <h3>Contents</h3>
386
387
</g>
387
388
</g>
388
389
</svg>
389
-
</div></section>
390
+
</div></section><sectionid="CreateACustomComposableGraph"><h2><ahref="#CreateACustomComposableGraph">Create a Custom Composable Graph</a></h2><p>Taskflow allows you to create a custom graph object that can participate in the scheduling using composition. To become a module task, your class <code>T</code> must define a method <code>T::graph()</code> that returns a reference to a <ahref="classtf_1_1Graph.html" class="m-doc">tf::<wbr/>Graph</a> object. The following example defines a custom graph object that can be assembled in a taskflow throw composition:</p><preclass="m-code"><spanclass="mi">1</span><spanclass="o">:</span><spanclass="k">struct</span><spanclass="nc">CustomGraph</span><spanclass="p">{</span>
<spanclass="mi">14</span><spanclass="o">:</span><spanclass="n">tf</span><spanclass="o">::</span><spanclass="n">Task</span><spanclass="n">comp</span><spanclass="o">=</span><spanclass="n">taskflow</span><spanclass="p">.</span><spanclass="n">composed_of</span><spanclass="p">(</span><spanclass="n">obj</span><spanclass="p">);</span></pre><p>Debrief:</p><ul><li>Lines 1-11 define a custom graph interface to participate in taskflow composition</li><li>Line 2 defines the graph object using <ahref="classtf_1_1Graph.html" class="m-doc">tf::<wbr/>Graph</a></li><li>Lines 3-8 defines the constructor that constructs the task graph using <ahref="classtf_1_1FlowBuilder.html" class="m-doc">tf::<wbr/>FlowBuilder</a></li><li>Line 10 defines the required method for taskflow composition</li><li>Lines 13-14 creates a module task for the declared graph object in the taskflow</li></ul><p>The composition method <ahref="classtf_1_1FlowBuilder.html#ac6f22228d4c2ea2e643c4b0d42c0e92a" class="m-doc">tf::<wbr/>Taskflow::<wbr/>composed_of</a> requires the target to define the <code>graph()</code> method that returns a reference to a <ahref="classtf_1_1Graph.html" class="m-doc">tf::<wbr/>Graph</a> object defined by the target. At runtime, the executor will run dependent tasks in that graph using the same work-stealing scheduling algorithm as other taskflows. Taskflow leverages this powerful feature to design high-level algorithms, such as <ahref="classtf_1_1Pipeline.html" class="m-doc">tf::<wbr/>Pipeline</a>.</p><asideclass="m-note m-info"><h4>Note</h4><p>While Taskflow gives you the flexibility to create a composable graph object, you should consider using <ahref="classtf_1_1Graph.html" class="m-doc">tf::<wbr/>Graph</a> as an opaque data structure just to interact with the library. Additionally, as other module tasks, Taskflow does not own the lifetime of a custom composable graph object but keeps a soft mapping to it. You should keep the graph object alive during its execution.</p></aside></section>
Copy file name to clipboardExpand all lines: docs/DynamicTasking.html
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ <h3>Contents</h3>
55
55
<li><ahref="#CreateASubflow">Create a Subflow</a></li>
56
56
<li><ahref="#JoinASubflow">Join a Subflow</a></li>
57
57
<li><ahref="#DetachASubflow">Detach a Subflow</a></li>
58
-
<li><ahref="#MakeANestedSubflow">Make a Nested Subflow</a></li>
58
+
<li><ahref="#CreateANestedSubflow">Create a Nested Subflow</a></li>
59
59
</ul>
60
60
</div>
61
61
<p>It is very common for a parallel program to spawn task dependency graphs at runtime. In Taskflow, we call this <em>dynamic tasking</em>.</p><sectionid="CreateASubflow"><h2><ahref="#CreateASubflow">Create a Subflow</a></h2><p>Dynamic tasks are those created during the execution of a graph. These tasks are spawned from a parent task and are grouped together to a <em>subflow</em> dependency graph. Taskflow has an unified interface for static and dynamic tasking. To create a subflow, emplace a callable that takes an argument of type <ahref="classtf_1_1Subflow.html" class="m-doc">tf::<wbr/>Subflow</a>. A <ahref="classtf_1_1Subflow.html" class="m-doc">tf::<wbr/>Subflow</a> object will be created and forwarded to the execution context of the task. All methods you find in <ahref="classtf_1_1Taskflow.html" class="m-doc">tf::<wbr/>Taskflow</a> are applicable for <ahref="classtf_1_1Subflow.html" class="m-doc">tf::<wbr/>Subflow</a>.</p><preclass="m-code"><spanclass="mi">1</span><spanclass="o">:</span><spanclass="n">tf</span><spanclass="o">::</span><spanclass="n">Taskflow</span><spanclass="n">taskflow</span><spanclass="p">;</span>
@@ -641,7 +641,7 @@ <h3>Contents</h3>
641
641
</g>
642
642
</g>
643
643
</svg>
644
-
</div></section><sectionid="MakeANestedSubflow"><h2><ahref="#MakeANestedSubflow">Make a Nested Subflow</a></h2><p>A subflow can be nested or recursive. You can create another subflow from the execution of a subflow and so on.</p><preclass="m-code"><spanclass="mi">1</span><spanclass="o">:</span><spanclass="n">tf</span><spanclass="o">::</span><spanclass="n">Taskflow</span><spanclass="n">taskflow</span><spanclass="p">;</span>
644
+
</div></section><sectionid="CreateANestedSubflow"><h2><ahref="#CreateANestedSubflow">Create a Nested Subflow</a></h2><p>A subflow can be nested or recursive. You can create another subflow from the execution of a subflow and so on.</p><preclass="m-code"><spanclass="mi">1</span><spanclass="o">:</span><spanclass="n">tf</span><spanclass="o">::</span><spanclass="n">Taskflow</span><spanclass="n">taskflow</span><spanclass="p">;</span>
Copy file name to clipboardExpand all lines: docs/ParallelReduction.html
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -52,11 +52,12 @@ <h1>
52
52
<divclass="m-block m-default">
53
53
<h3>Contents</h3>
54
54
<ul>
55
+
<li><ahref="#ParallelReductionInclude">Include the Header</a></li>
55
56
<li><ahref="#A2ParallelReduction">Create a Parallel-Reduction Task</a></li>
56
57
<li><ahref="#A2ParallelTransformationReduction">Create a Parallel Transform-Reduction Task</a></li>
57
58
</ul>
58
59
</div>
59
-
<p>Taskflow provides template function that constructs a task to perform parallel reduction over a range of items.</p><sectionid="A2ParallelReduction"><h2><ahref="#A2ParallelReduction">Create a Parallel-Reduction Task</a></h2><p>The reduction task created by <ahref="classtf_1_1FlowBuilder.html#aa9494fe7b862fc832884ce318e8a37f5" class="m-doc">tf::<wbr/>Taskflow::<wbr/>reduce(B first, E last, T& result, O bop)</a> performs parallel reduction over a range of elements specified by <code>[first, last)</code> using the binary operator <code>bop</code> and stores the reduced result in <code>result</code>. It represents the parallel execution of the following reduction loop:</p><preclass="m-code"><spanclass="k">for</span><spanclass="p">(</span><spanclass="k">auto</span><spanclass="n">itr</span><spanclass="o">=</span><spanclass="n">first</span><spanclass="p">;</span><spanclass="n">itr</span><spanclass="o"><</span><spanclass="n">last</span><spanclass="p">;</span><spanclass="n">itr</span><spanclass="o">++</span><spanclass="p">)</span><spanclass="p">{</span>
60
+
<p>Taskflow provides template function that constructs a task to perform parallel reduction over a range of items.</p><sectionid="ParallelReductionInclude"><h2><ahref="#ParallelReductionInclude">Include the Header</a></h2><p>You need to include the header file, <code>taskflow/algorithm/reduce.hpp</code>, for creating a parallel-reduction task.</p><preclass="m-code"><spanclass="cp">#include</span><spanclass="cpf"><taskflow/algorithm/reduce.hpp></span><spanclass="cp"></span></pre></section><sectionid="A2ParallelReduction"><h2><ahref="#A2ParallelReduction">Create a Parallel-Reduction Task</a></h2><p>The reduction task created by <ahref="classtf_1_1FlowBuilder.html#aa9494fe7b862fc832884ce318e8a37f5" class="m-doc">tf::<wbr/>Taskflow::<wbr/>reduce(B first, E last, T& result, O bop)</a> performs parallel reduction over a range of elements specified by <code>[first, last)</code> using the binary operator <code>bop</code> and stores the reduced result in <code>result</code>. It represents the parallel execution of the following reduction loop:</p><preclass="m-code"><spanclass="k">for</span><spanclass="p">(</span><spanclass="k">auto</span><spanclass="n">itr</span><spanclass="o">=</span><spanclass="n">first</span><spanclass="p">;</span><spanclass="n">itr</span><spanclass="o"><</span><spanclass="n">last</span><spanclass="p">;</span><spanclass="n">itr</span><spanclass="o">++</span><spanclass="p">)</span><spanclass="p">{</span>
<spanclass="p">}</span></pre><p>At runtime, the reduction task spawns a subflow to perform parallel reduction. The reduced result is stored in <code>result</code> that will be captured by reference in the reduction task. It is your responsibility to ensure <code>result</code> remains alive during the parallel execution.</p><preclass="m-code"><spanclass="kt">int</span><spanclass="n">sum</span><spanclass="o">=</span><spanclass="mi">100</span><spanclass="p">;</span>
0 commit comments