-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OMJulia not responding with long debug message #59
Comments
@AnHeuermann I could also reproduce the problem and when i remove the
but i could not see the debug log generated from |
The message should be in |
As a general remark, once a simulation tool has been refined enough to be actually usable for real-life work, small problems work fine, while trouble can arise with large, complicated models, which inevitably generate humongous log files. Sizes of serveral hundreds MB, or even over the GB size, are not unheard of, I had to handle some of them in the past when I had to turn on The most frustrating situation for an end-user (I say this out of personal experience) is that you can't get this information when you need it most, i.e. when you are trying to get difficult real-life problems to work. When you have such large log files, there are two potential issues:
As I understand, the only safe scalable way to handle log files is to write them directly to mass storage, and then, only when this is possible (e.g. if the size is below a certain threshold), to read them back into memory for further fancy post-processing. I understand this is what OMEdit does with the C runtime: if the log exceeds 10 MB size, OMEdit doesn't even try to load it in the simulation output window, which is simply not designed to handle such large files effectively. Then one can use other tools, for example I use jEdit (which has very handy grep-like search features) for file size up to a few hundred MB, and PilotEdit, which does not load the entire file in memory, for larger files. One could also write small python or julia scripts to look for specific features into those files, grep them, or whatever. Bottom line: the debug log handling has to be designed with large files in mind from the start! This is not an advanced feature, it is a basic fundamental one. Implementing a log file handling mechanism that relies on data structures in RAM, string arrays, or stuff like that, only works for toy models, but is inevitably bound to fail when it is needed most, so it is not a sound design and should be avoided. @JKRT, what do you think? |
That's exactly what I meant as a questionable design 😃. Guaranteed not to work when you really need it. I guess this can easily be improved by only using this data structure for sizes up to a certain limit, adding a reference to a file on mass storage if that size is exceeded. |
Some bullets. You are right that you might sometimes need to write to file, since in some cases available memory is not enough, and swapping might result in the simulation taking an even longer time to complete. However, even writing to file is not 100% bulletproof. I remember one instance where I managed to overwrite my hard drive when experimenting with the logfiles in the scaleable test suite (For such extreme cases a cloud solution might be needed, or storing the log file in some compressed format.) Julia has builtin support for logging Concerning this particular issue, I guess the issue is twofold. One being with the receive method the other concerns that this particular flag does not save any message at all.
The send(socket, x) and recv(socket, SomeType) functions make an extra copy of the data when converting between ZMQ and Julia. Alternatively, for large data sets (e.g. very large arrays or long strings), it can be preferable to share data, with send(socket, Message(x)) and msg = recv(Message), where the msg::Message object acts like an array of bytes; this involves some overhead so it may not be optimal for short messages. I guess this is what we do here, but I do not remember to 100% how this works and that we get the result as a very large string (If we get anything at all). Is this an issue in OMMatlab @arun3688 ? |
@JKRT, @AnHeuermann This is not an issue in
|
Of course. But at least you have 1-2 more orders of magnitude of headroom. Setting an upper limit to file size as well seems a good strategy.
A full hard disk is in fact even worse than a full RAM, in the sense that the problem doesn't go away when you reboot...
And maybe also do that for the file size, just in case. |
When I run the following script
with omc the total time is around 8 seconds.
When I convert the script to be used in OMJulia it will not finish (at least in an amount I'm willing to wait).
When I cancle the last command I get
When I remove
dumpSimCode
OMJulia simulates fine in around 7 seconds.My guess is that the debug log is to large to be handled.
The text was updated successfully, but these errors were encountered: