Skip to content

Commit ea5943e

Browse files
Merge branch 'dev' of https://github.com/cpp-taskflow/cpp-taskflow into dev
2 parents 72a91bc + d8a477a commit ea5943e

7 files changed

Lines changed: 14 additions & 14 deletions

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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

3636
Cpp-Taskflow is committed to support both academic and industry research projects,
3737
making 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*
192192
The example below demonstrates how to create a subflow
193193
that 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.
225225
You can disable this feature by calling `subflow.detach()`.
226226
Detaching 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) {
274274
A subflow can also be nested or recursive. You can create another subflow from
275275
the 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
280280
tf::Task A = tf.emplace([] (tf::SubflowBuilder& sbf){
@@ -316,7 +316,7 @@ In a joined subflow,
316316
the completion of its parent node is defined as when all tasks
317317
inside 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
322322
int value {0};
@@ -325,13 +325,13 @@ int value {0};
325325
tf::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
332332
tf::Task B = tf.emplace([&] () {
333333
assert(value == 10);
334-
});
334+
}).name("B");
335335

336336
// A1 must finish before A and therefore before B
337337
A.precede(B);
@@ -341,21 +341,21 @@ When a subflow is detached from its parent task, it becomes a parallel
341341
execution line to the current flow graph and will eventually
342342
join 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
347347
int value {0};
348348

349349
// create a detached subflow
350350
tf::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
356356
tf::Task B = tf.emplace([&] () {
357357
// no guarantee for value to be 10 nor fuA ready
358-
});
358+
}).name("B");
359359

360360
A.precede(B);
361361
```
@@ -420,7 +420,7 @@ you cannot simply use the `dump` method because it displays only the static port
420420
Instead, you need to execute the graph first to include dynamic tasks
421421
and 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
426426
tf::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 |

image/debug_subflow.png

-74 KB
Loading

image/detached_subflow_future.png

-59.9 KB
Loading

image/joined_subflow_future.png

-41.9 KB
Loading

image/nested_subflow.png

-115 KB
Loading

image/subflow_detach.png

-90.3 KB
Loading

image/subflow_join.png

-85.2 KB
Loading

0 commit comments

Comments
 (0)