Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#6206 closed defect (fixed)

The NF fails to evaluate expression in Buildings library

Reported by: casella Owned by: perost
Priority: critical Milestone: 1.18.0
Component: New Instantiation Version:
Keywords: Cc: mwetter

Description (last modified by 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 Changed 3 years ago by casella

  • Milestone changed from 1.17.0 to 1.18.0

comment:2 Changed 3 years ago by sjoelund.se

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

comment:3 Changed 3 years ago by sjoelund.se

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 Changed 3 years ago by casella

  • Description modified (diff)

comment:5 Changed 3 years ago by perost

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 Changed 3 years ago by casella

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 follow-up: Changed 3 years ago by casella

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 Changed 3 years ago by casella

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

comment:9 in reply to: ↑ 7 Changed 3 years ago by perost

  • Resolution set to fixed
  • Status changed from new to closed

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 follow-up: Changed 3 years ago by casella

  • Cc mwetter 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 Changed 3 years ago by perost

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:12 in reply to: ↑ 10 Changed 3 years ago by perost

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 Changed 3 years ago by casella

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

comment:14 Changed 3 years ago by perost

  • Resolution set to fixed
  • Status changed from reopened to closed

Closing again since the library issue has now been fixed.

comment:15 follow-up: Changed 3 years ago by casella

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

comment:16 in reply to: ↑ 15 Changed 3 years ago by perost

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 Changed 3 years ago by casella

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.