@@ -136,13 +136,13 @@ algorithm
136136 list< SimCode . StateSet > stateSets;
137137 array< Integer > systemIndexMap;
138138 list< tuple< Integer ,Integer >> equationSccMapping, equationSccMapping1; // Maps each simEq to the scc
139- array< list< Integer >> sccSimEqMapping; // Maps each scc to a list of simEqs
139+ array< list< Integer >> sccSimEqMapping, daeSccMapping ; // Maps each scc to a list of simEqs
140140 array< Integer > simeqCompMapping; // Maps each simEq to the scc
141141 list< BackendDAE . TimeEvent > timeEvents;
142142 BackendDAE . StrongComponents allComps, initComps;
143143
144- HpcOmTaskGraph . TaskGraph taskGraph, taskGraphOde, taskGraphEvent, taskGraphSimplified, taskGraphScheduled, taskGraphInit;
145- HpcOmTaskGraph . TaskGraphMeta taskGraphData, taskGraphDataOde, taskGraphDataEvent, taskGraphDataSimplified,taskGraphDataScheduled, taskGraphDataInit;
144+ HpcOmTaskGraph . TaskGraph taskGraph, taskGraphDAE, taskGraphOde, taskGraphEvent, taskGraphSimplified, taskGraphScheduled, taskGraphInit;
145+ HpcOmTaskGraph . TaskGraphMeta taskGraphData, taskGraphDataDAE, taskGraphDataOde, taskGraphDataEvent, taskGraphDataSimplified,taskGraphDataScheduled, taskGraphDataInit;
146146 String fileName, fileNamePrefix;
147147 Integer numProc;
148148 list< list< Integer >> parallelSets;
@@ -192,42 +192,59 @@ algorithm
192192 parameterEquations, removedEquations, algorithmAndEquationAsserts, zeroCrossingsEquations, jacobianEquations, stateSets, constraints, classAttributes, zeroCrossings, relations, timeEvents, whenClauses,
193193 discreteModelVars, extObjInfo, makefileParams, delayedExps, jacobianMatrixes, simulationSettingsOpt, fileNamePrefix, _, _, _, crefToSimVarHT, backendMapping) = simCode;
194194
195+ // get SCC to simEqSys-mappping
196+ // ----------------------------
195197 (allComps,_) = HpcOmTaskGraph . getSystemComponents(inBackendDAE);
196198 // print("All components size: " +& intString(listLength(allComps)) +& "\n");
197199 highestSccIdx = findHighestSccIdxInMapping(equationSccMapping,-1 );
198200 compCountPlusDummy = listLength(allComps)+ 1 ;
199201 equationSccMapping1 = removeDummyStateFromMapping(equationSccMapping);
200202 // the mapping can contain a dummy state as first scc
201203 equationSccMapping = Util . if_(intEq(highestSccIdx, compCountPlusDummy), equationSccMapping1, equationSccMapping);
202-
203204 sccSimEqMapping = convertToSccSimEqMapping(equationSccMapping, listLength(allComps));
204205 simeqCompMapping = convertToSimeqCompMapping(equationSccMapping, lastEqMappingIdx);
205206 simEqIdxSimEqMapping = getSimEqIdxSimEqMapping(allEquations, arrayLength(simeqCompMapping));
206207
207208 // dumpSimEqSCCMapping(simeqCompMapping);
208- SimCodeUtil . execStat("hpcom setup" );
209-
210209 // dumpSccSimEqMapping(sccSimEqMapping);
211210
212- // Create TaskGraph
213- // ----------------
211+ // Create TaskGraph for all strongly connected components
212+ // ------------------------------------------------------
214213 (taskGraph,taskGraphData) = HpcOmTaskGraph . createTaskGraph(inBackendDAE,filenamePrefix);
215214 SimCodeUtil . execStat("hpcom createTaskGraph" );
216-
215+
217216 // Create Costs
218217 // ------------
219218 taskGraphData = HpcOmTaskGraph . createCosts(inBackendDAE, filenamePrefix +& "_eqs_prof" , simeqCompMapping, taskGraphData);
220219 SimCodeUtil . execStat("hpcom create costs" );
221-
220+
222221 fileName = ("taskGraph" +& filenamePrefix+& ".graphml" );
223222 schedulerInfo = arrayCreate(arrayLength(taskGraph), (-1 ,-1 ,-1 . 0 ));
224223 HpcOmTaskGraph . dumpAsGraphMLSccLevel(taskGraph, taskGraphData,inBackendDAE, fileName, "" , {}, {}, sccSimEqMapping ,schedulerInfo);
225224 SimCodeUtil . execStat("hpcom dump TaskGraph" );
226-
225+
226+ // print("DAE_onlySCCs\n");
227227 // HpcOmTaskGraph.printTaskGraph(taskGraph);
228228 // HpcOmTaskGraph.printTaskGraphMeta(taskGraphData);
229+
230+ // Get complete DAE System
231+ // -----------------------
232+ taskGraphDAE = arrayCopy(taskGraph);
233+ taskGraphDataDAE = HpcOmTaskGraph . copyTaskGraphMeta(taskGraphData);
234+ (taskGraphDAE,taskGraphDataDAE) = HpcOmTaskGraph . appendRemovedEquations(inBackendDAE,taskGraphDAE,taskGraphDataDAE);
235+
236+ fileName = ("taskGraph" +& filenamePrefix+& "DAE.graphml" );
237+ daeSccMapping = listArray(List . map(SimCodeUtil . getRemovedEquationSimEqSysIdxes(simCode),List . create));
238+ daeSccMapping = Util . arrayAppend(sccSimEqMapping,daeSccMapping);
239+ schedulerInfo = arrayCreate(arrayLength(taskGraphDAE), (-1 ,-1 ,-1 . 0 ));
240+ HpcOmTaskGraph . dumpAsGraphMLSccLevel(taskGraphDAE, taskGraphDataDAE,inBackendDAE, fileName, "" , {}, {}, daeSccMapping ,schedulerInfo);
241+
242+ // print("DAE\n");
243+ // HpcOmTaskGraph.printTaskGraph(taskGraphDAE);
244+ // HpcOmTaskGraph.printTaskGraphMeta(taskGraphDataDAE);
229245
230246 // Get Event System
247+ // ----------------
231248 taskGraphEvent = arrayCopy(taskGraph);
232249 taskGraphDataEvent = HpcOmTaskGraph . copyTaskGraphMeta(taskGraphData);
233250 (taskGraphEvent,taskGraphDataEvent) = HpcOmTaskGraph . getEventSystem(taskGraphEvent,taskGraphDataEvent,inBackendDAE, zeroCrossings, simeqCompMapping);
@@ -251,14 +268,15 @@ algorithm
251268 taskGraphMetaMessage = Util . if_(taskGraphMetaValid, "TaskgraphMeta valid \n " , "TaskgraphMeta invalid \n " );
252269 print(taskGraphMetaMessage);
253270
271+ // print("ODE\n");
254272 // HpcOmTaskGraph.printTaskGraph(taskGraphOde);
255273 // HpcOmTaskGraph.printTaskGraphMeta(taskGraphDataOde);
256274
257275 // Assign levels and get critcal path
258276 // ----------------------------------
259277 ((criticalPaths,cpCosts),(criticalPathsWoC,cpCostsWoC),_) = HpcOmTaskGraph . getCriticalPaths(taskGraphOde,taskGraphDataOde);
260278 criticalPathInfo = HpcOmTaskGraph . dumpCriticalPathInfo((criticalPaths,cpCosts),(criticalPathsWoC,cpCostsWoC));
261- ((graphOps,graphCosts)) = HpcOmTaskGraph . sumUpExecCosts( taskGraphDataOde);
279+ ((graphOps,graphCosts)) = HpcOmTaskGraph . sumUpExeCosts(taskGraphOde, taskGraphDataOde);
262280 graphCosts = HpcOmTaskGraph . roundReal(graphCosts,2 );
263281 criticalPathInfo = criticalPathInfo +& " sum: (" +& realString(graphCosts) +& " ; " +& intString(graphOps) +& ")" ;
264282 fileName = ("taskGraph" +& filenamePrefix+& "ODE.graphml" );
@@ -268,9 +286,9 @@ algorithm
268286 SimCodeUtil . execStat("hpcom dump ODE TaskGraph" );
269287
270288 // Analyse Systems of Equations
271- // -------------
289+ // -----------------------------
272290 (scheduledTasks,scheduledDAENodes) = HpcOmEqSystems . parallelizeTornSystems(taskGraphOde,taskGraphDataOde,sccSimEqMapping,inBackendDAE);
273- HpcOmScheduler . printTaskList(scheduledTasks);
291+ // HpcOmScheduler.printTaskList(scheduledTasks);
274292
275293 // Apply filters
276294 // -------------
0 commit comments