Home
last modified time | relevance | path

Searched refs:graph (Results 1 – 25 of 125) sorted by relevance

12345

/oneTBB/doc/main/tbb_userguide/
H A DGraph_Object.rst7 Conceptually a flow graph is a collection of nodes and edges. Each node
8 belongs to exactly one graph and edges are made only between nodes in
9 the same graph. In the flow graph interface, a graph object represents
10 this collection of nodes and edges, and is used for invoking whole graph
11 operations such as waiting for all tasks related to the graph to
12 complete, resetting the state of all nodes in the graph, and canceling
13 the execution of all nodes in the graph.
16 The code below creates a graph object and then waits for all tasks
25 graph g;
28graph object does not own the nodes associated with it. You need to make sure that the graph objec…
[all …]
H A Dattach_flow_graph_to_arena.rst10 cases, you may want to apply such mechanisms when a flow graph executes.
12 During its construction, a ``graph`` object attaches to the arena, in which the constructing
16 for a graph execution:
25 A ``graph`` object can be reattached to a different ``task_arena`` by calling
26 the ``graph::reset()`` function. It reinitializes and reattaches the ``graph`` to
27 the task arena instance, inside which the ``graph::reset()`` method is executed.
29 This example shows how to reattach existing graph to an arena with the most performant
31 of the graph, it is spawned in the arena of a graph it is attached to, disregarding
H A Dalways_use_wait_for_all.rst7 One of the most common mistakes made in flow graph programming is to
8 forget to call wait_for_all. The function graph::wait_for_all blocks
9 until all tasks spawned by the graph are complete. This is not only
11 necessary to call wait_for_all before destroying the graph, or any of
20 graph g;
32 In the function above, the graph g and its node f are destroyed at the
35 successors connected to its node, but by then both the graph and the
38 destruction of the graph and node.
41 If you use a flow graph and see mysterious behavior, check first to see
H A Duse_nested_flow_graphs.rst7 In addition to nesting algorithms within a flow graph node, it is also
8 possible to nest flow graphs. For example, below there is a graph ``g`` with
10 executes an inner dependence graph. When node ``b`` receives a message, it
11 constructs and executes an inner data flow graph:
17 graph g;
19 graph h;
33 graph h;
67 the graph only adds overhead to the execution. You can modify the
75 graph h;
98 graph g;
[all …]
H A Davoid_dynamic_node_removal.rst20 flow graph as nodes are actively processing messages in the graph.
21 However, removing nodes is discouraged. Destroying a graph or any of its
22 nodes while there are messages being processed in the graph can lead to
24 graph causing program failure. Removal of nodes when the graph is not
H A Duse_graph_reset.rst3 Use graph::reset() to Reset a Canceled Graph
7 When a graph execution is canceled either because of an unhandled
9 graph and its nodes may be left in an indeterminate state. For example,
12 other optimizations performed during the execution of a flow graph that
14 re-execute or restart a graph, you first need to reset the graph:
H A DParallelizing_Flow_Graph.rst12 Using graph parallelism, computations are represented by nodes and the
14 edges. When a node in the graph receives a message, a task is spawned to
16 the graph across the edges that connect the nodes. The following
23 nodes in the graph. In this example, the sequence is created by a
28 and cubes from 1 to 10. In a streaming or data flow graph, the values
46 The following graphic shows a different form of graph application. In
47 this example, a dependence graph is used to establish a partial ordering
80 The flow graph interface in the oneTBB library allows you to express
83 more. If you express your application using the flow graph interface,
85 present in the graph. For example, in the first example above, perhaps
[all …]
H A Dcommunicate_with_nodes.rst7 All graph nodes require a reference to a graph object as one of the
9 between nodes that are part of the same graph. An edge expresses the
10 topology of your graph to the runtime library. Connecting two nodes in
11 different graphs can make it difficult to reason about whole graph
12 operations, such as calls to graph::wait_for_all and exception handling.
21 the graph boundaries. However, it may still be difficult to reason about
22 whole graph operations. For example, consider the graphs below:
28 graph g;
42 graph g2;
79 However, because there is cross-graph communication, the order of the
H A Duse_input_node.rst13 template< typename Body > input_node( graph &g, Body body, bool is_active=true )
29 activated after the entire flow graph is constructed.
56 state and then activate them after the whole graph is constructed.
57 However, this approach serializes graph construction and graph
62 the overlap of construction and execution. If your graph is a directed
63 acyclic graph (DAG), and each ``input_node`` has only one successor, you
68 function nodes, the following graph would not drop messages, even though
77 graph g;
78 oneapi::tbb::flow::graph g;
H A Dcancel_a_graph.rst7 To cancel a graph execution without an exception, you can create the
8 graph using an explicit task_group_context, and then call
17 graph g(t);
44 When a graph execution is canceled, any node that has already started to
51 within the node body and use it to cancel the execution of the graph it
58 graph g;
84 You can get the task_group_context from a node's body even if the graph
H A Dcatching_exceptions.rst10 of the graph's nodes are canceled and the exception is rethrown at the
11 call site of graph::wait_for_all(). Take the graph below as an example:
17 graph g;
42 graph to be canceled and the exception to be rethrown at the call to
63 effect on the overall execution of the graph. However, you could choose
77 In this case, the execution of the graph is canceled. For our example,
H A DDependence_Graph.rst7 In a dependence graph, the nodes invoke body objects to perform
12 application that could be expressed using a dependence graph.
30 general data flow graph, nodes in a dependence graph do not spawn a task
37 The following figure shows another example of a dependence graph. It has
60 To implement this as a flow graph, continue_node objects are used for
68 template< typename Body > continue_node( graph &g, Body body)
71 The first argument is the graph it belongs to and the second is a
89 oneapi::tbb::flow::graph g;
108 One possible execution of this graph is shown below. The execution of D
126 Again, it is important to note that all execution in the flow graph
H A Ddestroy_graphs_outside_main_thread.rst9 wait_for_all(). However, it is safest to call wait_for_all on a graph
11 and wait for the graph to complete. For example, assume you really do
13 Instead you can enqueue a task that creates the graph and waits for it:
22 graph g;
43 graph is complete.
H A Destimate_flow_graph_performance.rst7 The performance or scalability of a flow graph is not easy to predict.
20 predecessors to a node with no successors. In a dependence graph, the
22 have a strict ordering. Therefore, for a dependence graph, the
27 in your graph if executed sequentially. Then let C be the time
48 you have many fine-grained nodes in your flow graph, the impact of
50 depending on the graph structure, you can reduce such overheads by
H A Dcreate_token_based_system.rst7 A more flexible solution to limit the number of messages in a flow graph
9 are available in the graph and a message will not be allowed to enter
10 the graph until it can be paired with an available token. When a message
11 is retired from the graph, its token is released, and can be paired with
16 the flow graph interface, there is no explicit support for tokens, but
60 graph g;
110 back to the ``buffer_node``. This cycle in the flow graph allows the token
113 the graph. There could be three big objects in the ``function_node`` and one
117 Since there is no specific ``token_t`` defined for the flow graph, you can
135 concurrency in the graph.
[all …]
/oneTBB/include/oneapi/tbb/detail/
H A D_flow_graph_impl.h40 class graph; variable
45 friend class graph; variable
116 void activate_graph(graph& g);
117 void deactivate_graph(graph& g);
118 bool is_graph_active(graph& g);
123 class graph; variable
257 graph();
264 ~graph();
373 graph& g = my_graph; in finalize()
389 friend class graph; variable
[all …]
/oneTBB/test/tbb/
H A Dtest_profiling.cpp69 tbb::flow::graph g;
82 tbb::flow::graph g;
90 tbb::flow::graph g;
98 tbb::flow::graph g;
106 tbb::flow::graph g;
114 tbb::flow::graph g;
126 tbb::flow::graph g;
134 tbb::flow::graph g;
160 tbb::flow::graph g;
168 tbb::flow::graph g;
[all …]
H A Dtest_limiter_node.cpp157 tbb::flow::graph g; in test_parallel()
172 tbb::flow::graph g; in test_parallel()
193 tbb::flow::graph g; in test_serial()
278 tbb::flow::graph g; in test_multifunction_to_limiter()
314 tbb::flow::graph g; in test_continue_msg_reception()
333 graph g; in test_reserve_release_messages()
377 tbb::flow::graph g; in test_decrementer()
438 tbb::flow::graph g; in test_try_put_without_successors()
492 graph g; in test_deduction_guides()
512 tbb::flow::graph graph{}; in test_decrement_while_try_put_task() local
[all …]
H A Dtest_flow_graph.cpp39 tbb::flow::graph * const my_graph;
53 tbb::flow::graph h; in test_wait_count()
74 tbb::flow::graph& my_graph;
88 tbb::flow::graph g; in test_iterator()
97 for (tbb::flow::graph::iterator it = g.begin(); it != g.end(); ++it) { in test_iterator()
120 tbb::flow::graph& g;
152 tbb::flow::graph g; in test_parallel()
212 tbb::flow::graph& my_graph;
289 tbb::flow::graph g; in test_graph_arena()
348 graph g;
[all …]
H A Dtest_input_node.cpp42 tbb::flow::graph& my_graph;
46 test_push_receiver(tbb::flow::graph& g) : my_graph(g) { in test_push_receiver()
64 tbb::flow::graph& graph_reference() const override { in graph_reference()
115 tbb::flow::graph g; in test_single_dest()
166 tbb::flow::graph g; in test_reset()
262 graph g; in test_follows_and_precedes_api()
323 tbb::flow::graph g;
342 concept can_call_input_node_ctor = requires( tbb::flow::graph& graph, Body body, tbb::flow::buffer_…
343 tbb::flow::input_node<Output>(graph, body);
H A Dtest_continue_node.cpp101 tbb::flow::graph g; in continue_nodes()
133 tbb::flow::graph g; in continue_nodes_with_copy()
221 graph g; in test_two_graphs()
226 graph h; in test_two_graphs()
274 tbb::flow::graph g; in test_lightweight_policy()
333 graph g; in test_successor_cache_specialization()
393 concept can_call_continue_node_ctor = requires( tbb::flow::graph& graph, Body body,
396 tbb::flow::continue_node<Input>(graph, body);
397 tbb::flow::continue_node<Input>(graph, body, priority);
398 tbb::flow::continue_node<Input>(graph, num, body);
[all …]
/oneTBB/examples/
H A DCMakeLists.txt42 tbb_add_example(graph binpack)
49 tbb_add_example(graph cholesky)
51 …message(WARNING "Intel(R) Math Kernel Library (Intel(R) MKL) libraries were not found, graph/chole…
54 tbb_add_example(graph dining_philosophers)
55 tbb_add_example(graph fgbzip2)
56 tbb_add_example(graph logic_sim)
57 tbb_add_example(graph som)
H A DREADME.md9 | graph/binpack | A solution to the binpacking problem using a `queue_node`, a `buffer_node`, and `…
10 | graph/cholesky | Several versions of Cholesky Factorization algorithm implementation.
11 | graph/dining_philosophers | An implementation of dining philosophers in a graph using the reservi…
12 | graph/fgbzip2 | A parallel implementation of bzip2 block-sorting file compressor.
13 | graph/logic_sim | An example of a collection of digital logic gates that can be easily composed i…
14 | graph/som | An example of a Kohonen Self-Organizing Map using cancellation.
19 | parallel_for_each/parallel_preorder | Parallel preorder traversal of a graph.
/oneTBB/examples/graph/logic_sim/
H A Dbasics.hpp71 gate(oneapi::tbb::flow::graph& g, Body b) in gate()
88 oneapi::tbb::flow::graph& my_graph;
108 gate(oneapi::tbb::flow::graph& g, Body b) in gate()
125 oneapi::tbb::flow::graph& my_graph;
164 oneapi::tbb::flow::graph& my_graph;
206 oneapi::tbb::flow::graph& my_graph;
215 oneapi::tbb::flow::graph& my_graph;
264 oneapi::tbb::flow::graph& my_graph;
305 oneapi::tbb::flow::graph& my_graph;
332 oneapi::tbb::flow::graph& my_graph;
[all …]
/oneTBB/test/common/
H A Dtest_follows_and_precedes_api.h49 static void check(tbb::flow::graph& g,
58 static void check_impl(tbb::flow::graph& g,
75 static void check_impl(tbb::flow::graph& g,
92 static void check_impl(tbb::flow::graph& g,
107 static void check_impl(tbb::flow::graph& g,
145 static void check(tbb::flow::graph& g,
154 static void check_impl(tbb::flow::graph& g,
172 static void check_impl(tbb::flow::graph& g,
194 static void check_impl(tbb::flow::graph& g,
233 graph g;
[all …]

12345