Regression
simulation_libraries_msl32.Modelica.Fluid.Examples.IncompressibleFluidNetwork.mos (from (result.xml))
Stacktrace
Output mismatch (see stdout for details)
Standard Output
+ Modelica.Fluid.Examples.IncompressibleFluidNetwork ... equation mismatch [time: 5] ==== Log C:\Windows\TEMP/omc-rtest-OpenModelica/simulation/libraries/msl32/Modelica.Fluid.Examples.IncompressibleFluidNetwork.mos_temp7382/log-Modelica.Fluid.Examples.IncompressibleFluidNetwork.mos "true " "" OpenModelicaModelTesting.Kind.VerifiedSimulation Modelica.Fluid.Examples.IncompressibleFluidNetwork {"pipe1.mediums[1].T","pipe1.mediums[2].T","pipe2.mediums[1].T","pipe2.mediums[2].T","pipe3.mediums[1].T","pipe3.mediums[2].T","pipe4.mediums[1].T","pipe4.mediums[2].T","pipe6.mediums[1].T","pipe6.mediums[2].T","pipe7.mediums[1].T","pipe7.mediums[2].T","pipe8.mediums[1].T","pipe8.mediums[2].T","pipe9.mediums[1].T","pipe9.mediums[2].T","pipe10.mediums[1].T","pipe10.mediums[2].T","pipe5.mediums[1].T","pipe5.mediums[2].T"} Warning: Out of memory! Faking a stack overflow. Error: Stack overflow occurred while evaluating if modelTestingType == OpenModelicaModelTesting.Kind.Instantiation then print(if debug then "Start instantiateModel\n" else ""); str := instantiateModel(modelName); res := str <> ""; error := getErrorString(); print(if res then "Frontend succeeded\n" else "Frontend failed\n"); print(error); if res then res := translateModel(modelName); if res then print("The model now translates (generates code). Please update the test.\n"); exit(1); end if; getErrorString(); end if; startRun := false; elseif modelTestingType == OpenModelicaModelTesting.Kind.Translation then print(if debug then "Start translateModel\n" else ""); res := translateModel(modelName); error := getErrorString(); print(if res then "Translation succeeded\n" else "Translation failed\n"); print(error); if res then res := buildModel(modelName); if res[1] <> "" then print("The model now compiles. Please update the test.\n"); exit(1); end if; getErrorString(); end if; startRun := false; elseif modelTestingType == OpenModelicaModelTesting.Kind.Compilation then print(if debug then "Start buildModel\n" else ""); res := buildModel(modelName); error := getErrorString(); print(if res[1] <> "" then "Compilation succeeded\n" else "Compilation failed\n"); print(error); if res[1] <> "" then base := basename(res[1]); info := checkSettings(); os := info.OS; if os == "Windows_NT" then prefix := ""; suffix := ".exe"; else prefix := "./"; suffix := ""; end if; res := system(prefix + base + suffix + " -noemit " + simflags, outputFile = base + ".out"); system("rm -f " + base + ".out"); if res == 0 then print("The model now simulates. Please update the test.\n"); exit(1); end if; print(if debug and res <> 0 then "The model still does not simulate (exit " + String(res) + "). Please update the test.\n" else ""); getErrorString(); end if; startRun := false; elseif (modelTestingType == OpenModelicaModelTesting.Kind.VerifiedSimulation) or (modelTestingType == OpenModelicaModelTesting.Kind.SimpleSimulation) or (modelTestingType == OpenModelicaModelTesting.Kind.SuppressedSimulation) or (modelTestingType == OpenModelicaModelTesting.Kind.SuppressedVerifiedSimulation) then print(if debug then "got simulation test\n" else ""); if size(compareVars, 1) > 0 then loadString(" function toRegex input String str; output String re; algorithm re := str; re := OpenModelica.Scripting.stringReplace(re,\"[\",\".\"); re := OpenModelica.Scripting.stringReplace(re,\"]\",\".\"); re := OpenModelica.Scripting.stringReplace(re,\"(\",\"[(]\"); re := OpenModelica.Scripting.stringReplace(re,\")\",\"[)]\"); end toRegex; "); variableFilter := "time" + sum("|" + toRegex(var) for var in compareVars); getErrorString(); simflags := simflags + " -emit_protected"; else variableFilter := ".*"; end if; if stopTime > 0.0 then res := simulate(modelName, stopTime = stopTime, outputFormat = outputFormat, simflags = simflags, variableFilter = variableFilter); else res := simulate(modelName, outputFormat = outputFormat, simflags = simflags, variableFilter = variableFilter); end if; print(if debug then "simulated\n" else ""); error := getErrorString(); resultFile := res.resultFile; options := res.simulationOptions; messages := res.messages; print(if debug then "got messages\n" else ""); print("Simulation options: " + options + "\n"); if resultFile == "" then print("Error: Simulation did not produce a result-file\n"); print("Errors: " + messages + error + "\n"); exit(1); /* We got a result file. This means the simulation succeeded */ else print("Result file: " + resultFile + "\n"); /* Print messages if we got them and did not suppress them */ if messages <> "" and modelTestingType <> OpenModelicaModelTesting.Kind.SuppressedSimulation and modelTestingType <> OpenModelicaModelTesting.Kind.SuppressedVerifiedSimulation then print(if messages <> "" then "Messages: " + messages + "\n" else ""); elseif messages == "" and (modelTestingType == OpenModelicaModelTesting.Kind.SuppressedSimulation or modelTestingType == OpenModelicaModelTesting.Kind.SuppressedVerifiedSimulation) then print("Note: There were no messages so you do not need to suppress them any longer, Please update the test.\n"); exit(1); end if; end if; /* We can only compare to a reference file if we have one */ modelNameStr := typeNameString(modelName); referenceFile := if referenceFile == "" then getEnvironmentVar("REFERENCEFILES") + "/" + referenceFileDir + "/" + modelNameStr + ".mat" else referenceFile; if regularFileExists(referenceFile + ".xz") then system("if test ! -f " + referenceFile + " || test " + referenceFile + ".xz -nt " + referenceFile + "; then xz --keep --decompress --force " + referenceFile + ".xz ; fi"); referenceExists := true; elseif regularFileExists(referenceFile) then referenceExists := true; else referenceExists := false; end if; /* adrpo: we might run into sandbox and here we get a relative file, try to add ../ */ if not referenceExists then if regularFileExists("../" + referenceFile + ".xz") then system("if test ! -f ../" + referenceFile + " || test ../" + referenceFile + ".xz -nt ../" + referenceFile + "; then xz --keep --decompress --force ../" + referenceFile + ".xz ; fi"); referenceExists := true; elseif regularFileExists("../" + referenceFile) then referenceExists := true; else referenceExists := false; end if; end if; if referenceExists then //in windows resultFile contains absolute path while compareResuslts accepts relative path resultFile := modelNameStr + "_res.mat"; // support for csv result files resultFile := if regularFileExists(resultFile) then resultFile else modelNameStr + "_res.csv"; csvFile := modelNameStr + ".csv"; if diffAlgorithm == OpenModelicaModelTesting.DiffAlgorithm.compareSimulationResults then print(if debug then "try to compare results " + resultFile + " " + referenceFile + " " + csvFile + " " + String(relTol) + " " + String(absTol) + sum(" " + v + "," for v in compareVars) + "\n" else ""); res := OpenModelica.Scripting.compareSimulationResults(resultFile, referenceFile, csvFile, relTol, absTol, compareVars); print(if debug then "compareSimulationResults finished: " + sum(r for r in res) + "\n" else ""); if size(res, 1) == 1 and res[1] == "Files Equal!" then res := true; else failVars := res[2:size(res, 1)]; res := false; end if; elseif diffAlgorithm == OpenModelicaModelTesting.DiffAlgorithm.diffSimulationResults then print(if debug then "Trying diffSimulationResults(" + resultFile + ", " + referenceFile + ").\n" else ""); (res, failVars) := OpenModelica.Scripting.diffSimulationResults(resultFile, referenceFile, csvFile + "diff.", relTol, vars = compareVars); print(if debug then "diffSimulationResults returns " + String(res) + ".\n" else ""); else print("Unknown diff algorithm!\n"); exit(1); end if; if res and modelTestingType <> OpenModelicaModelTesting.Kind.VerifiedSimulation and modelTestingType <> OpenModelicaModelTesting.Kind.SuppressedVerifiedSimulation then print("Note: Result files are now equal. Please update the test to do verified simulation!\n"); exit(1); elseif modelTestingType == OpenModelicaModelTesting.Kind.VerifiedSimulation or modelTestingType == OpenModelicaModelTesting.Kind.SuppressedVerifiedSimulation then if res then print("Files Equal!\n"); end if; if not res then print("Failed variables: " + sum(var for var in failVars) + "\n"); print(error); print(getErrorString()); minimalResult := OpenModelica.Scripting.stringReplace(resultFile, "_res.mat", ".minimal.mat"); OpenModelica.Scripting.filterSimulationResults(resultFile, minimalResult, vars = compareVars); system("xz --best --keep --force '" + minimalResult + "'"); system("ls -lh '" + resultFile + "' '" + minimalResult + "'* '" + referenceFile + "'*"); print("Failed variables: " + sum(var for var in failVars) + "\n"); print(error); print(getErrorString()); info := checkSettings(); os := info.OS; dateCmd := if os == "Windows_NT" then "date /T" else "date"; system(dateCmd); // In case people somehow try to fool their tests, add some non-determinism system("cp \"" + getInstallationDirectoryPath() + "/share/doc/omc/testmodels/dygraph-combined.js\" ."); for v in failVars[2:size(failVars, 1)] loop // Write some html files with the diffs curFile := modelNameStr + "." + v + ".html"; writeFile(curFile, diffSimulationResultsHtml(v, resultFile, referenceFile)); print("Created diff file " + curFile + "\n"); end for; print("This test cannot succeed automated testing because the test kind is wrong\n"); exit(1); end if; elseif modelTestingType <> OpenModelicaModelTesting.Kind.VerifiedSimulation and modelTestingType <> OpenModelicaModelTesting.Kind.SuppressedVerifiedSimulation then getErrorString(); end if; print(if error <> "" then error + "\n" else ""); error := getErrorString(); print(if error <> "" then error + "\n" else ""); elseif modelTestingType == OpenModelicaModelTesting.Kind.VerifiedSimulation or modelTestingType == OpenModelicaModelTesting.Kind.SuppressedVerifiedSimulation then print("Error: Reference file " + referenceFile + " does not exist and we are doing verified simulation. Something does not add up!\n"); print(if error <> "" then error + "\n" else ""); exit(1); else print("Note: Reference file " + referenceFile + " does not exist. Cannot determine if the result improved!\n"); print(if error <> "" then error + "\n" else ""); end if; error := getErrorString(); print(if error <> "" then error + "\n" else ""); startRun := false; else print("Unknown model testing type\n"); startRun := false; end if;: [bt] [Symbols are not generated when running the test suite] Unknown failure (script did not finish) "true " "" '' Equation mismatch: diff says: --- "C:\\Windows\\TEMP/omc-rtest-OpenModelica/simulation/libraries/msl32/Modelica.Fluid.Examples.IncompressibleFluidNetwork.mos_temp7382/equations-expected"2024-05-08 14:56:54.686105900 +0200 +++ "C:\\Windows\\TEMP/omc-rtest-OpenModelica/simulation/libraries/msl32/Modelica.Fluid.Examples.IncompressibleFluidNetwork.mos_temp7382/equations-got"2024-05-08 14:56:59.045105100 +0200 @@ -2,16 +2,218 @@ " "" OpenModelicaModelTesting.Kind.VerifiedSimulation Modelica.Fluid.Examples.IncompressibleFluidNetwork {"pipe1.mediums[1].T","pipe1.mediums[2].T","pipe2.mediums[1].T","pipe2.mediums[2].T","pipe3.mediums[1].T","pipe3.mediums[2].T","pipe4.mediums[1].T","pipe4.mediums[2].T","pipe6.mediums[1].T","pipe6.mediums[2].T","pipe7.mediums[1].T","pipe7.mediums[2].T","pipe8.mediums[1].T","pipe8.mediums[2].T","pipe9.mediums[1].T","pipe9.mediums[2].T","pipe10.mediums[1].T","pipe10.mediums[2].T","pipe5.mediums[1].T","pipe5.mediums[2].T"} -Simulation options: startTime = 0.0, stopTime = 200.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'Modelica.Fluid.Examples.IncompressibleFluidNetwork', options = '', outputFormat = 'mat', variableFilter = 'time|pipe1.mediums.1..T|pipe1.mediums.2..T|pipe2.mediums.1..T|pipe2.mediums.2..T|pipe3.mediums.1..T|pipe3.mediums.2..T|pipe4.mediums.1..T|pipe4.mediums.2..T|pipe6.mediums.1..T|pipe6.mediums.2..T|pipe7.mediums.1..T|pipe7.mediums.2..T|pipe8.mediums.1..T|pipe8.mediums.2..T|pipe9.mediums.1..T|pipe9.mediums.2..T|pipe10.mediums.1..T|pipe10.mediums.2..T|pipe5.mediums.1..T|pipe5.mediums.2..T', cflags = '', simflags = ' -abortSlowSimulation -alarm=360 -emit_protected' -Result file: Modelica.Fluid.Examples.IncompressibleFluidNetwork_res.mat -Messages: LOG_SUCCESS | info | The initialization finished successfully with 3 homotopy steps. -LOG_SUCCESS | info | The simulation finished successfully. - -Files Equal! -Warning: The model contains alias variables with redundant start and/or conflicting nominal values. It is recommended to resolve the conflicts, because otherwise the system could be hard to solve. To print the conflicting alias sets and the chosen candidates please use -d=aliasConflicts. +Warning: Out of memory! Faking a stack overflow. +Error: Stack overflow occurred while evaluating if modelTestingType == OpenModelicaModelTesting.Kind.Instantiation then +print(if debug then "Start instantiateModel\n" else ""); +str := instantiateModel(modelName); +res := str <> ""; +error := getErrorString(); +print(if res then "Frontend succeeded\n" else "Frontend failed\n"); +print(error); +if res then +res := translateModel(modelName); +if res then +print("The model now translates (generates code). Please update the test.\n"); +exit(1); +end if; +getErrorString(); +end if; +startRun := false; +elseif modelTestingType == OpenModelicaModelTesting.Kind.Translation then +print(if debug then "Start translateModel\n" else ""); +res := translateModel(modelName); +error := getErrorString(); +print(if res then "Translation succeeded\n" else "Translation failed\n"); +print(error); +if res then +res := buildModel(modelName); +if res[1] <> "" then +print("The model now compiles. Please update the test.\n"); +exit(1); +end if; +getErrorString(); +end if; +startRun := false; +elseif modelTestingType == OpenModelicaModelTesting.Kind.Compilation then +print(if debug then "Start buildModel\n" else ""); +res := buildModel(modelName); +error := getErrorString(); +print(if res[1] <> "" then "Compilation succeeded\n" else "Compilation failed\n"); +print(error); +if res[1] <> "" then +base := basename(res[1]); +info := checkSettings(); +os := info.OS; +if os == "Windows_NT" then +prefix := ""; +suffix := ".exe"; +else +prefix := "./"; +suffix := ""; +end if; +res := system(prefix + base + suffix + " -noemit " + simflags, outputFile = base + ".out"); +system("rm -f " + base + ".out"); +if res == 0 then +print("The model now simulates. Please update the test.\n"); +exit(1); +end if; +print(if debug and res <> 0 then "The model still does not simulate (exit " + String(res) + "). Please update the test.\n" else ""); +getErrorString(); +end if; +startRun := false; +elseif (modelTestingType == OpenModelicaModelTesting.Kind.VerifiedSimulation) or (modelTestingType == OpenModelicaModelTesting.Kind.SimpleSimulation) or (modelTestingType == OpenModelicaModelTesting.Kind.SuppressedSimulation) or (modelTestingType == OpenModelicaModelTesting.Kind.SuppressedVerifiedSimulation) then +print(if debug then "got simulation test\n" else ""); +if size(compareVars, 1) > 0 then +loadString(" +function toRegex +input String str; +output String re; +algorithm +re := str; +re := OpenModelica.Scripting.stringReplace(re,\"[\",\".\"); +re := OpenModelica.Scripting.stringReplace(re,\"]\",\".\"); +re := OpenModelica.Scripting.stringReplace(re,\"(\",\"[(]\"); +re := OpenModelica.Scripting.stringReplace(re,\")\",\"[)]\"); +end toRegex; +"); +variableFilter := "time" + sum("|" + toRegex(var) for var in compareVars); +getErrorString(); +simflags := simflags + " -emit_protected"; +else +variableFilter := ".*"; +end if; +if stopTime > 0.0 then +res := simulate(modelName, stopTime = stopTime, outputFormat = outputFormat, simflags = simflags, variableFilter = variableFilter); +else +res := simulate(modelName, outputFormat = outputFormat, simflags = simflags, variableFilter = variableFilter); +end if; +print(if debug then "simulated\n" else ""); +error := getErrorString(); +resultFile := res.resultFile; +options := res.simulationOptions; +messages := res.messages; +print(if debug then "got messages\n" else ""); +print("Simulation options: " + options + "\n"); +if resultFile == "" then +print("Error: Simulation did not produce a result-file\n"); +print("Errors: " + messages + error + "\n"); +exit(1); +/* We got a result file. This means the simulation succeeded */ +else +print("Result file: " + resultFile + "\n"); +/* Print messages if we got them and did not suppress them */ +if messages <> "" and modelTestingType <> OpenModelicaModelTesting.Kind.SuppressedSimulation and modelTestingType <> OpenModelicaModelTesting.Kind.SuppressedVerifiedSimulation then +print(if messages <> "" then "Messages: " + messages + "\n" else ""); +elseif messages == "" and (modelTestingType == OpenModelicaModelTesting.Kind.SuppressedSimulation or modelTestingType == OpenModelicaModelTesting.Kind.SuppressedVerifiedSimulation) then +print("Note: There were no messages so you do not need to suppress them any longer, Please update the test.\n"); +exit(1); +end if; +end if; +/* We can only compare to a reference file if we have one */ +modelNameStr := typeNameString(modelName); +referenceFile := if referenceFile == "" then getEnvironmentVar("REFERENCEFILES") + "/" + referenceFileDir + "/" + modelNameStr + ".mat" else referenceFile; +if regularFileExists(referenceFile + ".xz") then +system("if test ! -f " + referenceFile + " || test " + referenceFile + ".xz -nt " + referenceFile + "; then xz --keep --decompress --force " + referenceFile + ".xz ; fi"); +referenceExists := true; +elseif regularFileExists(referenceFile) then +referenceExists := true; +else +referenceExists := false; +end if; +/* adrpo: we might run into sandbox and here we get a relative file, try to add ../ */ +if not referenceExists then +if regularFileExists("../" + referenceFile + ".xz") then +system("if test ! -f ../" + referenceFile + " || test ../" + referenceFile + ".xz -nt ../" + referenceFile + "; then xz --keep --decompress --force ../" + referenceFile + ".xz ; fi"); +referenceExists := true; +elseif regularFileExists("../" + referenceFile) then +referenceExists := true; +else +referenceExists := false; +end if; +end if; +if referenceExists then +//in windows resultFile contains absolute path while compareResuslts accepts relative path +resultFile := modelNameStr + "_res.mat"; +// support for csv result files +resultFile := if regularFileExists(resultFile) then resultFile else modelNameStr + "_res.csv"; +csvFile := modelNameStr + ".csv"; +if diffAlgorithm == OpenModelicaModelTesting.DiffAlgorithm.compareSimulationResults then +print(if debug then "try to compare results " + resultFile + " " + referenceFile + " " + csvFile + " " + String(relTol) + " " + String(absTol) + sum(" " + v + "," for v in compareVars) + "\n" else ""); +res := OpenModelica.Scripting.compareSimulationResults(resultFile, referenceFile, csvFile, relTol, absTol, compareVars); +print(if debug then "compareSimulationResults finished: " + sum(r for r in res) + "\n" else ""); +if size(res, 1) == 1 and res[1] == "Files Equal!" then +res := true; +else +failVars := res[2:size(res, 1)]; +res := false; +end if; +elseif diffAlgorithm == OpenModelicaModelTesting.DiffAlgorithm.diffSimulationResults then +print(if debug then "Trying diffSimulationResults(" + resultFile + ", " + referenceFile + ").\n" else ""); +(res, failVars) := OpenModelica.Scripting.diffSimulationResults(resultFile, referenceFile, csvFile + "diff.", relTol, vars = compareVars); +print(if debug then "diffSimulationResults returns " + String(res) + ".\n" else ""); +else +print("Unknown diff algorithm!\n"); +exit(1); +end if; +if res and modelTestingType <> OpenModelicaModelTesting.Kind.VerifiedSimulation and modelTestingType <> OpenModelicaModelTesting.Kind.SuppressedVerifiedSimulation then +print("Note: Result files are now equal. Please update the test to do verified simulation!\n"); +exit(1); +elseif modelTestingType == OpenModelicaModelTesting.Kind.VerifiedSimulation or modelTestingType == OpenModelicaModelTesting.Kind.SuppressedVerifiedSimulation then +if res then +print("Files Equal!\n"); +end if; +if not res then +print("Failed variables: " + sum(var for var in failVars) + "\n"); +print(error); +print(getErrorString()); +minimalResult := OpenModelica.Scripting.stringReplace(resultFile, "_res.mat", ".minimal.mat"); +OpenModelica.Scripting.filterSimulationResults(resultFile, minimalResult, vars = compareVars); +system("xz --best --keep --force '" + minimalResult + "'"); +system("ls -lh '" + resultFile + "' '" + minimalResult + "'* '" + referenceFile + "'*"); +print("Failed variables: " + sum(var for var in failVars) + "\n"); +print(error); +print(getErrorString()); +info := checkSettings(); +os := info.OS; +dateCmd := if os == "Windows_NT" then "date /T" else "date"; +system(dateCmd); +// In case people somehow try to fool their tests, add some non-determinism +system("cp \"" + getInstallationDirectoryPath() + "/share/doc/omc/testmodels/dygraph-combined.js\" ."); +for v in failVars[2:size(failVars, 1)] loop +// Write some html files with the diffs +curFile := modelNameStr + "." + v + ".html"; +writeFile(curFile, diffSimulationResultsHtml(v, resultFile, referenceFile)); +print("Created diff file " + curFile + "\n"); +end for; +print("This test cannot succeed automated testing because the test kind is wrong\n"); +exit(1); +end if; +elseif modelTestingType <> OpenModelicaModelTesting.Kind.VerifiedSimulation and modelTestingType <> OpenModelicaModelTesting.Kind.SuppressedVerifiedSimulation then +getErrorString(); +end if; +print(if error <> "" then error + "\n" else ""); +error := getErrorString(); +print(if error <> "" then error + "\n" else ""); +elseif modelTestingType == OpenModelicaModelTesting.Kind.VerifiedSimulation or modelTestingType == OpenModelicaModelTesting.Kind.SuppressedVerifiedSimulation then +print("Error: Reference file " + referenceFile + " does not exist and we are doing verified simulation. Something does not add up!\n"); +print(if error <> "" then error + "\n" else ""); +exit(1); +else +print("Note: Reference file " + referenceFile + " does not exist. Cannot determine if the result improved!\n"); +print(if error <> "" then error + "\n" else ""); +end if; +error := getErrorString(); +print(if error <> "" then error + "\n" else ""); +startRun := false; +else +print("Unknown model testing type\n"); +startRun := false; +end if;: +[bt] [Symbols are not generated when running the test suite] +Unknown failure (script did not finish) "true " "" '' Equation mismatch: omc-diff says: Failed 'S' 'W' Line 7: Text differs: expected: Simulation options: startTime = got: Warning: Out of memory! Faking a stack overflow. == 1 out of 1 tests failed [simulation/libraries/msl32/Modelica.Fluid.Examples.IncompressibleFluidNetwork.mos_temp7382, time: 9]