@@ -2048,6 +2048,54 @@ algorithm
20482048end 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+
20512099public function predictExecutionTime "computes the theoretically execution time for the serial simulation and the parallel. a speedup ratio is determined by su=serTime/parTime.
20522100the max speedUp is computed via the serTime/criticalPathCosts.
20532101author: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;
0 commit comments