Skip to content

Commit

Permalink
[Janitor mode] Fix whitespace
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@23673 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
OpenModelica-Hudson committed Dec 5, 2014
1 parent 2cfcbd3 commit 0615864
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions Compiler/BackEnd/HpcOmScheduler.mo
Expand Up @@ -5435,7 +5435,7 @@ protected function analyseScheduledTaskGraphLevel
input HpcOmTaskGraph.TaskGraphMeta iTaskGraphMeta;
input LevelParallelSectionFunc iParallelSectionCalculator;
output String oCriticalPathInfo;

partial function LevelParallelSectionFunc //function that calculates the parallel time required for a section
input HpcOmSimCode.TaskList iSectionTasks;
input HpcOmTaskGraph.TaskGraph iTaskGraph;
Expand Down Expand Up @@ -5466,7 +5466,7 @@ algorithm
i := 1;
for levelCost in levelCosts loop
costShare := intDiv(realInt(levelCost)*100,realInt(parTime));
print("\tcosts for level " + intString(i) + ": " + realString(levelCost) + " (" + System.snprintff("%.0f", 5, costShare) + "%)\n");
print("\tcosts for level " + intString(i) + ": " + realString(levelCost) + " (" + System.snprintff("%.0f", 5, costShare) + "%)\n");
i := i + 1;
end for;
end if;
Expand Down Expand Up @@ -5508,12 +5508,12 @@ algorithm
taskCosts = getLevelTaskCosts(iTask, iTaskGraphMeta);
minWorkLoad = Array.fold(iThreadWorkLoad,realMin,arrayGet(iThreadWorkLoad,1));
threadIdx = List.position(minWorkLoad,arrayList(iThreadWorkLoad));
tmpThreadWorkLoad = arrayUpdate(iThreadWorkLoad,threadIdx,minWorkLoad + taskCosts);
tmpThreadWorkLoad = arrayUpdate(iThreadWorkLoad,threadIdx,minWorkLoad + taskCosts);
then tmpThreadWorkLoad;
case(HpcOmSimCode.CALCTASK_LEVEL(threadIdx = SOME(threadIdx)),_,_)
equation
taskCosts = getLevelTaskCosts(iTask, iTaskGraphMeta);
tmpThreadWorkLoad = arrayUpdate(iThreadWorkLoad,threadIdx,arrayGet(iThreadWorkLoad, threadIdx) + taskCosts);
tmpThreadWorkLoad = arrayUpdate(iThreadWorkLoad,threadIdx,arrayGet(iThreadWorkLoad, threadIdx) + taskCosts);
then tmpThreadWorkLoad;
end match;
end getLevelParallelTime1;
Expand Down
18 changes: 9 additions & 9 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -1577,9 +1577,9 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__)) then
>>
end match
%>

<%additionalIncludes%>

#ifdef USE_BOOST_THREAD
#include <boost/thread.hpp>
static long unsigned int getThreadNumber()
Expand Down Expand Up @@ -1628,23 +1628,23 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__)) then
<<
std::vector<MeasureTimeData> measureTimeArraySimulation = std::vector<MeasureTimeData>(2); //0 all, 1 setup
MeasureTimeValues *measuredSimStartValues, *measuredSimEndValues, *measuredSetupStartValues, *measuredSetupEndValues;

MeasureTime::addResultContentBlock("<%dotPath(modelInfo.name)%>","main",&measureTimeArraySimulation);

measuredSimStartValues = MeasureTime::getZeroValues();
measuredSimEndValues = MeasureTime::getZeroValues();
measuredSetupStartValues = MeasureTime::getZeroValues();
measuredSetupEndValues = MeasureTime::getZeroValues();

measureTimeArraySimulation[0] = MeasureTimeData("all");
measureTimeArraySimulation[1] = MeasureTimeData("setup");

<%generateMeasureTimeStartCode('measuredSimStartValues', "all", "")%>
<%generateMeasureTimeStartCode('measuredSetupStartValues', "setup", "")%>
>>
%>
<%additionalPreRunCommands%>

boost::shared_ptr<OMCFactory> _factory = boost::shared_ptr<OMCFactory>(new OMCFactory());
//SimController to start simulation

Expand All @@ -1660,7 +1660,7 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__)) then
%>

