Skip to content

Commit 1e28a6a

Browse files
author
Volker Waurich
committed
- arranged some additional output in function analyseScheduledTaskGraph
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@18400 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 6ea80e0 commit 1e28a6a

File tree

2 files changed

+52
-11
lines changed

2 files changed

+52
-11
lines changed

Compiler/BackEnd/HpcOmScheduler.mo

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2048,6 +2048,54 @@ algorithm
20482048
end printSchedule;
20492049

20502050

2051+
public function analyseScheduledTaskGraph"functions to analyse the scheduled task graph can be applied in here.
2052+
author:Waurich TUD 2013-12"
2053+
input Schedule scheduleIn;
2054+
input Integer numProcIn;
2055+
input HpcOmTaskGraph.TaskGraph taskGraphIn;
2056+
input HpcOmTaskGraph.TaskGraphMeta taskGraphMetaIn;
2057+
output String criticalPathInfoOut;
2058+
algorithm
2059+
criticalPathInfoOut := match(scheduleIn,numProcIn,taskGraphIn,taskGraphMetaIn)
2060+
local
2061+
list<String> lockIdc;
2062+
list<list<Integer>> levels;
2063+
list<list<Integer>> parallelSets;
2064+
list<list<Integer>> criticalPaths, criticalPathsWoC;
2065+
array<list<Task>> threadTasks;
2066+
Real cpCosts, cpCostsWoC, serTime, parTime, speedUp, speedUpMax;
2067+
String criticalPathInfo;
2068+
case(LEVELSCHEDULE(eqsOfLevels=levels),_,_,_)
2069+
equation
2070+
//get the criticalPath
2071+
((criticalPaths,cpCosts),(criticalPathsWoC,cpCostsWoC),parallelSets) = HpcOmTaskGraph.longestPathMethod(taskGraphIn,taskGraphMetaIn);
2072+
criticalPathInfo = HpcOmTaskGraph.dumpCriticalPathInfo((criticalPaths,cpCosts),(criticalPathsWoC,cpCostsWoC));
2073+
Debug.fcall(Flags.HPCOM_DUMP,print,criticalPathInfo);
2074+
then
2075+
criticalPathInfo;
2076+
case(THREADSCHEDULE(threadTasks=threadTasks,lockIdc=lockIdc),_,_,_)
2077+
equation
2078+
Debug.fcall(Flags.HPCOM_DUMP,print,"the number of locks: "+&intString(listLength(lockIdc))+&"\n");
2079+
//get the criticalPath
2080+
((criticalPaths,cpCosts),(criticalPathsWoC,cpCostsWoC),parallelSets) = HpcOmTaskGraph.longestPathMethod(taskGraphIn,taskGraphMetaIn);
2081+
criticalPathInfo = HpcOmTaskGraph.dumpCriticalPathInfo((criticalPaths,cpCosts),(criticalPathsWoC,cpCostsWoC));
2082+
Debug.fcall(Flags.HPCOM_DUMP,print,criticalPathInfo);
2083+
//predict speedup etc.
2084+
(serTime,parTime,speedUp,speedUpMax) = predictExecutionTime(scheduleIn,SOME(cpCostsWoC),numProcIn,taskGraphIn,taskGraphMetaIn);
2085+
Debug.fcall(Flags.HPCOM_DUMP,print,"the serialCosts: "+&realString(serTime)+&"\n");
2086+
Debug.fcall(Flags.HPCOM_DUMP,print,"the parallelCosts: "+&realString(parTime)+&"\n");
2087+
Debug.fcall(Flags.HPCOM_DUMP,print,"the cpCosts: "+&realString(cpCostsWoC)+&"\n");
2088+
printPredictedExeTimeInfo(serTime,parTime,speedUp,speedUpMax,numProcIn);
2089+
then
2090+
criticalPathInfo;
2091+
case(EMPTYSCHEDULE(),_,_,_)
2092+
equation
2093+
then
2094+
"";
2095+
end match;
2096+
end analyseScheduledTaskGraph;
2097+
2098+
20512099
public function predictExecutionTime "computes the theoretically execution time for the serial simulation and the parallel. a speedup ratio is determined by su=serTime/parTime.
20522100
the max speedUp is computed via the serTime/criticalPathCosts.
20532101
author:Waurich TUD 2013-11"
@@ -2117,8 +2165,6 @@ algorithm
21172165
isNotOkString = "Something is weird. The predicted SpeedUp is "+&realString(speedUp)+&" and the theoretical maximum speedUp is "+&realString(speedUpMax)+&"\n";
21182166
Debug.bcall(realGt(speedUp,speedUpMax),print,isNotOkString);
21192167
Debug.bcall(realLe(speedUp,speedUpMax),print,isOkString);
2120-
Debug.fcall(Flags.HPCOM_DUMP,print,"the serialCosts: "+&realString(serTime)+&"\n");
2121-
Debug.fcall(Flags.HPCOM_DUMP,print,"the parallelCosts: "+&realString(parTime)+&"\n");
21222168
then
21232169
();
21242170
end matchcontinue;

