Opened 9 years ago

Last modified 3 years ago

#3843 new defect

Write .log file directly to disk

Reported by: Francesco Casella Owned by: somebody
Priority: high Milestone:
Component: Run-time Version:
Keywords: Cc:

Description (last modified by Francesco Casella)

If I simulate ThermoPower.Examples.CISE.CISESim120501 with OMC for Windows 64 bit with the following flags:

setCommandLineOptions("+cseCall +cseEachCall 
  --tearingMethod=omcTearing --preOptModules+=introduceDerAlias 
  --preOptModules-=clockPartitioning 
  -d=dumpSimCode,nogen,initialization,backenddaeinfo,discreteinfo,
     stateselection"); getErrorString();
simulate(ThermoPower.Examples.CISE.CISESim120501, 
         simflags = "-lv LOG_STATS"); getErrorString();

I get this message on the console:

Error: File too large to fit into a MetaModelica string: 
ThermoPower.Examples.CISE.CISESim120501.log.

and the log file does not contain the log of the solver.

These log files can become huge (hundreds of megabytes). This is no big deal, as long as they are written directly to file. Having access to this information can be crucial for debugging.

Please make sure this date goes straight to mass storage without being stored in a MetaModelica string.

Change History (12)

comment:1 by Francesco Casella, 9 years ago

Description: modified (diff)

comment:2 by Martin Sjölund, 9 years ago

They are written directly to file, but on compilation error, getErrorString() displays the error for convenience. And on 32-bit platforms, the maximum size of strings is small. But we could check the file size and make the displayed error just point to the file if it is over a certain threshold.

comment:3 by Francesco Casella, 9 years ago

What I noticed was that the "string too large" error actually prevented the stuff to be written to the .log file, which did not contain any LOG lines, only the simulation statistics. Also, this is is happening on a 64 bit platform, not on a 32-bit one.

Anyway, I think the Dymola approach (which I suggested them many years ago) makes sense here: if the error message is over 10 MB, it is only written to disk and the path of the file displayed in the error message.

comment:4 by Martin Sjölund, 8 years ago

Milestone: 1.10.01.11.0

Ticket retargeted after milestone closed

comment:5 by Martin Sjölund, 8 years ago

Milestone: 1.11.01.12.0

Milestone moved to 1.12.0 due to 1.11.0 already being released.

comment:6 by Francesco Casella, 7 years ago

Moved to milestone 1.13.0 as milestone 1.12.0 was closed

comment:7 by Francesco Casella, 7 years ago

Milestone: 1.12.01.13.0

Milestone moved to 1.13.0 due to 1.12.0 already being released.

comment:8 by Francesco Casella, 6 years ago

Milestone: 1.13.01.14.0

Rescheduled to 1.14.0 after 1.13.0 releasee

comment:9 by Francesco Casella, 5 years ago

Milestone: 1.14.01.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:10 by Francesco Casella, 4 years ago

Milestone: 1.16.01.17.0

Retargeted to 1.17.0 after 1.16.0 release

comment:11 by Francesco Casella, 4 years ago

Milestone: 1.17.01.18.0

Retargeted to 1.18.0 because of 1.17.0 timed release.

comment:12 by Francesco Casella, 3 years ago

Milestone: 1.18.0

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.