modelica / ModelicaSpecification

Specification of the Modelica Language
https://specification.modelica.org
Creative Commons Attribution Share Alike 4.0 International
104 stars 40 forks source link

Specification of LateInline annotation incorrect? #263

Closed modelica-trac-importer closed 6 years ago

modelica-trac-importer commented 6 years ago

Reported by fcasella on 27 Jan 2010 22:07 UTC I have tried to understand exactly how the caching of function calls works in the Modelica.Media IF97 medium model, using the Inline=false, LateInline=true annotations. I attach the results of my analysis to this ticket.

As far as I understand, the sought after result (i.e., avoiding multiple calls to functions computing thermodynamic properties at the same values of p,h) is obtained if LateInline = true means that the function is inlined *after* common subexpression evaluation is applied, not before as stated by the Modelica specification 3.1, section 17.3 p.181.

Also, it is not too clear what is the semantics if Inline = true and LateInline = false. Is the function inlined or not in this case?

This annotation is crucial for efficient performance of the IF97 water model in Modelica.Media, which is now going to be supported by several tool vendors. It would be nice to clarify this in Modelica 3.2.


Migrated-From: https://trac.modelica.org/Modelica/ticket/263

modelica-trac-importer commented 6 years ago

Modified by fcasella on 27 Jan 2010 22:10 UTC

modelica-trac-importer commented 6 years ago

Comment by HansOlsson on 15 Sep 2010 14:54 UTC Seems to be corrected in MSL 3.2 (clearly for 'Inline=true and LateInline=false').

modelica-trac-importer commented 6 years ago

Comment by dietmarw on 15 Sep 2010 15:16 UTC Hans, for me it looks like an Modelica Specification issue. So how can this be resolved in the Standard Library?

modelica-trac-importer commented 6 years ago

Comment by HansOlsson on 15 Sep 2010 16:06 UTC Meant 'Modelica Specification 3.2' and not 'MSL 3.2'.

modelica-trac-importer commented 6 years ago

Modified by dietmarw on 15 Sep 2010 16:47 UTC