Skip to content

Commit

Permalink
Removed unused inputs to get cleaner interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
lochel committed Aug 5, 2015
1 parent e05e21a commit 6b6457c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 21 deletions.
6 changes: 1 addition & 5 deletions Compiler/BackEnd/OpenTURNS.mo
Expand Up @@ -77,13 +77,9 @@ constant String cStrWrapperCompileCmd = "wrapper_template.compile.cmd";
constant String cStrInvokeOpenTurnsCmd = "invoke.cmd";

public function generateOpenTURNSInterface "generates the dll and the python script for connections with OpenTURNS"
input FCore.Cache cache;
input FCore.Graph graph;
input BackendDAE.BackendDAE inDaelow;
input DAE.FunctionTree inFunctionTree;
input Absyn.Path inPath;
input Absyn.Program inProgram;
input DAE.DAElist inDAElist;
input String templateFile "the filename to the template file (python script)";
output String scriptFile "the name of the generated file";

Expand Down Expand Up @@ -117,7 +113,7 @@ algorithm
//print("strippedDae :");
//BackendDump.dump(strippedDae);
_ := System.realtimeTock(ClockIndexes.RT_CLOCK_BACKEND); // Is this necessary?
(libs,fileDir,_,_) := SimCodeMain.generateModelCode(strippedDae,inProgram,inDAElist,inPath,cname_str,SOME(simSettings),Absyn.FUNCTIONARGS({},{}));
(libs, fileDir, _, _) := SimCodeMain.generateModelCode(strippedDae, inProgram, inPath, cname_str, SOME(simSettings), Absyn.FUNCTIONARGS({}, {}));

//print("..compiling, fileNamePrefix = "+fileNamePrefix+"\n");
CevalScript.compileModel(fileNamePrefix , libs);
Expand Down
8 changes: 3 additions & 5 deletions Compiler/Main/Main.mo
Expand Up @@ -596,8 +596,8 @@ algorithm
if Config.simulationCg() then
info := BackendDAE.EXTRA_INFO(DAEUtil.daeDescription(dae), Absyn.pathString(inClassName));
dlow := BackendDAECreate.lower(dae, inCache, inEnv, info);
dlow := BackendDAEUtil.getSolvedSystem(dlow,"");
simcodegen(dlow, inClassName, ap, dae);
dlow := BackendDAEUtil.getSolvedSystem(dlow, "");
simcodegen(dlow, inClassName, ap);
end if;
end optimizeDae;

Expand All @@ -606,7 +606,6 @@ protected function simcodegen "
input BackendDAE.BackendDAE inBackendDAE;
input Absyn.Path inClassName;
input Absyn.Program inProgram;
input DAE.DAElist inDAE;
protected
String cname;
SimCode.SimulationSettings sim_settings;
Expand All @@ -624,8 +623,7 @@ algorithm
SimCodeMain.createSimulationSettings(0.0, 1.0, 500, 1e-6, "dassl", "", "mat", ".*", "");

System.realtimeTock(ClockIndexes.RT_CLOCK_BACKEND); // Is this necessary?
SimCodeMain.generateModelCode(inBackendDAE, inProgram, inDAE, inClassName,
cname, SOME(sim_settings), Absyn.FUNCTIONARGS({}, {}));
SimCodeMain.generateModelCode(inBackendDAE, inProgram, inClassName, cname, SOME(sim_settings), Absyn.FUNCTIONARGS({}, {}));
SimCodeFunctionUtil.execStat("Codegen Done");
end if;
end simcodegen;
Expand Down
2 changes: 1 addition & 1 deletion Compiler/Script/CevalScriptBackend.mo
Expand Up @@ -3065,7 +3065,7 @@ algorithm
dlow = BackendDAECreate.lower(dae,cache,env,BackendDAE.EXTRA_INFO(description,filenameprefix));
//print("lowered class\n");
//print("calling generateOpenTurnsInterface\n");
scriptFile = OpenTURNS.generateOpenTURNSInterface(cache,inEnv,dlow,funcs,className,p,dae,templateFile);
scriptFile = OpenTURNS.generateOpenTURNSInterface(dlow, className, p, templateFile);
then
(cache,scriptFile,inSt);

