oneTBB documentation does not clarify how task_arena and flow::function_node priorities combine
There are two points in which we can specify the priority of a task in a flow graph:
- Initialise a task arena with low, normal or high priority and attach the graph to the arena through
flow::graph::reset() - Construct
function_nodewith atbb::flow::node_priority_targument.
However, I couldn't find any information regarding how graph priorities and task arena priorities combine with each other. For example, would two nodes with priorities 1 and 2 that belong to different graphs have different priorities if both graphs belong to the same task arena, or is the graph priority only a hint for the scheduler to pick the next task inside a graph when propagating a message from one node to one of its successors?
References: https://spec.oneapi.com/versions/latest/elements/oneTBB/source/flow_graph/node_priorities.html https://spec.oneapi.com/versions/latest/elements/oneTBB/source/task_scheduler/task_arena/task_arena_cls.html
Priorities specified in the nodes of the graph have nothing to do with the arena priorities, nor do they have with the prioritized nodes from the other graphs. In other words, priorities in the nodes of the graph are relative to other nodes in the same graph and only affect ordering of the messages within that graph.
Not sure the documentation shall tell something about that, meaning that if there was a connection between these two, it would be mentioned explicitly. Both documents describe priority relations in terms of the entities they are made for. If you have an idea how to explain the absence of relations better, please let us know.
Hi. Thanks for the explanation. Since the documentation uses the same word for both concepts, even though I agree with your point that they are explained in different entities, I think a disclaimer pointing this out (something like your first paragraph should be more than enough) would be great to avoid any confusion for someone trying to learn about how to prioritise flow graph work.