Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#4130 closed defect (worksforme)

FMI ModelExchange export - blocked to fmi2EnterInitializationMode with checker - simple case with loop

Reported by: ali.el-akoum@… Owned by: Adeel Asghar
Priority: high Milestone: Future
Component: FMI Version: v1.9.4-v1.9.x
Keywords: FMI ME loop Cc: audrey.jardin@…, jean-philippe.tavella@…

Description

For the simple example attached, the FMU Model Exchange doesn't work with the checker.
The checker crashes and the end of the log is the following :

[FMU][logFmi2Call][FMU status:OK] fmi2Instantiate: GUID={8c4e810f-3df3-4a00-8276-176fa3c9f9e0}

[VERBOSE][FMICAPI] Calling fmi2SetupExperiment

[FMU][logFmi2Call][FMU status:OK] fmi2SetupExperiment: toleranceDefined=0 tolerance=1e-006 startTime=0 stopTimeDefined=0 stopTime=0

[VERBOSE][FMICAPI] Calling fmi2EnterInitializationMode

[FMU][logFmi2Call][FMU status:OK] fmi2EnterInitializationMode...

Attachments (5)

Test_2.fmu (1.9 MB ) - added by EL AKOUM <ali.el-akoum@…> 8 years ago.
Test_2.mo (1.6 KB ) - added by EL AKOUM <ali.el-akoum@…> 8 years ago.
log_2.txt (3.7 KB ) - added by EL AKOUM <ali.el-akoum@…> 8 years ago.
Test_2.2.mo (1.4 KB ) - added by EL AKOUM <ali.el-akoum@…> 8 years ago.
log_2_1.txt (4.3 MB ) - added by Adeel Asghar 8 years ago.

Change History (18)

by EL AKOUM <ali.el-akoum@…>, 8 years ago

Attachment: Test_2.fmu added

by EL AKOUM <ali.el-akoum@…>, 8 years ago

Attachment: Test_2.mo added

by EL AKOUM <ali.el-akoum@…>, 8 years ago

Attachment: log_2.txt added

by EL AKOUM <ali.el-akoum@…>, 8 years ago

Attachment: Test_2.2.mo added

comment:1 by EL AKOUM <ali.el-akoum@…>, 8 years ago

File Test_2.2.mo is the file to generate the FMU.

Thank you in advance

comment:2 by Rüdiger Franke, 8 years ago

Just had a quick look using the current nightly build of OpenModelica under Linux64. Everything works fine. Your log says:

FMI compliance checker 2.0.1 [FMILibrary: 2.0.1] build date: Oct 24 2014

Did you try the new version 2.0.3 that was released in September 2016?

Last edited 8 years ago by Rüdiger Franke (previous) (diff)

comment:3 by Rüdiger Franke, 8 years ago

Under Windows I get the same segfault. You may try the Cpp runtime by selecting:

OMEdit: Tools->Options->Simulation->Target Language: Cpp

or

setCommandLineOptions("+simCodeTarget=Cpp")

Then it works under Windows as well. Restricted to ME:

fmuCheck.win32.exe -k me Test_2.fmu

(at the benefit of significantly smaller FMU size -- 716 KB instead of 8297 KB for your example using a recent nightly build of OpenModelica -- down to 99 KB when using msvc instead of gcc)

The reported error appears irrelevant for typical uses, but will be fixed soon:

[ERROR][FMUCHK] FMU does not make an internal copy of provided instance name (violation of fmiString handling)

comment:4 by Rüdiger Franke, 8 years ago

Pull request 1215 eliminates the error messages of fmuCheck.

comment:5 by Adeel Asghar, 8 years ago

I tried the example with the latest nightly build version of OpenModelica. I created the fmu using Test_2.2.mo and then used the latest fmuchecker version 2.0.3. Attached the log file when I run the fum with it. Everything seems fine.
Note that I am using the 64-bit version of OpenModelica and fmuchecker.

by Adeel Asghar, 8 years ago

Attachment: log_2_1.txt added

in reply to:  3 comment:6 by anonymous, 8 years ago

Thank you very much, this solution solves my problem. It works with the checker and with my code.

Replying to rfranke:

Under Windows I get the same segfault. You may try the Cpp runtime by selecting:

OMEdit: Tools->Options->Simulation->Target Language: Cpp

or

setCommandLineOptions("+simCodeTarget=Cpp")

Then it works under Windows as well. Restricted to ME:

fmuCheck.win32.exe -k me Test_2.fmu

(at the benefit of significantly smaller FMU size -- 716 KB instead of 8297 KB for your example using a recent nightly build of OpenModelica -- down to 99 KB when using msvc instead of gcc)

The reported error appears irrelevant for typical uses, but will be fixed soon:

[ERROR][FMUCHK] FMU does not make an internal copy of provided instance name (violation of fmiString handling)

in reply to:  2 comment:7 by anonymous, 8 years ago

If I keep :
OMEdit: Tools->Options->Simulation->Target Language: C
The FMU doesnt work with the last version of the checker. I get the same error message

Replying to rfranke:

Just had a quick look using the current nightly build of OpenModelica under Linux64. Everything works fine. Your log says:

FMI compliance checker 2.0.1 [FMILibrary: 2.0.1] build date: Oct 24 2014

Did you try the new version 2.0.3 that was released in September 2016?

in reply to:  5 comment:8 by anonymous, 8 years ago

Thank you very much for your answer.
It works when I choose Cpp runtime (solution proposed by rfranke) :
OMEdit: Tools->Options->Simulation->Target Language: Cpp

Replying to adeas31:

I tried the example with the latest nightly build version of OpenModelica. I created the fmu using Test_2.2.mo and then used the latest fmuchecker version 2.0.3. Attached the log file when I run the fum with it. Everything seems fine.
Note that I am using the 64-bit version of OpenModelica and fmuchecker.

comment:9 by Adeel Asghar, 8 years ago

OK. Its up to what you want to use. I tested it with C runtime and it works.

in reply to:  9 comment:10 by anonymous, 8 years ago

It is weird, it doesnt work on my computer (windows 8 - openModelica 1.9.6 - FMU 32 bits)
Thank you very much for your time

Replying to adeas31:

OK. Its up to what you want to use. I tested it with C runtime and it works.

comment:11 by Adeel Asghar, 8 years ago

Resolution: worksforme
Status: newclosed

You need to install new versions of OpenModelica & FMUChecker.

in reply to:  11 comment:12 by anonymous, 8 years ago

1.9.6 is not the last version of OpenModelica? how can I get the last version?

C runtime doesnt work for all cases on my computer.
Cpp runtime doesnt work in some cases.
In some cases, both runtimes doesnt work !

Replying to adeas31:

You need to install new versions of OpenModelica & FMUChecker.

comment:13 by Rüdiger Franke, 8 years ago

I'm having a not so old version under Windows:

OMEdit v1.10.0-dev-170-gaf701af
Connected to OpenModelica v1.11.0-dev-73-g8c6ebff

Still can reproduce the crash using the latest FMUChecker.

Note: See TracTickets for help on using tickets.