Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

Dependency node graph design

nyue
Novice
820 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
794 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_example.html


Thanks and Regards,

Pendyala Sesha Srinivas


View solution in original post

0 Kudos
2 Replies
SeshaP_Intel
Moderator
795 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_example.html


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
SeshaP_Intel
Moderator
768 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


0 Kudos
Reply