Expand Down
11 changes: 4 additions & 7 deletions Compiler/SimCode/SimCodeMain.mo
Expand Up @@ -116,7 +116,6 @@ protected function generateModelCodeFMU "
template-based code generator on it."
input BackendDAE.BackendDAE inBackendDAE;
input Absyn.Program p;
input DAE.DAElist dae;
input Absyn.Path className;
input String FMUVersion;
input String FMUType;
Expand All @@ -143,7 +142,7 @@ algorithm
(libs,libPaths,includes, includeDirs, recordDecls, functions, literals) :=
SimCodeUtil.createFunctions(p, inBackendDAE);
simCode := createSimCode(inBackendDAE,
className, filenamePrefix, fileDir, functions, includes, includeDirs, libs, libPaths,simSettingsOpt, recordDecls, literals,Absyn.FUNCTIONARGS({},{}));
className, filenamePrefix, fileDir, functions, includes, includeDirs, libs, libPaths, simSettingsOpt, recordDecls, literals,Absyn.FUNCTIONARGS({},{}));
timeSimCode := System.realtimeTock(ClockIndexes.RT_CLOCK_SIMCODE);
SimCodeFunctionUtil.execStat("SimCode");

Expand All @@ -158,7 +157,6 @@ protected function generateModelCodeXML "
template-based code generator on it."
input BackendDAE.BackendDAE inBackendDAE;
input Absyn.Program p;
input DAE.DAElist dae;
input Absyn.Path className;
input String filenamePrefix;
input Option<SimCode.SimulationSettings> simSettingsOpt;
Expand Down Expand Up @@ -257,7 +255,7 @@ algorithm
timeBackend = System.realtimeTock(ClockIndexes.RT_CLOCK_BACKEND);

(libs,file_dir,timeSimCode,timeTemplates) =
generateModelCodeFMU(dlow_1, p, dae, className, FMUVersion, FMUType, filenameprefix, inSimSettingsOpt);
generateModelCodeFMU(dlow_1, p, className, FMUVersion, FMUType, filenameprefix, inSimSettingsOpt);

//reset config flag
Flags.setConfigBool(Flags.GENERATE_SYMBOLIC_LINEARIZATION, symbolicJacActivated);
Expand Down Expand Up @@ -333,7 +331,7 @@ algorithm
timeBackend = System.realtimeTock(ClockIndexes.RT_CLOCK_BACKEND);

(libs,file_dir,timeSimCode,timeTemplates) =
generateModelCodeXML(dlow_1, p, dae, className, filenameprefix, inSimSettingsOpt);
generateModelCodeXML(dlow_1, p, className, filenameprefix, inSimSettingsOpt);
resultValues =
{("timeTemplates",Values.REAL(timeTemplates)),
("timeSimCode", Values.REAL(timeSimCode)),
Expand Down Expand Up @@ -361,7 +359,6 @@ public function generateModelCode "
template-based code generator on it."
input BackendDAE.BackendDAE inBackendDAE;
input Absyn.Program p;
input DAE.DAElist dae;
input Absyn.Path className;
input String filenamePrefix;
input Option<SimCode.SimulationSettings> simSettingsOpt;
Expand Down Expand Up @@ -649,7 +646,7 @@ algorithm
timeBackend = System.realtimeTock(ClockIndexes.RT_CLOCK_BACKEND);

(libs, file_dir, timeSimCode, timeTemplates) =
generateModelCode(dlow_1, p, dae, className, filenameprefix, inSimSettingsOpt, args);
generateModelCode(dlow_1, p, className, filenameprefix, inSimSettingsOpt, args);

resultValues = {("timeTemplates", Values.REAL(timeTemplates)),
("timeSimCode", Values.REAL(timeSimCode)),
Expand Down
4 changes: 1 addition & 3 deletions Compiler/Stubs/SimCodeMain.mo
Expand Up @@ -19,15 +19,13 @@ algorithm
assert(false, getInstanceName());
end createSimulationSettings;

function generateModelCode<T,A,B,C,D,E>
function generateModelCode<T,A,C,D,E>
input T inBackendDAE;
input A p;
input B dae;
input C className;
input String filenamePrefix;
input D simSettingsOpt;
input E args;
output T outIndexedBackendDAE;
output list<String> libs;
output String fileDir;
output Real timeSimCode;
Expand Down

0 comments on commit 6b6457c

Please sign in to comment.