Skip to content

Commit

Permalink
- added functions to compute levels of nodes in the taskGraph
Browse files Browse the repository at this point in the history
- added function to arrange the taskGraph in these levels

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@16577 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Volker Waurich committed Jul 11, 2013
1 parent a58c16c commit 773cccf
Show file tree
Hide file tree
Showing 2 changed files with 297 additions and 15 deletions.
10 changes: 6 additions & 4 deletions Compiler/BackEnd/HpcOmSimCode.mo
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ algorithm
HpcOmTaskGraph.TaskGraphMeta taskGraphDataOde;
String fileName;
HpcOmTaskGraph.TaskGraphMeta taskGraphData1;
list<list<Integer>> parallelSets;

case (dlow, class_, _, fileDir, _, _, _, _, _, _, _, _) equation
uniqueEqIndex = 1;
Expand All @@ -143,12 +144,11 @@ algorithm

//Append the costs to the taskGraphMeta
taskGraphData = HpcOmTaskGraph.createCosts(inBackendDAE, taskGraphData);

//HpcOmTaskGraph.printTaskGraph(taskGraph);
//HpcOmTaskGraph.printTaskGraphMeta(taskGraphData);

fileName = ("taskGraph"+&filenamePrefix+&".graphml");
HpcOmTaskGraph.dumpAsGraphMLSccLevel(taskGraph, taskGraphData, fileName);


// get the task graph for the ODEsystem
taskGraphOde = arrayCopy(taskGraph);
Expand All @@ -158,17 +158,19 @@ algorithm
//HpcOmTaskGraph.printTaskGraph(taskGraphOde);
//HpcOmTaskGraph.printTaskGraphMeta(taskGraphDataOde);

//assign levels(as an node property in the .graphml) to the nodes in the taskGraph. all nodes in one level can be computed in parallel
//HpcOmTaskGraph.arrangeGraphInLevels(taskGraphOde,taskGraphDataOde);


// filter to merge simple nodes (i.e. nodes with only 1 predecessor and 1 successor)
taskGraph1 = arrayCopy(taskGraphOde);
taskGraphData1 = HpcOmTaskGraph.copyTaskGraphMeta(taskGraphDataOde);
(taskGraph,taskGraphData) = HpcOmTaskGraph.mergeSimpleNodes(taskGraph1,taskGraphData1,inBackendDAE,filenamePrefix);
//print("MERGED GRAPH\n");
//HpcOmTaskGraph.printTaskGraph(taskGraph);
//HpcOmTaskGraph.printTaskGraphMeta(taskGraphData);

//HpcOmTaskGraph.printTaskGraph(taskGraphOde);
//HpcOmTaskGraph.printTaskGraphMeta(taskGraphDataOde);

fileName = ("taskGraph"+&filenamePrefix+&"ODE.graphml");
HpcOmTaskGraph.dumpAsGraphMLSccLevel(taskGraphOde, taskGraphDataOde, fileName);

Expand Down

0 comments on commit 773cccf

Please sign in to comment.