Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#6206 closed defect (fixed)

The NF fails to evaluate expression in Buildings library

Reported by: Francesco Casella Owned by: Per Östlund
Priority: critical Milestone: 1.18.0
Component: New Instantiation Version:
Keywords: Cc: Michael Wetter

Description (last modified by Francesco Casella)

Please check
Buildings.Fluid.Geothermal.Borefields.Examples.Borefields. The NF fails with

[Compiler/NFFrontEnd/NFCeval.mo:1125:9-1125:67:writable] Error: 
Internal error NFCeval.evalBinaryPow failed to evaluate
borFie2UTubParDat.conDat.hBor ^ 2.0

Change History (18)

comment:1 by Francesco Casella, 4 years ago

Milestone: 1.17.01.18.0

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

borFie2UTubPar.groTemRes.borFieDat.conDat.hBor evaluates to borFie2UTubParDat.conDat.hBor which is a little odd.

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

If I add a second evalExp_impl, it does evaluate it and gets further (but there are many other places where that cref is not evaluated fully).

comment:4 by Francesco Casella, 4 years ago

Description: modified (diff)

comment:5 by Per Östlund, 4 years ago

The issue is that the model has variability issues, where e.g. record instance parameter are given bindings that are variables, i.e. there are record instances that should be declared as parameter but aren't. There's been some confusion in the past about what the variability of record instances that only contain constants/parameters is, but #1832 says that there are no special rules for record instances.

So the error message comes from the fact that Ceval skips evaluating nonparameter crefs. Ceval should probably just give an error in such cases, but I think there's a reason for it that I don't remember. But it doesn't matter, the actual issue is that the variability issue should be caught earlier so we never get there in the first place.

I've fixed the variability check in PR 7361 so that we now get a better error message:

[Borefields.mo:2050:111-2050:140:writable] Error: Component borFieDat of variability parameter has binding 'borFie2UTubParDat' of higher variability continuous.

The fix is trivial, just add parameter to some of the components in the model. But I will wait until the library coverage job has been run with this change, in case there are other models in the library with this issue that should be fixed at the same time.

comment:6 by Francesco Casella, 4 years ago

OK, it seems that we are on the right path to finally solve this issue and get a big boost of the success ratio of the library. Thanks!

comment:7 by Francesco Casella, 4 years ago

I just checked the new error message, and indeed it worked fine

[Buildings 7.0.0/Fluid/Geothermal/Borefields/Examples/Borefields.mo:15:5-15:32:writable] 
Error: Component borFieDat of variability parameter has binding 'borFie2UTubParDat'
of higher variability continuous.

I'm not sure how many instances of this error are there in the Jenkins run of the library, which is important to know if you want to fix the library itself on the 7.0.x maintenance branch. Maybe you can grep "of higher variability continuous" in the directory where all the error logs are written, in order to find out?

comment:8 by Francesco Casella, 4 years ago

Unfortunately the other ticket failing because of not evaluated structural parameter, #5991, seems not to be affected, it probably has a different root cause.

in reply to:  7 comment:9 by Per Östlund, 4 years ago

Resolution: fixed
Status: newclosed

Replying to casella:

I'm not sure how many instances of this error are there in the Jenkins run of the library, which is important to know if you want to fix the library itself on the 7.0.x maintenance branch. Maybe you can grep "of higher variability continuous" in the directory where all the error logs are written, in order to find out?

Already done, see this PR, so I guess we might as well close this.

comment:10 by Francesco Casella, 4 years ago

Cc: Michael Wetter added

I'd prefer to close this once we have proof everything works fine on our testsuite, just in case something goes wrong in the process.

BTW, I'm not sure I'm getting all the details right:

  • @perost opened issue #2438
  • @perost opened PR #2439 to address it, which was rejected by the CI system checks, maybe because it was applied to the master branch
  • @mwetter then opened PR #2441 on master, which passed but is not yet merged in, and PR #2442 on maint_7.0.x, which is ready to be merged. I'm not sure if the two are equivalent, because they apparently refer to different commits, and if they both address the issue raised in #2438.

@mwetter, can you please shed some light and merge in everything ASAP, so we can see the results on our CI testsuite?

Thanks!

comment:11 by Per Östlund, 4 years ago

Resolution: fixed
Status: closedreopened

in reply to:  10 comment:12 by Per Östlund, 4 years ago

Replying to casella:

I'd prefer to close this once we have proof everything works fine on our testsuite, just in case something goes wrong in the process.

Fine with me.

Replying to casella:

BTW, I'm not sure I'm getting all the details right:

  • @perost opened issue #2438
  • @perost opened PR #2439 to address it, which was rejected by the CI system checks, maybe because it was applied to the master branch
  • @mwetter then opened PR #2441 on master, which passed but is not yet merged in, and PR #2442 on maint_7.0.x, which is ready to be merged. I'm not sure if the two are equivalent, because they apparently refer to different commits, and if they both address the issue raised in #2438.

@mwetter, can you please shed some light and merge in everything ASAP, so we can see the results on our CI testsuite?

Thanks!

I guess he can't reply here since the Trac is in read-only mode for non-admins, but the new PRs just apply my fix to master and the maintenance branch. I'm not sure why a new PR was needed for master, but it's just his workflow I guess.

comment:13 by Francesco Casella, 4 years ago

OK, @mwetter please reply on github. We will migrate trac on github anytime soon :)

comment:14 by Per Östlund, 4 years ago

Resolution: fixed
Status: reopenedclosed

Closing again since the library issue has now been fixed.

comment:15 by Francesco Casella, 4 years ago

OK. Let's see how many models are fixed on our CI as soon as it runs again.

in reply to:  15 comment:16 by Per Östlund, 4 years ago

Replying to casella:

OK. Let's see how many models are fixed on our CI as soon as it runs again.

15 models will be improved (since all the fixed models are example/validation models that don't affect other models), but about 6-7 of them still don't pass the frontend if I remember correctly from my testing.

comment:18 by Francesco Casella, 4 years ago

OK. Too bad many of them are now failing for other issues. We'll track them down later on.

Note: See TracTickets for help on using tickets.