Skip to content

Commit

Permalink
- renamed "HpcOmTaskGraphMeta.nodeDescs" to "HpcOmTaskGraphMeta.compD…
Browse files Browse the repository at this point in the history
…escs"

- improved the array-unrolling functions in HpcomMemory
- changed CheckODESystemSize of HPCOM -> it checks the scheduled graph now
- added a resize-function to the cpp-arrays (required for array unrolling)

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@24070 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Marcus Walther committed Jan 16, 2015
1 parent 7cfec8b commit 0c05fbf
Show file tree
Hide file tree
Showing 9 changed files with 399 additions and 257 deletions.
12 changes: 6 additions & 6 deletions Compiler/BackEnd/HpcOmEqSystems.mo
Expand Up @@ -2772,7 +2772,7 @@ protected
array<tuple<Integer,Integer,Integer>> eqCompMapping, varCompMapping;
list<list<String>> eqCharsLst;
array<Integer> nodeMark;
array<String> nodeDescs, nodeNames;
array<String> compDescs, nodeNames;
array<list<Integer>> inComps;
array<tuple<Integer,Real>> exeCosts;
array<HpcOmTaskGraph.Communications> commCosts;
Expand All @@ -2792,8 +2792,8 @@ algorithm
varStrings := List.map(varLst,HpcOmTaskGraph.getVarString);
descLst := List.map1(eqStrings,stringAppend," FOR ");
descLst := List.threadMap(descLst,varStrings,stringAppend);
nodeDescs := listArray(descLst);
metaOut := HpcOmTaskGraph.TASKGRAPHMETA(inComps,varCompMapping,eqCompMapping,{},nodeNames,nodeDescs,exeCosts,commCosts,nodeMark);
compDescs := listArray(descLst);
metaOut := HpcOmTaskGraph.TASKGRAPHMETA(inComps,varCompMapping,eqCompMapping,{},nodeNames,compDescs,exeCosts,commCosts,nodeMark);
end buildTaskgraphMetaForTornSystem;

protected function buildDummyCommCosts "generates preliminary commCosts for a children list.
Expand Down Expand Up @@ -2890,13 +2890,13 @@ protected
GraphML.GraphInfo tmpGraph;
Integer nameAttIdx;
list<Integer> childNodes;
array<String> nodeDescs;
array<String> compDescs;
array<list<Integer>> inComps;
GraphML.NodeLabel nodeLabel;
String nodeString, nodeDesc, nodeName;
algorithm
HpcOmTaskGraph.TASKGRAPHMETA(inComps=inComps,nodeDescs=nodeDescs) := metaIn;
nodeDesc := arrayGet(nodeDescs,nodeIdx);
HpcOmTaskGraph.TASKGRAPHMETA(inComps=inComps,compDescs=compDescs) := metaIn;
nodeDesc := arrayGet(compDescs,nodeIdx);
nodeString := intString(nodeIdx);
nodeName := stringDelimitList(List.map(arrayGet(inComps,nodeIdx),intString),",");
nameAttIdx := listGet(atts,1);
Expand Down
244 changes: 149 additions & 95 deletions Compiler/BackEnd/HpcOmMemory.mo

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions Compiler/BackEnd/HpcOmScheduler.mo
Expand Up @@ -1552,7 +1552,7 @@ protected
list<HpcOmSimCode.TaskList> levelTasks;
array<tuple<Integer,Integer,Integer>> varCompMapping, eqCompMapping;
list<Integer> rootNodes;
array<String> nodeNames, nodeDescs;
array<String> nodeNames, compDescs;
array<tuple<Integer,Real>> exeCosts;
array<HpcOmTaskGraph.Communications> commCosts;
algorithm
Expand Down Expand Up @@ -1584,11 +1584,11 @@ algorithm
oSchedule := HpcOmSimCode.LEVELSCHEDULE(levelTasks, false);

//update nodeMark for graphml representation
HpcOmTaskGraph.TASKGRAPHMETA(inComps=inComps,varCompMapping=varCompMapping,eqCompMapping=eqCompMapping,rootNodes=rootNodes,nodeNames=nodeNames,nodeDescs=nodeDescs,exeCosts=exeCosts, commCosts=commCosts) := iMeta;
HpcOmTaskGraph.TASKGRAPHMETA(inComps=inComps,varCompMapping=varCompMapping,eqCompMapping=eqCompMapping,rootNodes=rootNodes,nodeNames=nodeNames,compDescs=compDescs,exeCosts=exeCosts, commCosts=commCosts) := iMeta;
nodeMark := arrayCreate(arrayLength(inComps),-1);
level := List.map(allSections,List.flatten);
((_,nodeMark)) := List.fold(level,getLevelAssignment,(1,nodeMark));
oMeta := HpcOmTaskGraph.TASKGRAPHMETA(inComps,varCompMapping,eqCompMapping,rootNodes,nodeNames,nodeDescs,exeCosts,commCosts,nodeMark);
oMeta := HpcOmTaskGraph.TASKGRAPHMETA(inComps,varCompMapping,eqCompMapping,rootNodes,nodeNames,compDescs,exeCosts,commCosts,nodeMark);
end createBalancedLevelScheduling;

