Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#6107 closed defect (fixed)

OMEdit adds invalid annotation

Reported by: Francesco Casella Owned by: Adeel Asghar
Priority: blocker Milestone: 1.16.0
Component: OMEdit Version:
Keywords: Cc: Karim Adbdelhak

Description

When the "Save simulation flags inside model" option is checked, OMEdit adds the outputFormat="mat" field to the __OpenModelica_simulationFlags annotation. This field does not correspond to any valid simulation flag. As a consequence, when trying to run such a model from the command line, an error is generated and the model cannot be run.

Please make sure this field is not added to the annotation.

Attachments (1)

TestAnnotation.mo (386 bytes ) - added by Francesco Casella 4 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 by Adeel Asghar, 4 years ago

Resolution: fixed
Status: newclosed

comment:2 by Francesco Casella, 4 years ago

Great, thanks!

comment:3 by Francesco Casella, 4 years ago

Resolution: fixed
Status: closedreopened

We now have the problem that models created before this fix now hang at the end of the simulation if run with the newer versions. The attached MWE demonstrates the issue. We should avoid this problem in the released 1.16.0, otherwise there will be a potentially large number of user-built models that will stop working with the new release.

by Francesco Casella, 4 years ago

Attachment: TestAnnotation.mo added

comment:4 by Adrian Pop, 4 years ago

Models do not hang. They just exit successfully without generating a .mat file and OMEdit hangs waiting for the mat file to appear.

The simulation executable gives a warning stdout | warning | invalid command line option: -outputFormat=mat if you run it from command line manually. Via OMEdit there is *nothing* in the simulation window!

comment:5 by Adeel Asghar, 4 years ago

Status: reopenedaccepted

I will check what's wrong.

comment:6 by Adeel Asghar, 4 years ago

Nothing hangs. Its just that OMEdit don't show anything.

The simulation executable warning is not shown when -logFormat=xmltcp is used which is the format used by OMEdit.

comment:7 by Adeel Asghar, 4 years ago

The simulation executable exits before making a the tcp connection to send the data to OMEdit. I changed the order in which flags are read/set.

I opened PR https://github.com/OpenModelica/OpenModelica/pull/6762. We will see if all the tests pass.

in reply to:  6 comment:8 by Francesco Casella, 4 years ago

Replying to adeas31:

Nothing hangs.

Well, that depends on your definition of "hangs" :)

Seriously, the normal workflow is that the progress bar gets to 100%, then the "Cancel Simulation" button is greyed out, the "Open output file" button becomes active, and the results become visible in the variable browser. The last three events unfortunately do not take place, and you actually have to cancel the simulation to get rid of the Simulation Ouptut window, so from a user's perspective, the simulation indeed hangs at the end of the process.

comment:9 by Adeel Asghar, 4 years ago

Resolution: fixed
Status: acceptedclosed

comment:10 by Francesco Casella, 4 years ago

Thanks Adeel!

Note: See TracTickets for help on using tickets.