Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
tsung-wei-huang committed Mar 1, 2020
2 parents ada9d6e + 731f187 commit 464d4f0
Show file tree
Hide file tree
Showing 149 changed files with 3,705 additions and 752 deletions.
247 changes: 124 additions & 123 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/FAQ.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ <h2><a class="anchor" id="GeneralQuestion1"></a>
<p>Cpp-Taskflow aims to help C++ developers quickly implement efficient parallel decomposition strategies using task-based approaches.</p>
<h2><a class="anchor" id="GeneralQuestion2"></a>
Q2: How do I use Cpp-Taskflow in my projects?</h2>
<p>Cpp-Taskflow is a header-only library with zero dependencies. The only thing you need is a C++14 compiler. To use Cpp-Taskflow, simply drop the folder <code>taskflow/</code> to your project and include taskflow.hpp.</p>
<p>Cpp-Taskflow is a header-only library with zero dependencies. The only thing you need is a C++14 compiler. To use Cpp-Taskflow, simply drop the folder <code>taskflow/</code> to your project and include <a class="el" href="taskflow_8hpp_source.html">taskflow.hpp</a>.</p>
<h2><a class="anchor" id="GeneralQuestion3"></a>
Q3: What is the difference between static tasking and dynamic tasking?</h2>
<p>Static tasking refers to those tasks created before execution, while dynamic tasking refers to those tasks created during the execution of static tasks or dynamic tasks (nested). Dynamic tasks created by the same task node are grouped together to a subflow.</p>
Expand All @@ -125,7 +125,7 @@ <h2><a class="anchor" id="GeneralQuestion6"></a>
<p>Unfortunately, Cpp-Taskflow is heavily relying on modern C++14's features/idoms/STL and it is very difficult to provide a version that compiles under older C++ versions.</p>
<h2><a class="anchor" id="GeneralQuestion7"></a>
Q7: How does Cpp-Taskflow schedule tasks?</h2>
<p>Cpp-Taskflow implemented a very efficient <a href="https://en.wikipedia.org/wiki/Work_stealing">work-stealing scheduler</a> to execute task dependency graphs. The source code is available at <code><a class="el" href="executor_8hpp_source.html">taskflow/core/executor.hpp</a></code> and <code>taskflow/core/wsq.hpp</code>. </p><hr/>
<p>Cpp-Taskflow implemented a very efficient <a href="https://en.wikipedia.org/wiki/Work_stealing">work-stealing scheduler</a> to execute task dependency graphs. The source code is available at <code><a class="el" href="executor_8hpp_source.html">taskflow/core/executor.hpp</a></code> and <code><a class="el" href="tsq_8hpp_source.html">taskflow/core/tsq.hpp</a></code>. </p><hr/>
<h1><a class="anchor" id="ProgrammingQuestions"></a>
Programming Questions</h1>
<h2><a class="anchor" id="ProgrammingQuestions1"></a>
Expand Down
26 changes: 15 additions & 11 deletions docs/annotated.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,21 @@
<div class="textblock">Here are the classes, structs, unions and interfaces with brief descriptions:</div><div class="directory">
<div class="levels">[detail level <span onclick="javascript:toggleLevel(1);">1</span><span onclick="javascript:toggleLevel(2);">2</span>]</div><table class="directory">
<tr id="row_0_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_0_" class="arrow" onclick="toggleFolder('0_')">&#9660;</span><span class="icona"><span class="icon">N</span></span><b>tf</b></td><td class="desc"></td></tr>
<tr id="row_0_0_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1Executor.html" target="_self">Executor</a></td><td class="desc">The executor class to run a taskflow graph </td></tr>
<tr id="row_0_1_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1ExecutorObserver.html" target="_self">ExecutorObserver</a></td><td class="desc">Default executor observer to dump the execution timelines </td></tr>
<tr id="row_0_2_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1ExecutorObserverInterface.html" target="_self">ExecutorObserverInterface</a></td><td class="desc">The interface class for creating an executor observer </td></tr>
<tr id="row_0_3_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1FlowBuilder.html" target="_self">FlowBuilder</a></td><td class="desc">Building blocks of a task dependency graph </td></tr>
<tr id="row_0_4_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1Subflow.html" target="_self">Subflow</a></td><td class="desc">The building blocks of dynamic tasking </td></tr>
<tr id="row_0_5_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1Task.html" target="_self">Task</a></td><td class="desc"><a class="el" href="classtf_1_1Task.html" title="task handle to a node in a task dependency graph ">Task</a> handle to a node in a task dependency graph </td></tr>
<tr id="row_0_6_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1Taskflow.html" target="_self">Taskflow</a></td><td class="desc">Class to create a task dependency graph </td></tr>
<tr id="row_0_7_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1TaskView.html" target="_self">TaskView</a></td><td class="desc">Immutable accessor class to a task node, mainly used in the <a class="el" href="classtf_1_1ExecutorObserver.html" title="Default executor observer to dump the execution timelines. ">tf::ExecutorObserver</a> interface </td></tr>
<tr id="row_1_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structis__condition__task.html" target="_self">is_condition_task</a></td><td class="desc">Determines if a callable is a condition task </td></tr>
<tr id="row_2_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structis__dynamic__task.html" target="_self">is_dynamic_task</a></td><td class="desc">Determines if a callable is a dynamic task </td></tr>
<tr id="row_3_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structis__static__task.html" target="_self">is_static_task</a></td><td class="desc">Determines if a callable is a static task </td></tr>
<tr id="row_0_0_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1cudaFlow.html" target="_self">cudaFlow</a></td><td class="desc">Building methods of a cuda task dependency graph </td></tr>
<tr id="row_0_1_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1cudaTask.html" target="_self">cudaTask</a></td><td class="desc">Handle to a node in a cudaGraph </td></tr>
<tr id="row_0_2_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1Executor.html" target="_self">Executor</a></td><td class="desc">The executor class to run a taskflow graph </td></tr>
<tr id="row_0_3_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1ExecutorObserver.html" target="_self">ExecutorObserver</a></td><td class="desc">Default executor observer to dump the execution timelines </td></tr>
<tr id="row_0_4_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1ExecutorObserverInterface.html" target="_self">ExecutorObserverInterface</a></td><td class="desc">The interface class for creating an executor observer </td></tr>
<tr id="row_0_5_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1FlowBuilder.html" target="_self">FlowBuilder</a></td><td class="desc">Building methods of a task dependency graph </td></tr>
<tr id="row_0_6_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1Subflow.html" target="_self">Subflow</a></td><td class="desc">The building blocks of dynamic tasking </td></tr>
<tr id="row_0_7_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1Task.html" target="_self">Task</a></td><td class="desc">Handle to a node in a task dependency graph </td></tr>
<tr id="row_0_8_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1Taskflow.html" target="_self">Taskflow</a></td><td class="desc">Class to create a task dependency graph </td></tr>
<tr id="row_0_9_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1TaskQueue.html" target="_self">TaskQueue</a></td><td class="desc">Lock-free unbounded single-producer multiple-consumer queue </td></tr>
<tr id="row_0_10_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1TaskView.html" target="_self">TaskView</a></td><td class="desc">Immutable accessor class to a task node, mainly used in the <a class="el" href="classtf_1_1ExecutorObserver.html" title="Default executor observer to dump the execution timelines. ">tf::ExecutorObserver</a> interface </td></tr>
<tr id="row_1_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structis__condition__task.html" target="_self">is_condition_task</a></td><td class="desc">Determines if a callable is a condition task </td></tr>
<tr id="row_2_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structis__cudaflow__task.html" target="_self">is_cudaflow_task</a></td><td class="desc">Determines if a callable is a cudaflow task </td></tr>
<tr id="row_3_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structis__dynamic__task.html" target="_self">is_dynamic_task</a></td><td class="desc">Determines if a callable is a dynamic task </td></tr>
<tr id="row_4_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structis__static__task.html" target="_self">is_static_task</a></td><td class="desc">Determines if a callable is a static task </td></tr>
</table>
</div><!-- directory -->
</div><!-- contents -->
Expand Down
4 changes: 4 additions & 0 deletions docs/annotated_dup.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
var annotated_dup =
[
[ "tf", null, [
[ "cudaFlow", "classtf_1_1cudaFlow.html", "classtf_1_1cudaFlow" ],
[ "cudaTask", "classtf_1_1cudaTask.html", "classtf_1_1cudaTask" ],
[ "Executor", "classtf_1_1Executor.html", "classtf_1_1Executor" ],
[ "ExecutorObserver", "classtf_1_1ExecutorObserver.html", "classtf_1_1ExecutorObserver" ],
[ "ExecutorObserverInterface", "classtf_1_1ExecutorObserverInterface.html", "classtf_1_1ExecutorObserverInterface" ],
[ "FlowBuilder", "classtf_1_1FlowBuilder.html", "classtf_1_1FlowBuilder" ],
[ "Subflow", "classtf_1_1Subflow.html", "classtf_1_1Subflow" ],
[ "Task", "classtf_1_1Task.html", "classtf_1_1Task" ],
[ "Taskflow", "classtf_1_1Taskflow.html", "classtf_1_1Taskflow" ],
[ "TaskQueue", "classtf_1_1TaskQueue.html", "classtf_1_1TaskQueue" ],
[ "TaskView", "classtf_1_1TaskView.html", "classtf_1_1TaskView" ]
] ],
[ "is_condition_task", "structis__condition__task.html", null ],
[ "is_cudaflow_task", "structis__cudaflow__task.html", null ],
[ "is_dynamic_task", "structis__dynamic__task.html", null ],
[ "is_static_task", "structis__static__task.html", null ]
];
2 changes: 1 addition & 1 deletion docs/chapter1.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ <h1><a class="anchor" id="C1_CreateATaskDependencyGraph"></a>
<li>Line 3 creates a task from a given callable object and returns a task handle </li>
<li>Line 5-9 creates three tasks in one call using C++ structured binding coupled with <a class="elRef" doxygen="/Users/twhuang/PhD/Code/cpp-taskflow/doxygen/cppreference-doxygen-web.tag.xml:http://en.cppreference.com/w/" href="http://en.cppreference.com/w/cpp/utility/tuple.html">std::tuple</a></li>
</ul>
<p>Each time you create a task, the taskflow object creates a node in the task graph and returns a task handle of type <a class="el" href="classtf_1_1Task.html" title="task handle to a node in a task dependency graph ">tf::Task</a>. A task handle is a lightweight object that wraps up a particular node in a graph and provides a set of methods for you to assign different attributes to the task such as adding dependencies, naming, and assigning a new work.</p>
<p>Each time you create a task, the taskflow object creates a node in the task graph and returns a task handle of type <a class="el" href="classtf_1_1Task.html" title="handle to a node in a task dependency graph ">tf::Task</a>. A task handle is a lightweight object that wraps up a particular node in a graph and provides a set of methods for you to assign different attributes to the task such as adding dependencies, naming, and assigning a new work.</p>
<div class="fragment"><div class="line"> 1: <a class="code" href="classtf_1_1Taskflow.html">tf::Taskflow</a> taskflow;</div><div class="line"> 2: <a class="code" href="classtf_1_1Task.html">tf::Task</a> A = taskflow.<a class="code" href="classtf_1_1FlowBuilder.html#a796e29175380f70246cf2a5639adc437">emplace</a>([] () { <a class="codeRef" doxygen="/Users/twhuang/PhD/Code/cpp-taskflow/doxygen/cppreference-doxygen-web.tag.xml:http://en.cppreference.com/w/" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;create a task A\n&quot;</span>; });</div><div class="line"> 3: <a class="code" href="classtf_1_1Task.html">tf::Task</a> B = taskflow.<a class="code" href="classtf_1_1FlowBuilder.html#a796e29175380f70246cf2a5639adc437">emplace</a>([] () { <a class="codeRef" doxygen="/Users/twhuang/PhD/Code/cpp-taskflow/doxygen/cppreference-doxygen-web.tag.xml:http://en.cppreference.com/w/" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;create a task B\n&quot;</span>; });</div><div class="line"> 4:</div><div class="line"> 5: A.<a class="code" href="classtf_1_1Task.html#a08ada0425b490997b6ff7f310107e5e3">name</a>(<span class="stringliteral">&quot;TaskA&quot;</span>);</div><div class="line"> 6: A.<a class="code" href="classtf_1_1Task.html#a2554a0983b10ec7cb2270b4db0334fb7">work</a>([] () { <a class="codeRef" doxygen="/Users/twhuang/PhD/Code/cpp-taskflow/doxygen/cppreference-doxygen-web.tag.xml:http://en.cppreference.com/w/" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;reassign A to a new callable\n&quot;</span>; });</div><div class="line"> 7: A.<a class="code" href="classtf_1_1Task.html#a8c78c453295a553c1c016e4062da8588">precede</a>(B);</div><div class="line"> 8:</div><div class="line"> 9: <a class="codeRef" doxygen="/Users/twhuang/PhD/Code/cpp-taskflow/doxygen/cppreference-doxygen-web.tag.xml:http://en.cppreference.com/w/" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; A.<a class="code" href="classtf_1_1Task.html#a08ada0425b490997b6ff7f310107e5e3">name</a>() &lt;&lt; <a class="codeRef" doxygen="/Users/twhuang/PhD/Code/cpp-taskflow/doxygen/cppreference-doxygen-web.tag.xml:http://en.cppreference.com/w/" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>; <span class="comment">// TaskA</span></div><div class="line">10: <a class="codeRef" doxygen="/Users/twhuang/PhD/Code/cpp-taskflow/doxygen/cppreference-doxygen-web.tag.xml:http://en.cppreference.com/w/" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; A.<a class="code" href="classtf_1_1Task.html#a1a0afc89e8a6a416c511e74d82df135d">num_successors</a>() &lt;&lt; <a class="codeRef" doxygen="/Users/twhuang/PhD/Code/cpp-taskflow/doxygen/cppreference-doxygen-web.tag.xml:http://en.cppreference.com/w/" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>; <span class="comment">// 1</span></div><div class="line">11: <a class="codeRef" doxygen="/Users/twhuang/PhD/Code/cpp-taskflow/doxygen/cppreference-doxygen-web.tag.xml:http://en.cppreference.com/w/" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; A.<a class="code" href="classtf_1_1Task.html#a974dc1d738b62b829ad261beeafbd67c">num_dependents</a>() &lt;&lt; <a class="codeRef" doxygen="/Users/twhuang/PhD/Code/cpp-taskflow/doxygen/cppreference-doxygen-web.tag.xml:http://en.cppreference.com/w/" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>; <span class="comment">// 0</span></div><div class="line">12: </div><div class="line">13: <a class="codeRef" doxygen="/Users/twhuang/PhD/Code/cpp-taskflow/doxygen/cppreference-doxygen-web.tag.xml:http://en.cppreference.com/w/" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; B.<a class="code" href="classtf_1_1Task.html#a1a0afc89e8a6a416c511e74d82df135d">num_successors</a>() &lt;&lt; <a class="codeRef" doxygen="/Users/twhuang/PhD/Code/cpp-taskflow/doxygen/cppreference-doxygen-web.tag.xml:http://en.cppreference.com/w/" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>; <span class="comment">// 0</span></div><div class="line">14: <a class="codeRef" doxygen="/Users/twhuang/PhD/Code/cpp-taskflow/doxygen/cppreference-doxygen-web.tag.xml:http://en.cppreference.com/w/" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; B.<a class="code" href="classtf_1_1Task.html#a974dc1d738b62b829ad261beeafbd67c">num_dependents</a>() &lt;&lt; <a class="codeRef" doxygen="/Users/twhuang/PhD/Code/cpp-taskflow/doxygen/cppreference-doxygen-web.tag.xml:http://en.cppreference.com/w/" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>; <span class="comment">// 1</span></div></div><!-- fragment --><p>Debrief: </p><ul>
<li>Line 1 creates a taskflow object </li>
<li>Line 2-3 creates two tasks A and B </li>
Expand Down
Loading

0 comments on commit 464d4f0

Please sign in to comment.