-
Notifications
You must be signed in to change notification settings - Fork 84
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
slow parsing of getHeaderElementTMY3 #950
Comments
@Mathadon to implement this and clearly mention that the line should start with the tag |
There is an implementation in https://github.com/ibpsa/modelica-ibpsa/tree/issue950_tmyheader . However, the code produces weird errors when the tag is not found. E.g. when running
I tried changing the file, the contents of line 733 does not matter. All previous lines are read correctly. The number of characters before line 733 does seem to matter. The issue only appears when the file has 92533 characters. When the number of characters is less, the following error is produced:
until the number of lines is <=730 (~92290 characters), then the error correctly becomes:
The funny errors are produced while calling
The error
the error disappears when increasing the buffer size Conclusion: this is a bug in Dymola. The least they could do is produce a clear error message when the buffer overflows. I'll report this. In case someone wants to reproduce this: make sure to compile |
I added the label 'external' to indicate that we better wait on an external bugfix before merging this. Otherwise users will get these obscure warnings. |
The answer of the developers is essentially that this is a known limitation and they are not going to change it since it is an easy way of avoiding memory overflows. I got the suggestion to use a custom C implementation to avoid this behavior. I'll try to make some time for this. Or do we want to stick to the MSL implementation? |
A custom C implementation is fine if you make sure you don't get memory
overflow.
…On Tue, Jun 26, 2018 at 03:44 Filip Jorissen ***@***.***> wrote:
The answer of the developers is essentially that this is a known
limitation and they are not going to change it since it is an easy way of
avoiding memory overflows.
I got the suggestion to use a custom C implementation to avoid this
behavior. I'll try to make some time for this. Or do we want to stick to
the MSL implementation?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#950 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABRHuEJk6Em5LA2J49uGXDuUB42MW3Ahks5uAfRHgaJpZM4Un1yr>
.
|
I will close this for now due to inactivity. |
When a TMY3 file does not contain the correct header, it searches through the entire file for the header. On my PC on linux this takes 10 minutes for a file containing 8800 lines. This process happens during translation, due to which it seems as if dymola has stalled.
The problem seems that the implementation of
Modelica.Utilities.Strings.find
is quite inefficient, which is used in the for loop:See also lbl-srg/BuildingsPy#203.
This issue could possibly be resolved by only checking for the keyword
start
at the start of the line, e.g. by usingdo we want to change this implementation?
The text was updated successfully, but these errors were encountered: