Skip to content

Commit

Permalink
- add longestPathMethod for computing criticalPath and nodeLeveling o…
Browse files Browse the repository at this point in the history
…n taskGraph

- removed some unused stuff
- fixed bug in rootNodes in taskGraphMeta for the ODE-system

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@16682 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Volker Waurich committed Jul 25, 2013
1 parent 7e78e90 commit c0f43fe
Show file tree
Hide file tree
Showing 2 changed files with 761 additions and 291 deletions.
21 changes: 11 additions & 10 deletions Compiler/BackEnd/HpcOmSimCode.mo
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ algorithm
String fileName;
HpcOmTaskGraph.TaskGraphMeta taskGraphData1;
list<list<Integer>> parallelSets;
list<list<Integer>> criticalPaths;
Real cpCosts;

case (dlow, class_, _, fileDir, _, _, _, _, _, _, _, _) equation
uniqueEqIndex = 1;
Expand All @@ -157,9 +159,9 @@ algorithm
taskGraphData = HpcOmTaskGraph.createCosts(inBackendDAE, filenamePrefix +& "_prof.xml" , simEqSccMapping, 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 @@ -168,18 +170,17 @@ algorithm
//print("ODE-TASKGRAPH\n");
//HpcOmTaskGraph.printTaskGraph(taskGraphOde);
//HpcOmTaskGraph.printTaskGraphMeta(taskGraphDataOde);

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

//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);
//HpcOmTaskGraph.dumpAsGraphMLSccLevel(taskGraphOde, taskGraphDataOde, fileName);
//compute critical path on cost-level and determine the level of the node
(criticalPaths,cpCosts) = HpcOmTaskGraph.longestPathMethod(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);
//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);
Expand Down

0 comments on commit c0f43fe

Please sign in to comment.