Skip to content

Commit

Permalink
- longestPathMethod can handle contracted nodes
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@17718 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Volker Waurich committed Oct 16, 2013
1 parent e617dd0 commit a5414f2
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions Compiler/BackEnd/HpcOmTaskGraph.mo
Expand Up @@ -5176,10 +5176,9 @@ algorithm
primalChildLst = arrayGet(inComps,childNode);
true = listLength(primalChildLst) > 1;
primalChild = listGet(primalChildLst,1);
((_,costs)) = arrayGet(exeCosts,primalChild);
print("getCostsForNode failed!- implement cost computation for contracted rootNodes");
costs = getCostsForContractedNodes(primalChildLst,exeCosts);
then
fail();
costs;
case(_,_,_,_,_)
equation
// the childNode is not contracted
Expand All @@ -5199,9 +5198,9 @@ algorithm
primalChildLst = arrayGet(inComps,childNode);
primalParentLst = arrayGet(inComps,parentNode);
true = listLength(primalChildLst) > 1;
print("getCostsForNode failed! - implement cost computation for contracted childNode");
costs = getCostsForContractedNodes(primalChildLst,exeCosts);
then
fail();
costs;
else
equation
print("getCostsForNode failed! \n");
Expand All @@ -5211,6 +5210,30 @@ algorithm
end getCostsForNode;


protected function getCostsForContractedNodes "sums up alle execution costs for a contracted node.
authro:Waurich TUD 2013-10"
input list<Integer> nodeList;
input array<tuple<Integer,Real>> exeCosts;
output Real costsOut;
algorithm
costsOut := List.fold1(nodeList,getCostsForContractedNodes1,exeCosts,0.0);
end getCostsForContractedNodes;


protected function getCostsForContractedNodes1 "gets exeCosts for one node and add it to the foldType.
author:Waurich TUD 2013-10"
input Integer node;
input array<tuple<Integer,Real>> exeCosts;
input Real costsIn;
output Real costsOut;
protected
Real exeCost;
algorithm
((_,exeCost)) := arrayGet(exeCosts,node);
costsOut := realAdd(costsIn,exeCost);
end getCostsForContractedNodes1;


protected function getNodeCoords " computes the location of the nodes in the .graphml with regard to the parallel sets
author:Waurich TUD 2013-07"
input list<list<Integer>> parallelSets;
Expand Down

0 comments on commit a5414f2

Please sign in to comment.