Skip to content

Commit a00188d

Browse files
author
Volker Waurich
committed
- added functions to contract simple nodes in the task graph
- 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
1 parent a7dcb6d commit a00188d

File tree

2 files changed

+406
-53
lines changed

2 files changed

+406
-53
lines changed

Compiler/BackEnd/HpcOmSimCode.mo

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,10 @@ algorithm
129129

130130
HpcOmTaskGraph.TaskGraph taskGraph;
131131
HpcOmTaskGraph.TaskGraph taskGraphOde;
132+
HpcOmTaskGraph.TaskGraph taskGraph1;
132133
HpcOmTaskGraph.TaskGraphMeta taskGraphData;
133134
HpcOmTaskGraph.TaskGraphMeta taskGraphDataOde;
135+
HpcOmTaskGraph.TaskGraphMeta taskGraphData1;
134136

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

143145
// get the task graph for the ODEsystem
144-
//(taskGraphOde,taskGraphDataOde) = HpcOmTaskGraph.getOdeSystem(taskGraph,taskGraphData,inBackendDAE,filenamePrefix);
146+
taskGraphOde = arrayCopy(taskGraph);
147+
taskGraphDataOde = HpcOmTaskGraph.copyTaskGraphMeta(taskGraphData);
148+
(taskGraphOde,taskGraphDataOde) = HpcOmTaskGraph.getOdeSystem(taskGraphOde,taskGraphDataOde,inBackendDAE,filenamePrefix);
149+
//print("ODE-TASKGRAPH\n");
145150
//HpcOmTaskGraph.printTaskGraph(taskGraphOde);
146151
//HpcOmTaskGraph.printTaskGraphMeta(taskGraphDataOde);
147152

148153
// filter to merge simple nodes (i.e. nodes with only 1 predecessor and 1 successor)
154+
taskGraph1 = arrayCopy(taskGraphOde);
155+
taskGraphData1 = HpcOmTaskGraph.copyTaskGraphMeta(taskGraphDataOde);
156+
(taskGraph,taskGraphData) = HpcOmTaskGraph.mergeSimpleNodes(taskGraph1,taskGraphData1,inBackendDAE,filenamePrefix);
157+
//print("MERGED GRAPH\n");
149158
//HpcOmTaskGraph.printTaskGraph(taskGraph);
150-
//HpcOmTaskGraph.printTaskGraphMeta(taskGraphData);
151-
(taskGraph,taskGraphData) = HpcOmTaskGraph.mergeSimpleNodes(taskGraph,taskGraphData,inBackendDAE,filenamePrefix);
159+
//HpcOmTaskGraph.printTaskGraphMeta(taskGraphData);
152160

153161
uniqueEqIndex = 1;
154162
ifcpp = stringEqual(Config.simCodeTarget(), "Cpp");
@@ -204,7 +212,7 @@ algorithm
204212

205213
// equation generation for euler, dassl2, rungekutta
206214
(uniqueEqIndex, odeEquations, algebraicEquations, allEquations, tempvars) = SimCodeUtil.createEquationsForSystems(systs, shared, uniqueEqIndex, {}, {}, {}, tempvars);
207-
//HpcOmTaskGraph.checkOdeSystemSize(taskGraphOde,odeEquations);
215+
HpcOmTaskGraph.checkOdeSystemSize(taskGraphOde,odeEquations);
208216
// modelInfo = SimCodeUtil.addTempVars(tempvars, modelInfo);
209217
//
210218
// // Assertions and crap

0 commit comments

Comments
 (0)