@@ -31,7 +31,7 @@ allowing users to quickly master our parallel task programming model in a natura
3131
3232| Static Tasking | Dynamic Tasking |
3333| :------------: | :-------------: |
34- | ![ ] ( image/static_graph.png ) | ![ ] ( image/dynamic_graph.png ) |
34+ | ![ ] ( image/static_graph.png ) | < img align = " right " src = " image/dynamic_graph.png " width = " 100% " > |
3535
3636Cpp-Taskflow is committed to support both academic and industry research projects,
3737making it reliable and cost-effective for long-term and large-scale developments.
@@ -192,7 +192,7 @@ These tasks are spawned by a parent task and are grouped together to a *subflow*
192192The example below demonstrates how to create a subflow
193193that spawns three tasks during its execution.
194194
195- <img align =" right " src =" image/subflow_join.png " width =" 40 %" >
195+ <img align =" right " src =" image/subflow_join.png " width =" 30 %" >
196196
197197``` cpp
198198// create three regular tasks
@@ -225,7 +225,7 @@ its parent node.
225225You can disable this feature by calling ` subflow.detach() ` .
226226Detaching the above subflow will result in the following execution flow.
227227
228- <img align =" right " src =" image/subflow_detach.png " width =" 65 %" >
228+ <img align =" right " src =" image/subflow_detach.png " width =" 40 %" >
229229
230230``` cpp
231231// detach a subflow graph
@@ -274,7 +274,7 @@ tf::Task A = tf.emplace([] (tf::SubflowBuilder& subflow) {
274274A subflow can also be nested or recursive. You can create another subflow from
275275the execution of a subflow and so on.
276276
277- <img align =" right " src =" image/nested_subflow.png " width =" 40 %" >
277+ <img align =" right " src =" image/nested_subflow.png " width =" 25 %" >
278278
279279``` cpp
280280tf::Task A = tf.emplace([] (tf::SubflowBuilder& sbf){
@@ -316,7 +316,7 @@ In a joined subflow,
316316the completion of its parent node is defined as when all tasks
317317inside the subflow (possibly nested) finish.
318318
319- <img align =" right " src =" image/joined_subflow_future.png " width =" 35 %" >
319+ <img align =" right " src =" image/joined_subflow_future.png " width =" 15 %" >
320320
321321``` cpp
322322int value {0};
@@ -325,13 +325,13 @@ int value {0};
325325tf::Task A = tf.emplace([ &] (tf::SubflowBuilder& subflow) {
326326 subflow.emplace([ &] ( ) {
327327 value = 10;
328- });
329- });
328+ }).name("A1") ;
329+ }).name( " A " ) ;
330330
331331// create a task B after A
332332tf::Task B = tf.emplace([&] () {
333333 assert(value == 10);
334- });
334+ }).name( " B " ) ;
335335
336336// A1 must finish before A and therefore before B
337337A.precede(B);
@@ -341,21 +341,21 @@ When a subflow is detached from its parent task, it becomes a parallel
341341execution line to the current flow graph and will eventually
342342join to the same topology.
343343
344- <img align =" right " src =" image/detached_subflow_future.png " width =" 35 %" >
344+ <img align =" right " src =" image/detached_subflow_future.png " width =" 25 %" >
345345
346346``` cpp
347347int value {0};
348348
349349// create a detached subflow
350350tf::Task A = tf.emplace([ &] (tf::SubflowBuilder& subflow) {
351- subflow.emplace([ &] ( ) { value = 10; });
351+ subflow.emplace([ &] ( ) { value = 10; }).name("A1") ;
352352 subflow.detach();
353- });
353+ }).name( " A " ) ;
354354
355355// create a task B after A
356356tf::Task B = tf.emplace([&] () {
357357 // no guarantee for value to be 10 nor fuA ready
358- });
358+ }).name( " B " ) ;
359359
360360A.precede(B);
361361```
@@ -420,7 +420,7 @@ you cannot simply use the `dump` method because it displays only the static port
420420Instead, you need to execute the graph first to include dynamic tasks
421421and then use the ` dump_topologies ` method.
422422
423- <img align =" right " src =" image/debug_subflow.png " width =" 40 %" >
423+ <img align =" right " src =" image/debug_subflow.png " width =" 25 %" >
424424
425425``` cpp
426426tf::Taskflow tf (0); // use only the master thread
@@ -651,7 +651,7 @@ Visit [documentation][wiki] to see the complete list.
651651| -------------- | ----------- | ------ | ----------- |
652652| name | string | self | assign a human-readable name to the task |
653653| work | callable | self | assign a work of a callable object to the task |
654- | precede | task | self | enable this task to run * before* the given task |
654+ | precede | task list | self | enable this task to run * before* the given tasks |
655655| gather | task list | self | enable this task to run * after* the given tasks |
656656| num_dependents | none | size | return the number of dependents (inputs) of this task |
657657| num_successors | none | size | return the number of successors (outputs) of this task |
0 commit comments