Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
Announcements
The Intel sign-in experience is changing in February to support enhanced security controls. If you sign in, click here for more information.

Dependency node graph design

nyue
Novice
100 Views

I am design a dependency node graph base on TBB flow graph.

 

I am debating if I should design my node's base case as a subclass of one of TBB's predefined node class or design my base class containing one of TBB's predefined node class.

 

Ultimately, I will wrap my base node derived classes within a UI e.g. Qt, something like this

 

 

(1) IsA design

class BaseNode : public oneapi::tbb::flow::continue_node {
};

or

 

(2) HasA design

class BaseNode {
oneapi::tbb::flow::continue_node _internal;
};

 

What are key questions I need to ask myself to help me select a suitable approach ?

 

Cheers

 

0 Kudos
1 Solution
SeshaP_Intel
Moderator
74 Views

Hi,


Thank you for posting in Intel Communities.


For your scenario, you can use 2nd design. The steps for using a dependency graph, need to create a graph object, make nodes, add edges, and feed messages into the graph. To express this dependency graph using the flow graph classes, you can use the class continue_node for the nodes and pass messages of type continue_msg. You can also use the join node so that the output of one of the continue_node is put to one of the join_node ports.

Please refer to the below link for more details.

https://spec.oneapi.io/versions/latest/elements/oneTBB/source/flow_graph/dependency_flow_graph_examp...


Thanks and Regards,

Pendyala Sesha Srinivas


View solution in original post

2 Replies
SeshaP_Intel
Moderator
75 Views

Hi,


Thank you for posting in Intel Communities.


For your scenario, you can use 2nd design. The steps for using a dependency graph, need to create a graph object, make nodes, add edges, and feed messages into the graph. To express this dependency graph using the flow graph classes, you can use the class continue_node for the nodes and pass messages of type continue_msg. You can also use the join node so that the output of one of the continue_node is put to one of the join_node ports.

Please refer to the below link for more details.

https://spec.oneapi.io/versions/latest/elements/oneTBB/source/flow_graph/dependency_flow_graph_examp...


Thanks and Regards,

Pendyala Sesha Srinivas


SeshaP_Intel
Moderator
48 Views

Hi,


Thanks for accepting our solution. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thanks and Regards,

Pendyala Sesha Srinivas


Reply