Compiler/BackEnd/HpcOmSimCode.mo

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -232,22 +232,17 @@ algorithm
232232
//Apply filters
233233
//-------------
234234
(taskGraph1,taskGraphData1) = applyFiltersToGraph(taskGraphOde,taskGraphDataOde,inBackendDAE,true);
235-
Debug.fcall(Flags.HPCOM_DUMP,HpcOmTaskGraph.printTaskGraph,taskGraph1);
236-
Debug.fcall(Flags.HPCOM_DUMP,HpcOmTaskGraph.printTaskGraphMeta,taskGraphData1);
235+
//Debug.fcall(Flags.HPCOM_DUMP,HpcOmTaskGraph.printTaskGraph,taskGraph1);
236+
//Debug.fcall(Flags.HPCOM_DUMP,HpcOmTaskGraph.printTaskGraphMeta,taskGraphData1);
237237

238238
//Create schedule
239239
//---------------
240240
numProc = Flags.getConfigInt(Flags.NUM_PROC);
241241
(numProc,numFixed) = setNumProc(numProc,cpCostsWoC,taskGraphDataOde);
242242
schedule = createSchedule(taskGraph1,taskGraphData1,sccSimEqMapping,filenamePrefix,numProc);
243243
(schedule,numProc) = repeatScheduleWithOtherNumProc(taskGraph1,taskGraphData1,sccSimEqMapping,filenamePrefix,cpCostsWoC,schedule,numProc,numFixed);
244-
245-
(serTime,parTime,speedUp,speedUpMax) = HpcOmScheduler.predictExecutionTime(schedule,SOME(cpCostsWoC),numProc,taskGraph1,taskGraphData1);
246-
HpcOmScheduler.printPredictedExeTimeInfo(serTime,parTime,speedUp,speedUpMax,numProc);
247-
((criticalPaths,cpCosts),(criticalPathsWoC,cpCostsWoC),parallelSets) = HpcOmTaskGraph.longestPathMethod(taskGraph1,taskGraphData1);
248-
criticalPathInfo = HpcOmTaskGraph.dumpCriticalPathInfo((criticalPaths,cpCosts),(criticalPathsWoC,cpCostsWoC));
249-
Debug.fcall(Flags.HPCOM_DUMP,print,criticalPathInfo);
250-
244+
criticalPathInfo = HpcOmScheduler.analyseScheduledTaskGraph(schedule,numProc,taskGraph1,taskGraphData1);
245+
251246
taskScheduleSimCode = HpcOmScheduler.convertScheduleToSimCodeSchedule(schedule);
252247
schedulerInfo = HpcOmScheduler.convertScheduleStrucToInfo(schedule,arrayLength(taskGraph));
253248

0 commit comments

Comments
 (0)