Main /
OpenModelicaFMIThis page has information about Functional Mock-up Units (FMI) and Open Modelica References
IssuesGenerating a fmu fails because share/omc/runtime/c is not present12/20/2015 Under both Mac OS X and RHEL 6.7, when building just bash-4.1$ mkdir /tmp/fmi bash-4.1$ cd /tmp/fmi bash-4.1$ cp /home/jenkins/src/OpenModelica/OMCompiler/Examples/VanDerPol.mo . bash-4.1$ cat VanDerPol.mos loadModel(Modelica, {"3.2.1"}); getErrorString(); loadFile("VanDerPol.mo"); getErrorString(); OpenModelica.Scripting.translateModelFMU( className=VanDerPol, version="2.0"); getErrorString(); bash-4.1$ /usr/local/openmodelica/bin/omc VanDerPol.mos true "" true "" "Warning: The initial conditions are not fully specified. Use +d=initialization for more information. Error: Error building simulator. Build log: rm -f VanDerPol.fmutmp/sources/VanDerPol_init.xml cp -a /usr/local/openmodelica/include/omc/c/* VanDerPol.fmutmp/sources/include/ cp -a /usr/local/openmodelica/share/omc/runtime/c/fmi/buildproject/* VanDerPol.fmutmp/sources cp: cannot stat `/usr/local/openmodelica/share/omc/runtime/c/fmi/buildproject/*': No such file or directory make: *** [fmu] Error 1 Warning: The initial conditions are not fully specified. Use +d=initialization for more information. Error: Error building simulator. Build log: rm -f VanDerPol.fmutmp/sources/VanDerPol_init.xml cp -a /usr/local/openmodelica/include/omc/c/* VanDerPol.fmutmp/sources/include/ cp -a /usr/local/openmodelica/share/omc/runtime/c/fmi/buildproject/* VanDerPol.fmutmp/sources cp: cannot stat `/usr/local/openmodelica/share/omc/runtime/c/fmi/buildproject/*': No such file or directory make: *** [fmu] Error 1 " bash-4.1$ Indeed, bash-4.1$ ls -l /usr/local/openmodelica/share/omc/ total 12 drwxrwxr-x. 2 jenkins jenkins 4096 May 11 2015 java -rw-rw-r-- 1 jenkins jenkins 189 Dec 20 09:19 omc_communication.idl drwxrwxr-x. 3 jenkins jenkins 4096 Dec 29 2014 scripts The solution is to copy the directory: bash-4.1$ cp -r ~/src/OpenModelica/build/share/omc/runtime /usr/local/openmodelica/share/omc bash-4.1$ /usr/local/openmodelica/bin/omc VanDerPol.mos true "" true "" "SimCode: The model VanDerPol has been translated to FMU" "Warning: The initial conditions are not fully specified. Use +d=initialization for more information. " bash-4.1$ ls -l *.fmu -rw-rw-r-- 1 jenkins jenkins 866471 Dec 22 08:15 VanDerPol.fmu bash-4.1$ 2/20/2015 OpenModelica FMI Issues
Running an OpenModelica FMU crashes Javacd $PTII/ptolemy/actor/lib/fmi/fmus/omc/HeatConductorComplex make $PTII/bin/vergil HeatConductorComplex.xml At run time, it fails with: FMUFile: Extracting to /tmp/FMUFile2238913665047057849.tmp # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f1883c3b794, pid=3585, tid=139741560760064 # # JRE version: Java(TM) SE Runtime Environment (8.0_31-b13) (build 1.8.0_31-b13) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.31-b07 mixed mode linux-amd64 compressed oops) # Problematic frame: # V [libjvm.so+0x9e6794] NMethodSweeper::sweep_code_cache()+0x474 # # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again # # An error report file with more information is saved as: # /home/cxh/src/ptII/ptolemy/actor/lib/fmi/fmus/omc/HeatConductorComplex/hs_err_pid3585.log # # If you would like to submit a bug report, please visit: # http://bugreport.java.com/bugreport/crash.jsp # Aborted (core dumped) However, running Running BouncingBall log messagescd $PTII/ptolemy/actor/lib/fmi/fmus/omc/BouncingBall make make test The error message below is unusual: [cxh@terra BouncingBallFMI20]$ make test /usr/java/jdk1.8.0_31/bin/java -classpath /home/cxh/src/ptII:/home/cxh/src/ptII/lib/jna-4.0.0-variadic.jar org.ptolemy.fmi.driver.FMUCoSimulation\ BouncingBallFMI20.fmu 1.0 0.1 true FMUFile: Extracting to /tmp/FMUFile4354210307734215046.tmp org/ptolemy/fmi/FMULog.java called Pointer.nativeCif(fmiCoomponent), but received a value of 0? This can happen if the the jna jar file has the \ Java side of the variadic extensions, but the C side of the variadic extensions have not been compiled for your platform. To compile them, see h\ ttp://chess.eecs.berkeley.edu/ptexternal/wiki/Main/JNA#PatchJNAToWorkWithVarargsCallBacks FMULogger: status: 0 message: fmi2Instantiate: GUID=%s instantiatedSlave about to initializeSlave FMUCoSimulation: about to write header FMUCoSimulation: about to call BouncingBallFMI20_fmiDoStep(Component, /* time */ 0.0, /* stepSize */0.1, 1) FMUCoSimulation: about to call BouncingBallFMI20_fmiDoStep(Component, /* time */ 0.1, /* stepSize */0.1, 1) FMUCoSimulation: about to call BouncingBallFMI20_fmiDoStep(Component, /* time */ 0.2, /* stepSize */0.1, 1) FMUCoSimulation: about to call BouncingBallFMI20_fmiDoStep(Component, /* time */ 0.30000000000000004, /* stepSize */0.1, 1) FMUCoSimulation: about to call BouncingBallFMI20_fmiDoStep(Component, /* time */ 0.4, /* stepSize */0.1, 1) FMUCoSimulation: about to call BouncingBallFMI20_fmiDoStep(Component, /* time */ 0.5, /* stepSize */0.1, 1) FMUCoSimulation: about to call BouncingBallFMI20_fmiDoStep(Component, /* time */ 0.6, /* stepSize */0.1, 1) FMUCoSimulation: about to call BouncingBallFMI20_fmiDoStep(Component, /* time */ 0.7, /* stepSize */0.1, 1) FMUCoSimulation: about to call BouncingBallFMI20_fmiDoStep(Component, /* time */ 0.7999999999999999, /* stepSize */0.1, 1) FMUCoSimulation: about to call BouncingBallFMI20_fmiDoStep(Component, /* time */ 0.8999999999999999, /* stepSize */0.1, 1) FMUCoSimulation: about to call BouncingBallFMI20_fmiDoStep(Component, /* time */ 0.9999999999999999, /* stepSize */0.1, 1) Results are in /home/cxh/src/ptII/ptolemy/actor/lib/fmi/fmus/omc/BouncingBallFMI20/results.csv This error message occurs if I run a bouncingBall FMU from FMUSDK-2.0: [cxh@terra BouncingBallFMI20]$ /usr/java/jdk1.8.0_31/bin/java -classpath /home/cxh/src/ptII:/home/cxh/src/ptII/lib/jna-4.0.0-variadic.jar org.pto\ lemy.fmi.driver.FMUCoSimulation /home/cxh/src/ptII/ptolemy/actor/lib/fmi/test/auto/bouncingBall20.fmu 1.0 0.1 true FMUFile: Extracting to /tmp/FMUFile5153054737620530695.tmp org/ptolemy/fmi/FMULog.java called Pointer.nativeCif(fmiCoomponent), but received a value of 0? This can happen if the the jna jar file has the \ Java side of the variadic extensions, but the C side of the variadic extensions have not been compiled for your platform. To compile them, see h\ ttp://chess.eecs.berkeley.edu/ptexternal/wiki/Main/JNA#PatchJNAToWorkWithVarargsCallBacks FMULogger: status: 0 message: fmi2Instantiate: GUID=%s instantiatedSlave about to initializeSlave FMUCoSimulation: about to write header FMUCoSimulation: about to call bouncingBall20_fmiDoStep(Component, /* time */ 0.0, /* stepSize */0.1, 1) FMUCoSimulation: about to call bouncingBall20_fmiDoStep(Component, /* time */ 0.1, /* stepSize */0.1, 1) FMUCoSimulation: about to call bouncingBall20_fmiDoStep(Component, /* time */ 0.2, /* stepSize */0.1, 1) FMUCoSimulation: about to call bouncingBall20_fmiDoStep(Component, /* time */ 0.30000000000000004, /* stepSize */0.1, 1) FMUCoSimulation: about to call bouncingBall20_fmiDoStep(Component, /* time */ 0.4, /* stepSize */0.1, 1) FMUCoSimulation: about to call bouncingBall20_fmiDoStep(Component, /* time */ 0.5, /* stepSize */0.1, 1) FMUCoSimulation: about to call bouncingBall20_fmiDoStep(Component, /* time */ 0.6, /* stepSize */0.1, 1) FMUCoSimulation: about to call bouncingBall20_fmiDoStep(Component, /* time */ 0.7, /* stepSize */0.1, 1) FMUCoSimulation: about to call bouncingBall20_fmiDoStep(Component, /* time */ 0.7999999999999999, /* stepSize */0.1, 1) FMUCoSimulation: about to call bouncingBall20_fmiDoStep(Component, /* time */ 0.8999999999999999, /* stepSize */0.1, 1) FMUCoSimulation: about to call bouncingBall20_fmiDoStep(Component, /* time */ 0.9999999999999999, /* stepSize */0.1, 1) Results are in /home/cxh/src/ptII/ptolemy/actor/lib/fmi/fmus/omc/BouncingBallFMI20/results.csv [cxh@terra BouncingBallFMI20]$ Editing FMULog.java and reverting to the old logger gets rid of the messages but does not fix the crash. Note that running with FMUs from FMUSDK also produces the same odd message: [cxh@terra jna]$ cd /home/cxh/src/ptII/ptolemy/actor/lib/fmi/test/auto [cxh@terra auto]$ /usr/java/jdk1.8.0_31/bin/java -classpath /home/cxh/src/ptII:/home/cxh/src/ptII/lib/jna-4.0.0-variadic.jar org.ptolemy.fmi.driv\ er.FMUCoSimulation bouncingBall20.fmu 1.0 0.1 true FMUFile: Extracting to /tmp/FMUFile1422086609466797604.tmp org/ptolemy/fmi/FMULog.java called Pointer.nativeCif(fmiCoomponent), but received a value of 0? This can happen if the the jna jar file has the \ Java side of the variadic extensions, but the C side of the variadic extensions have not been compiled for your platform. To compile them, see http://chess.eecs.berkeley.edu/ptexternal/wiki/Main/JNA#PatchJNAToWorkWithVarargsCallBacks FMULogger: status: 0 message: fmi2Instantiate: GUID=%s instantiatedSlave about to initializeSlave FMUCoSimulation: about to write header FMUCoSimulation: about to call bouncingBall20_fmiDoStep(Component, /* time */ 0.0, /* stepSize */0.1, 1) FMUCoSimulation: about to call bouncingBall20_fmiDoStep(Component, /* time */ 0.1, /* stepSize */0.1, 1) FMUCoSimulation: about to call bouncingBall20_fmiDoStep(Component, /* time */ 0.2, /* stepSize */0.1, 1) FMUCoSimulation: about to call bouncingBall20_fmiDoStep(Component, /* time */ 0.30000000000000004, /* stepSize */0.1, 1) Possible solution is to port the JNA variadic code. 2/20/2015 Adding printfsI added fprintf(stderr to the FMU. With vergil, it crashes after: HeatConductorComplex_FMU.c start setDefaultStartValues() HeatConductorComplex_FMU.c end setDefaultStartValues() When I run fmuChecker, which works, I get: [INFO][FMILIB] Loading 'linux64' binary with 'default' platform types [INFO][FMUCHK] Version returned from ME FMU: '2.0' HeatConductorComplex_FMU.c start setDefaultStartValues() HeatConductorComplex_FMU.c end setDefaultStartValues() HeatConductorComplex_FMU.c setReal(4, 270) HeatConductorComplex_FMU.c setStartValues() HeatConductorComplex_FMU.c getReal(0) HeatConductorComplex_FMU.c getReal(1) Adding printlns to OpenModelica generated FMUs.The fmi2* methods are defined in /usr/local/openmodelica/include/omc/c/fmi2/fmu2_model_interface.c To create a .c file that has the fmi2* methods: gcc -fPIC -O0 -falign-functions -march=native -I"/usr/local/openmodelica/include/omc/c" -I"/usr/local/openmodelica/include/omc/c/fmi2" -I. -E -o /tmp/H.c HeatConductorComplex_FMU.c Then: cp /tmp/H.c HeatConductorComplex_FMU.c To enable debugging, edit HeatConductorComplex_FMU.c and add a call to fmi2SetDebugLogging(): static fmi2String logCategoriesNamesAll[] = {"logEvents", "logSingularLinearSystems", "logNonlinearSystems", "logDynamicStateSelection", "logStatusWarning", "logStatusDiscard", "logStatusError", "logStatusFatal", "logStatusPending", "logAll", "logFmi2Call"}; // Set values for all variables that define a start value void setDefaultStartValues(ModelInstance *comp) { fprintf(stderr, "HeatConductorComplex_FMU.c start setDefaultStartValues() \n"); fflush(stderr); fprintf(stderr, "HeatConductorComplex_FMU.c calling fmi2SetDebugLoggin() \n"); fflush(stderr); fmi2SetDebugLogging(comp, 1, 11, logCategoriesNamesAll); If FMU for model exchange or co-simulation: about to call HeatConductorComplex_fmiInstantiate
HeatConductorComplex_FMU.c start setDefaultStartValues()
HeatConductorComplex_FMU.c end setDefaultStartValues()
FMULogger: status: 0 message: fmi2Instantiate: GUID=%s
H.c end fmi2Instantiate()
Done with fmi instantiate
Warning, _debugListeners was null, which means that _debugging was set to true, but no listeners were added?
Done with fmi instantiate
Warning, _debugListeners was null, which means that _debugging was set to true, but no listeners were added?
Called initialize()
FMIImport.initialize() method called.
Warning, _debugListeners was null, which means that _debugging was set to true, but no listeners were added?
FMIImport.initialize() method called.
H.c fmi2SetReal(): 1000,
FMULogger: status: 0 message: fmi2SetReal: nvr = %d
FMULogger: status: 0 message: fmi2SetReal: #r.16g
HeatConductorComplex_FMU.c setReal(19, 1000)
However, we vergil is invoked on the same model: FMU for model exchange or co-simulation: about to call HeatConductorComplex_fmiInstantiate HeatConductorComplex_FMU.c start setDefaultStartValues() HeatConductorComplex_FMU.c end setDefaultStartValues() FMULogger: status: 0 message: fmi2Instantiate: GUID=%s H.c end fmi2Instantiate() Done with fmi instantiate Warning, _debugListeners was null, which means that _debugging was set to true, but no listeners were added? Done with fmi instantiate # # A fatal error has been detected by the Java Runtime Environment: Where "Done with fmi instantiate" is from the end of FMUImport.preinitialize(). How to build an FMU from within OpenModelicaThere are several ways to create a .fmu The simplest way is to create a .mos file like loadModel(Modelica, {"3.2.1"}); getErrorString(); loadModel(HeatConductor); getErrorString(); OpenModelica.Scripting.translateModelFMU( className=HeatConductor, version="2.0"); getErrorString(); and then invoke omc exportFMU.mos To use the tearingMethod, use: omc +tearingMethod=noTearing exportFMU.mos To use sparse: omc +s +simCodeTarget=sfmi exportFMU.mos Using omc creates the modelDescription.xml file and binaries for one platform. Using omc is the most reliable method, though the fmu that is produced will not work on other platforms. Ptolemy II has an extension that builds a fmu at runtime. This extension runs "make platformName", where platformName is the fmu platform such as linux64 or darwin64. Unfortunately, the location of the OpenModelica platform varies between installations. Under Linux, OpenModelica tends to be located in /usr/local/openmodelica. Under Mac OS X, when installed using MacPorts, /opt/local. Thus, building OpenModelica fmus from within Ptolemy is fragile. HeatConductor example.Here's a full example loadModel(Modelica, {"3.2.1"}); getErrorString(); loadFile("HeatConductor.mo"); getErrorString(); OpenModelica.Scripting.translateModelFMU( className=HeatConductor, version="2.0"); getErrorString();
model HeatConductor "Test model for QSS" extends Modelica.Icons.Example; Modelica.Blocks.Interfaces.RealInput TOut "Outside temperature" annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); Modelica.Blocks.Interfaces.RealOutput TSur "Surface temperature" annotation (Placement(transformation(extent={{100,70},{120,90}}))); Real x "State"; initial equation x=273.15; equation der(x) = TOut-x; TSur = x; annotation (uses(Modelica(version="3.2.1")), Diagram(coordinateSystem( preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics)); end HeatConductor; Under RHEL 6, to create export LD_LIBRARY_PATH=/usr/local/gcc-4.8.2/lib64:/usr/local/lib:${LD_LIBRARY_PATH} export OPENMODELICALIBRARY=`pwd`:/usr/local/openmodelica/lib omc +tearingMethod=noTearing exportFMU.mos fmuCheck
time,TOut 0.0,270 0.1,271 0.2,272 0.3,273 0.4,274 0.5,275 0.6,276 0.7,277 0.8,278 0.9,279 Running 2/20/2015 Note that this was fixed at some point [INFO][FMI2XML] [Line:52] Detected during parsing: [ERROR][FMI2XML] Initial 'calculated' is not allowed for variability 'continuous' and causality 'input'. \ Setting initial to 'approx' [INFO][FMI2XML] [Line:59] Detected during parsing: [ERROR][FMI2XML] Start attribute is required for this causality, variability and initial combination [INFO][FMUCHK] Model name: HeatConductor [INFO][FMUCHK] Model GUID: {8c4e810f-3df3-4a00-8276-176fa3c9f9e0} [INFO][FMUCHK] Model version: [INFO][FMUCHK] FMU kind: ModelExchange [INFO][FMUCHK] The FMU contains: 0 constants 0 parameters 0 discrete variables 4 continuous variables 1 inputs 1 outputs 2 local variables 0 independent variables 0 calculated parameters 4 real variables 0 integer variables 0 enumeration variables 0 boolean variables 0 string variables [INFO][FMUCHK] Printing output file header time,TSur [INFO][FMUCHK] Opening input file fmuCheck.csv [INFO][FMUCHK] Detected separator character in input file: , [INFO][FMUCHK] Model identifier for ModelExchange: HeatConductor [INFO][FMILIB] Loading 'darwin64' binary with 'default' platform types [INFO][FMUCHK] Version returned from ME FMU: '2.0' [FMU][logFmi2Call][FMU status:OK] fmi2Instantiate: GUID={8c4e810f-3df3-4a00-8276-176fa3c9f9e0} [FMU][logFmi2Call][FMU status:OK] fmi2SetReal: nvr = 1 [FMU][logFmi2Call][FMU status:OK] fmi2SetReal: TOut = 270 [FMU][logFmi2Call][FMU status:OK] fmi2SetupExperiment: toleranceDefined=0 tolerance=1e-06 startTime=0 stopTimeDefined=0 stopTime=0 [FMU][logFmi2Call][FMU status:OK] fmi2SetTime: time=0 [FMU][logFmi2Call][FMU status:OK] fmi2EnterInitializationMode... [FMU][logFmi2Call][FMU status:OK] fmi2EnterInitializationMode: succeed [FMU][logFmi2Call][FMU status:OK] fmi2ExitInitializationMode... [FMU][logFmi2Call][FMU status:OK] fmi2ExitInitializationMode: succeed [FMU][logFmi2Call][FMU status:OK] fmi2NewDiscreteStates [FMU][logFmi2Call][FMU status:OK] fmi2EventUpdate: Start Event Update! Next Sample Event 0 [FMU][logFmi2Call][FMU status:OK] fmi2EventUpdate: Checked for Sample Events! Next Sample Event 0 [FMU][logFmi2Call][FMU status:OK] fmi2NewDiscreteStates [FMU][logFmi2Call][FMU status:OK] fmi2EventUpdate: Start Event Update! Next Sample Event 0 [FMU][logFmi2Call][FMU status:OK] fmi2EventUpdate: Checked for Sample Events! Next Sample Event 0 And it repeats. This is what is similar to what Michael got with fmusdk_me Using the OpenModelica test fmus
BouncingBall.mos HelloFMIWorld.mos testAssert.mos testInitialEquationsFMI.mos HelloFMIWorldEvent.mos Makefile testBug2764.mos The Makefile runs Here's BouncingBall.mos: // name: BouncingBall // keywords: fmu export import // status: correct // teardown_command: rm -rf binaries sources modelDescription.xml BouncingBallFMI20* output.log BouncingB\ allFMI20/* // Event handling in FMU Import // loadString(" model BouncingBallFMI20 parameter Real e=0.7 \"coefficient of restitution\"; parameter Real g=9.81 \"gravity acceleration\"; Real h(start=1) \"height of ball\"; Real v \"velocity of ball\"; Real v_new; equation der(v) = -g; der(h) = v; when h <= 0.0 then v_new = -e*pre(v); reinit(v, v_new); end when; end BouncingBallFMI20; "); getErrorString(); translateModelFMU(BouncingBallFMI20, version = "2.0"); getErrorString(); importFMU("BouncingBallFMI20.fmu"); getErrorString(); loadFile("BouncingBallFMI20_me_FMU.mo"); getErrorString(); simulate(BouncingBallFMI20_me_FMU, stopTime=3.0); getErrorString(); val(h,0); val(h,1); val(h,3); // Result: // true // "" // "SimCode: The model BouncingBallFMI20 has been translated to FMU" // "Warning: The initial conditions are not fully specified. Use +d=initialization for more information. // " // "BouncingBallFMI20_me_FMU.mo" // "" // true // "" // record SimulationResult // resultFile = "BouncingBallFMI20_me_FMU_res.mat", // simulationOptions = "startTime = 0.0, stopTime = 3.0, numberOfIntervals = 500, tolerance = 1e-06, \ method = 'dassl', fileNamePrefix = 'BouncingBallFMI20_me_FMU', options = '', outputFormat = 'mat', variab\ leFilter = '.*', cflags = '', simflags = ''", // messages = "" // end SimulationResult; // "Warning: The initial conditions are not fully specified. Use +d=initialization for more information. // " // 1.0 // 0.225020520707377 // -0.9555208467051863 // endResult If I run The BouncingBallFMI20.fmu can be loaded and run using bash-4.1$ omc BouncingBall.mos true "" "SimCode: The model BouncingBallFMI20 has been translated to FMU" "Warning: The initial conditions are not fully specified. Use +d=initialization for more information. " "BouncingBallFMI20_me_FMU.mo" "" true "" record SimulationResult resultFile = "/home/cxh/src/openmodelica/testsuite/openmodelica/fmi/ModelExchange/2.0/BouncingBallFMI\ 20_me_FMU_res.mat", simulationOptions = "startTime = 0.0, stopTime = 3.0, numberOfIntervals = 500, tolerance = 1e-06, met\ hod = 'dassl', fileNamePrefix = 'BouncingBallFMI20_me_FMU', options = '', outputFormat = 'mat', variableF\ ilter = '.*', cflags = '', simflags = ''", messages = "", timeFrontend = 0.029402416, timeBackend = 0.005088676, timeSimCode = 0.006797096000000001, timeTemplates = 0.017980524, timeCompile = 0.366838514, timeSimulation = 0.044405144, timeTotal = 0.470683773 end SimulationResult; "Warning: The initial conditions are not fully specified. Use +d=initialization for more information. " 1.0 0.225020520707377 -0.9555208445822925 bash-4.1$ Noncompliance2/19/20 - This was fixed at some point in the past However, running fmuCheck on BouncingBallFMI20.fmu goes into the loop: [FMU][logFmi2Call][FMU status:OK] fmi2EventUpdate: Start Event Update! Next Sample Event 0 [FMU][logFmi2Call][FMU status:OK] fmi2EventUpdate: Checked for Sample Events! Next Sample Event 0 So, it seems like the OpenModelica FMI-2.0 Model Exchange fmus are no compliant. I tried fixing the possible bug involving I created a loadString(" model HeatConductor \"Test model for QSS\" extends Modelica.Icons.Example; Modelica.Blocks.Interfaces.RealInput TOut \"Outside temperature\" annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); Modelica.Blocks.Interfaces.RealOutput TSur \"Surface temperature\" annotation (Placement(transformation(extent={{100,70},{120,90}}))); Real x \"State\"; initial equation x=273.15; equation der(x) = TOut-x; TSur = x; annotation (uses(Modelica(version=\"3.2.1\")), Diagram(coordinateSystem( preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics)); end HeatConductor; "); getErrorString(); OpenModelica.Scripting.translateModelFMU(className=HeatConductor, version="2.0"); getErrorString(); importFMU("HeatConductor.fmu"); getErrorString(); loadFile("HeatConductor_FMU.mo"); getErrorString(); simulate(HeatConductor_me_FMU, stopTime=3.0); getErrorString(); val(h,270); val(h,273); val(h,275); and it reproduced the error message that Michael got: bash-4.1$ omc HeatConductor.mos true "" "SimCode: The model HeatConductor has been translated to FMU" "Notification: Automatically loaded package Modelica 3.2.1 due to uses annotation. Notification: Automatically loaded package Complex 3.2.1 due to uses annotation. Notification: Automatically loaded package ModelicaServices 3.2.1 due to uses annotation. " "HeatConductor_me_FMU.mo" "Error: module = Initial 'calculated' is not allowed for variability 'continuous' and causality 'input'. \ Setting initial to 'approx', log level = ERROR: FMI2XML Error: module = Start attribute is required for this causality, variability and initial combination, log \ level = ERROR: FMI2XML " false "" record SimulationResult resultFile = "", simulationOptions = "startTime = 0.0, stopTime = 3.0, numberOfIntervals = 500, tolerance = 1e-06, met\ hod = 'dassl', fileNamePrefix = 'HeatConductor_me_FMU', options = '', outputFormat = 'mat', variableFilte\ r = '.*', cflags = '', simflags = ''", messages = "Simulation Failed. Model: HeatConductor_me_FMU does not exist! Please load it first befor\ e simulation.", timeFrontend = 0.0, timeBackend = 0.0, timeSimCode = 0.0, timeTemplates = 0.0, timeCompile = 0.0, timeSimulation = 0.0, timeTotal = 0.0 end SimulationResult; "" OpenModelica VanDerPol crashAt some point the OpenModelica VanDerPol demo started failing. To replicate: cd ~/src svn co -r '{2015-04-01}' https://repo.eecs.berkeley.edu/svn/projects/eal/p\ tII/trunk ptII2015-04-01 >& svn.out cd ptII2015-04-01 export PTII=`pwd` (./configure; ant) >& ant.out cd ptolemy/actor/lib/fmi/fmus/omc/test make Below is a sample crash, from 2015-04-01: ------------------ testing $PTII/ptolemy/actor/lib/fmi/fmus/omc/test/auto/VanDerPol.xml auto.tcl: Setting watchdog for 200 seconds at Mon May 11 08:56:15 PDT 2015 FMUFile: Extracting to /tmp/FMUFile884956057910432359.tmp 84 ms. Memory: 930816K Free: 817697K (88%) util.testsuite.WatchDog.cancel(): canceling Mon May 11 08:56:15 PDT 2015 auto.tcl: Setting watchdog for 200 seconds at Mon May 11 08:56:15 PDT 2015 34 ms. Memory: 930816K Free: 815099K (88%) util.testsuite.WatchDog.cancel(): canceling Mon May 11 08:56:15 PDT 2015 # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f733efea33c, pid=39207, tid=140132213507840 # # JRE version: Java(TM) SE Runtime Environment (8.0_45-b14) (build 1.8.0_45-b14) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.45-b02 mixed mode linux-amd64 compressed oops) # Problematic frame: # V [libjvm.so+0x8cb33c] Monitor::wait(bool, long, bool)+0x35c # # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again # # An error report file with more information is saved as: # /home/cxh/src/ptII2015-04-01/ptolemy/actor/lib/fmi/fmus/omc/test/hs_err_pid39207.log # # If you would like to submit a bug report, please visit: # http://bugreport.java.com/bugreport/crash.jsp
VanDerPolLooking at the above analysis, it seems like VanDerPol.fmu has a problem.
The same issue happens with the most recent VanDerPol.fmu in the ptII tree. The next step is to update OpenModelica and try again. |