Opened 21 months ago

Closed 20 months ago

Last modified 20 months ago

#6107 closed defect (fixed)

OMEdit adds invalid annotation

Reported by: casella Owned by: adeas31
Priority: blocker Milestone: 1.16.0
Component: OMEdit Version:
Keywords: Cc: Karim.Abdelhak

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 casella 20 months ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 21 months ago by adeas31

  • Resolution set to fixed
  • Status changed from new to closed

comment:2 Changed 21 months ago by casella

Great, thanks!

comment:3 Changed 20 months ago by casella

  • Resolution fixed deleted
  • Status changed from closed to reopened

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.

Changed 20 months ago by casella

comment:4 Changed 20 months ago by adrpo

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 Changed 20 months ago by adeas31

  • Status changed from reopened to accepted

I will check what's wrong.

comment:6 follow-up: Changed 20 months ago by adeas31

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 Changed 20 months ago by adeas31

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.

comment:8 in reply to: ↑ 6 Changed 20 months ago by casella

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 Changed 20 months ago by adeas31

  • Resolution set to fixed
  • Status changed from accepted to closed

comment:10 Changed 20 months ago by casella

Thanks Adeel!

Note: See TracTickets for help on using tickets.