protected function BLS_mergeSmallSections"traverses the sections in a level and merges them if they are to small
Expand Down Expand Up @@ -1940,9 +1940,9 @@ protected
list<Integer> rootNodes;
array<HpcOmTaskGraph.Communications> commCosts;
array<tuple<Integer,Integer,Integer>> varCompMapping, eqCompMapping; //Map each variable to the scc that solves her
array<String> nodeNames, nodeDescs;
array<String> nodeNames, compDescs;
algorithm
HpcOmTaskGraph.TASKGRAPHMETA(inComps=inComps,varCompMapping=varCompMapping,eqCompMapping=eqCompMapping,rootNodes=rootNodes,nodeNames=nodeNames,nodeDescs=nodeDescs,exeCosts=exeCosts, commCosts=commCosts) := iMeta;
HpcOmTaskGraph.TASKGRAPHMETA(inComps=inComps,varCompMapping=varCompMapping,eqCompMapping=eqCompMapping,rootNodes=rootNodes,nodeNames=nodeNames,compDescs=compDescs,exeCosts=exeCosts, commCosts=commCosts) := iMeta;

graphT := BackendDAEUtil.transposeMatrix(iGraph,arrayLength(iGraph));
//(_,startNodes) := List.filterOnTrueSync(arrayList(graphT),List.isEmpty,List.intRange(arrayLength(graphT)));
Expand All @@ -1963,7 +1963,7 @@ algorithm
//update nodeMark for graphml representation
nodeMark := arrayCreate(arrayLength(inComps),-1);
((_,nodeMark)) := List.fold(level,getLevelAssignment,(1,nodeMark));
oMeta := HpcOmTaskGraph.TASKGRAPHMETA(inComps,varCompMapping,eqCompMapping,rootNodes,nodeNames,nodeDescs,exeCosts,commCosts,nodeMark);
oMeta := HpcOmTaskGraph.TASKGRAPHMETA(inComps,varCompMapping,eqCompMapping,rootNodes,nodeNames,compDescs,exeCosts,commCosts,nodeMark);
end createLevelSchedule;

protected function getLevelAssignment"folding function to get a levelassignment for each node"
Expand Down Expand Up @@ -3075,7 +3075,7 @@ algorithm
array<tuple<Integer,Integer,Integer>> varCompMapping,eqCompMapping,mapDupl;
tuple<Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer> idcs;
list<Integer> order, rootNodes;
array<String> nodeNames, nodeDescs;
array<String> nodeNames, compDescs;
list<list<Integer>> clusters, duplSccSimEqMap, duplComps;
HpcOmSimCode.Schedule schedule;
SimCode.ModelInfo modelInfo;
Expand Down Expand Up @@ -3118,7 +3118,7 @@ algorithm
// extract object stuff
SimCode.SIMCODE(modelInfo = SimCode.MODELINFO(vars=simVars), odeEquations=odes) = iSimCode;
SimCodeVar.SIMVARS(algVars=algVars) = simVars;
HpcOmTaskGraph.TASKGRAPHMETA(inComps=inComps,varCompMapping=varCompMapping,eqCompMapping=eqCompMapping,rootNodes=rootNodes,nodeNames=nodeNames,nodeDescs=nodeDescs,exeCosts=exeCosts,commCosts=commCosts,nodeMark=nodeMark) = iTaskGraphMeta;
HpcOmTaskGraph.TASKGRAPHMETA(inComps=inComps,varCompMapping=varCompMapping,eqCompMapping=eqCompMapping,rootNodes=rootNodes,nodeNames=nodeNames,compDescs=compDescs,exeCosts=exeCosts,commCosts=commCosts,nodeMark=nodeMark) = iTaskGraphMeta;
/*
//dumping stuff-------------------------
print("simCode1 \n");
Expand Down Expand Up @@ -3161,10 +3161,10 @@ algorithm
varCompMapping = arrayAppend(varCompMapping,arrayCreate(numDupl,(0,0,0)));
eqCompMapping = arrayAppend(eqCompMapping,arrayCreate(numDupl,(0,0,0)));
nodeNames = arrayAppend(nodeNames,arrayCreate(numDupl,"duplicated"));
nodeDescs = arrayAppend(nodeDescs,arrayCreate(numDupl,"duplicated"));
compDescs = arrayAppend(compDescs,arrayCreate(numDupl,"duplicated"));
exeCosts = arrayAppend(exeCosts,arrayCreate(numDupl,(1,1.0)));
nodeMark = arrayAppend(nodeMark,arrayCreate(numDupl,-1));
meta = HpcOmTaskGraph.TASKGRAPHMETA(comps,varCompMapping,eqCompMapping,rootNodes,nodeNames,nodeDescs,exeCosts,commCosts,nodeMark);
meta = HpcOmTaskGraph.TASKGRAPHMETA(comps,varCompMapping,eqCompMapping,rootNodes,nodeNames,compDescs,exeCosts,commCosts,nodeMark);
//assign new simEqSysIndexes
newIdxAss = arrayCreate(SimCodeUtil.getMaxSimEqSystemIndex(simCode),-1);
(simCode,newIdxAss) = TDS_assignNewSimEqSysIdxs(simCode,newIdxAss);
Expand Down

0 comments on commit 0c05fbf

Please sign in to comment.