This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler: about schedule openvx graph

Tool/software: TI C/C++ Compiler


Hi TI,

I have 2 questions about OPENVX graph operation

1, if I created a graph ,and I register 3 user defined kernels,  then I use "tivxCreateNodeByKernelName" to create 3 nodes and insert to this graph

each node connect to previously defined kernels, and i configed the graph to be "VX_GRAPH_SCHEDULE_MODE_NORMAL"

so this means i need to schedule this graph by hand.

my question is ,when i call "vxProcessGraph" to schedule this graph, what is the excute sequence of these 3 nodes? one by one? who will be first?

2, this graph has 3 nodes, and each of them has a graph also, this means we totally have 4 graphs and 4 "vxProcessGraph",
   in this situation, can it run ok?

Best Regards

  • Haibo Xu said:
    my question is ,when i call "vxProcessGraph" to schedule this graph, what is the excute sequence of these 3 nodes? one by one? who will be first?

    The graph defines a data flow dependency.  If, as you say, one node's input is coming as the output of an upstream node, then that node can not, and will not begin until the upstream node has completed.  In following graph, node 2 will not start until node 1 is finished due to data dependency.  That is the point of the graph structure.

    node1  -> data1 -> node 2

    In the following graph, if node2 and node3 are both dependent on the output of node1, then it is possible that they could be executed in parallel since they both have all the data they need to run.  In this case, if they are scheduled on different targets, then they could run in parallel).  If they are scheduled on same target, then one will run before the other, but it is not specified the order of which will execute first.

    node1 -> data 1 -> node2

                           |-> node3

    Haibo Xu said:
    2, this graph has 3 nodes, and each of them has a graph also, this means we totally have 4 graphs and 4 "vxProcessGraph",
       in this situation, can it run ok?

    We have not tested this nesting of graphs, so I can't say if it should run okay or not depending on your situation.  However, consider that each node is processed from a callback from the framework for a given target.  Each target is a different thread, and new requests that come from the framework are queued to be run on each target  and are run to completion before next one can start.  So if you are running node1 on target1, and then this node has a graph that tries to run node2 on target1, then there will be a deadlock situation since the processing of node1 callback has not returned since it is dependent on the completion of a node2 which is waiting for node1 to complete on target1 before it can execute.