simulation.first->Start(system.first,simulation.second,"<%lastIdentOfPath(modelInfo.name)%>");

<%additionalPostRunCommands%>
<%if boolNot(stringEq(getConfigString(PROFILING_LEVEL),"none")) then
<<
Expand Down Expand Up @@ -5166,14 +5166,14 @@ match modelInfo
void deleteAlgloopSolverVariables_<%idx%>();
>>
;separator="\n")

<<
<%if boolNot(stringEq(getConfigString(PROFILING_LEVEL),"none")) then
<<
#define MEASURETIME_PROFILEBLOCKS
#define MEASURETIME_MODELFUNCTIONS
>>%>

class <%lastIdentOfPath(modelInfo.name)%>: public IContinuous, public IEvent, public IStepEvent, public ITime, public ISystemProperties <%if Flags.isSet(Flags.WRITE_TO_BUFFER) then ', public IReduceDAE'%>, public SystemDefaultImplementation
{
<%friendclasses%>
Expand Down
16 changes: 8 additions & 8 deletions Compiler/Template/CodegenCppHpcom.tpl
Expand Up @@ -17,14 +17,14 @@ template translateModel(SimCode simCode, Boolean useFlatArrayNotation) ::=
match simCode
case SIMCODE(modelInfo = MODELINFO(__), makefileParams= MAKEFILE_PARAMS(__)) then
let target = simulationCodeTarget()

let()= textFile(
(if Flags.isSet(Flags.HPCOM_ANALYZATION_MODE) then
simulationMainFileAnalyzation(simCode)
else
(if Flags.isSet(Flags.HPCOM_ANALYZATION_MODE) then
simulationMainFileAnalyzation(simCode)
else
simulationMainFile(simCode, (if Flags.isSet(USEMPI) then "#include <mpi.h>" else ""), (if Flags.isSet(USEMPI) then MPIInit() else ""), (if Flags.isSet(USEMPI) then MPIFinalize() else ""))
), 'OMCpp<%fileNamePrefix%>Main.cpp')

let()= textFile(simulationHeaderFile(simCode, generateAdditionalIncludes(simCode, Util.isSome(hpcOmMemory)), generateAdditionalProtectedMemberDeclaration(simCode, Util.isSome(hpcOmMemory)), false, Util.isSome(hpcOmMemory)), 'OMCpp<%fileNamePrefix%>.h')
let()= textFile(simulationCppFile(simCode,Util.isSome(hpcOmMemory)), 'OMCpp<%fileNamePrefix%>.cpp')
let()= textFile(simulationFunctionsHeaderFile(simCode,modelInfo.functions,literals,false), 'OMCpp<%fileNamePrefix%>Functions.h')
Expand Down Expand Up @@ -535,7 +535,7 @@ template getHpcomConstructorExtension(Option<Schedule> hpcOmScheduleOpt, String
let threadFuncs = List.intRange(intSub(getConfigInt(NUM_PROC),1)) |> tt hasindex i0 fromindex 1 => generateThread(i0, type, modelNamePrefixStr,"evaluateThreadFunc"); separator="\n"
<<
<%threadFuncs%>

<%if boolNot(stringEq(getConfigString(PROFILING_LEVEL),"none")) then
<<
#ifdef MEASURETIME_MODELFUNCTIONS
Expand Down Expand Up @@ -959,11 +959,11 @@ template generateLevelFixedCodeForThreadLevel(list<SimEqSystem> allEquationsPlus
<%generateMeasureTimeStartCode("measuredSchedulerStartValues", 'evaluateODE_level_<%intAdd(iLevelIdx,1)%>', "MEASURETIME_MODELFUNCTIONS")%>
>>
%>

<%if(stringEq(tasks,"")) then '' else ''%>
<%tasks%>
_levelBarrier.wait();

<%if intEq(iThreadIdx, 0) then
<<
<%generateMeasureTimeEndCode("measuredSchedulerStartValues", "measuredSchedulerEndValues", 'measureTimeSchedulerArrayHpcom[<%iLevelIdx%>]', 'evaluateODE_level_<%intAdd(iLevelIdx,1)%>', "MEASURETIME_MODELFUNCTIONS")%>
Expand Down

0 comments on commit 0615864

Please sign in to comment.