Opened 9 years ago

Last modified 3 years ago

#3565 new defect

OMC does not tell the user what it is doing

Reported by: casella Owned by:
Priority: critical Milestone:
Component: *unknown* Version:
Keywords: Cc: andrea.bartolini@…

Description (last modified by casella)

When compiling models of significant size (not necessarily very large), omc can take a few minutes (or possibly hours) to complete the process. It is often the case that nothing is printed to the console or log file for a long time, so one doesn't have a clue about what is happening, and can only stare at a blank window, wait indefinitely and hope for the best. This can be really frustrating from an end-user perspective.

Proposal:

  • add a debug flag (e.g. +d=logCompilationPhases that prints a message on stdout every time a major phase in the compilation process is started (e.g. front-end, back-end, simcode, templates, C compilation), and that records the time spent for each phase once completed
  • add a debug flag (e.g. +d=logCompilationPhasesDetailed that prints a message on stdout every time a specific activity is started (e.g. for the back-end it could be every single optimization module, for the front-end and code generation I don't know) and record the time spent for each phase once completed
  • flush the stream after each message is written, so that it can actually be captured by the console or by OMEdit, displayed in a timely manner, and not get lost if the process needs to be killed because of timeout or too much memory allocation

All these messages could have some common header, so that OMEdit can filter them out and display them nicely in some window showing the progress in the compilation phase.

Change History (14)

comment:1 Changed 9 years ago by casella

  • Description modified (diff)

comment:2 follow-up: Changed 9 years ago by sjoelund.se

Or perhaps translateModel(..., logCompilationPhases="path/to/something.json")? If it is only for OMEdit, we could do something similar as we do for the plot command, where OMEdit provides a call-back function plus data for a unique ID that directly updates the GUI window.

These could both be combined (and have a compiler flag as well to log this when run from the command-line).

comment:3 in reply to: ↑ 2 Changed 9 years ago by casella

Replying to sjoelund.se:

Or perhaps translateModel(..., logCompilationPhases="path/to/something.json")? If it is only for OMEdit, we could do something similar as we do for the plot command, where OMEdit provides a call-back function plus data for a unique ID that directly updates the GUI window.

These could both be combined (and have a compiler flag as well to log this when run from the command-line).

That would be nice!

comment:4 Changed 9 years ago by casella

In the meantime, Martin suggested us the following combination of flags: -d=gcProfiling,exectstat and --showErrorMessages, which indeed gave us a lot of useful information for debugging.

Also, we found out that running omc test.mos > log.txt under Linux doesn't work well, because the OS is somehow lazy at copying the output from stdout to the log file. omc test.mos |& tee log works much better from this point of view.

comment:5 Changed 9 years ago by sjoelund.se

  • Milestone changed from 1.9.4 to 1.9.5

Milestone pushed to 1.9.5

comment:6 Changed 9 years ago by sjoelund.se

  • Milestone changed from 1.9.5 to 1.10.0

Milestone renamed

comment:7 Changed 8 years ago by sjoelund.se

  • Milestone changed from 1.10.0 to 1.11.0

Ticket retargeted after milestone closed

comment:8 Changed 8 years ago by sjoelund.se

  • Milestone changed from 1.11.0 to 1.12.0

Milestone moved to 1.12.0 due to 1.11.0 already being released.

comment:9 Changed 7 years ago by casella

  • Milestone changed from 1.12.0 to 1.13.0

Milestone moved to 1.13.0 due to 1.12.0 already being released.

comment:10 Changed 6 years ago by casella

  • Milestone changed from 1.13.0 to 1.14.0

Rescheduled to 1.14.0 after 1.13.0 releasee

comment:11 Changed 5 years ago by casella

  • Milestone changed from 1.14.0 to 1.16.0

Releasing 1.14.0 which is stable and has many improvements w.r.t. 1.13.2. This issue is rescheduled to 1.16.0

comment:12 Changed 4 years ago by casella

  • Milestone changed from 1.16.0 to 1.17.0

Retargeted to 1.17.0 after 1.16.0 release

comment:13 Changed 4 years ago by casella

  • Milestone changed from 1.17.0 to 1.18.0

Retargeted to 1.18.0 because of 1.17.0 timed release.

comment:14 Changed 3 years ago by casella

  • Milestone 1.18.0 deleted

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.