Skip to content

Commit

Permalink
- added functions to contract simple nodes in the task graph
Browse files Browse the repository at this point in the history
- added function copyTaskGraphMeta in order to avoid overwriting of arrays

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@16563 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Volker Waurich committed Jul 9, 2013
1 parent a7dcb6d commit a00188d
Show file tree
Hide file tree
Showing 2 changed files with 406 additions and 53 deletions.
16 changes: 12 additions & 4 deletions Compiler/BackEnd/HpcOmSimCode.mo
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,10 @@ algorithm

HpcOmTaskGraph.TaskGraph taskGraph;
HpcOmTaskGraph.TaskGraph taskGraphOde;
HpcOmTaskGraph.TaskGraph taskGraph1;
HpcOmTaskGraph.TaskGraphMeta taskGraphData;
HpcOmTaskGraph.TaskGraphMeta taskGraphDataOde;
HpcOmTaskGraph.TaskGraphMeta taskGraphData1;

case (dlow, class_, _, fileDir, _, _, _, _, _, _, _, _) equation
System.tmpTickReset(0);
Expand All @@ -141,14 +143,20 @@ algorithm
//HpcOmTaskGraph.printTaskGraphMeta(taskGraphData);

// get the task graph for the ODEsystem
//(taskGraphOde,taskGraphDataOde) = HpcOmTaskGraph.getOdeSystem(taskGraph,taskGraphData,inBackendDAE,filenamePrefix);
taskGraphOde = arrayCopy(taskGraph);
taskGraphDataOde = HpcOmTaskGraph.copyTaskGraphMeta(taskGraphData);
(taskGraphOde,taskGraphDataOde) = HpcOmTaskGraph.getOdeSystem(taskGraphOde,taskGraphDataOde,inBackendDAE,filenamePrefix);
//print("ODE-TASKGRAPH\n");
//HpcOmTaskGraph.printTaskGraph(taskGraphOde);
//HpcOmTaskGraph.printTaskGraphMeta(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);
(taskGraph,taskGraphData) = HpcOmTaskGraph.mergeSimpleNodes(taskGraph,taskGraphData,inBackendDAE,filenamePrefix);
//HpcOmTaskGraph.printTaskGraphMeta(taskGraphData);

uniqueEqIndex = 1;
ifcpp = stringEqual(Config.simCodeTarget(), "Cpp");
Expand Down Expand Up @@ -204,7 +212,7 @@ algorithm

// equation generation for euler, dassl2, rungekutta
(uniqueEqIndex, odeEquations, algebraicEquations, allEquations, tempvars) = SimCodeUtil.createEquationsForSystems(systs, shared, uniqueEqIndex, {}, {}, {}, tempvars);
//HpcOmTaskGraph.checkOdeSystemSize(taskGraphOde,odeEquations);
HpcOmTaskGraph.checkOdeSystemSize(taskGraphOde,odeEquations);
// modelInfo = SimCodeUtil.addTempVars(tempvars, modelInfo);
//
// // Assertions and crap
Expand Down

0 comments on commit a00188d

Please sign in to comment.