Opened 5 years ago

Closed 5 years ago

#5637 closed defect (fixed)

NFScalarize.scalarize fails with no errors on OpenHPL models

Reported by: Francesco Casella Owned by: Per Östlund
Priority: blocker Milestone: 1.14.0
Component: New Instantiation Version:
Keywords: Cc: Dietmar Winkler, bernt.lie@…

Description (last modified by Francesco Casella)

The OpenHPL library was recently added to the testsuite, see the OF report and the NF report.

There are 15 models failing with the NF that work fine with the OF, see, e.g. OpenHPL.Examples.HPSimple_Francis_GridGen. The function NFScalarize.scalarize fails with

Error: Internal error Instantiation of OpenHPL.Examples.HPSimple_Francis_GridGen
failed with no error message.

@perost, if this is a quick fix it would be nice to have it in 1.14.0, so that those models work with the default NF.

Otherwise please reschedule to 2.0.0

Change History (4)

comment:1 by Francesco Casella, 5 years ago

Description: modified (diff)

comment:2 by Per Östlund, 5 years ago

Possibly fixed in #446.

The issue was in OpenHPL.Waterway.PenstockKP, where the array parameter p_p0 has a rather impressive range expression as its binding equation. When a range used as a binding contains parameters those same parameters usually show up in the variable's dimensions too, e.g. x[N] = 1:N, and thus get marked as structural. In this case there were several parameter used in the range that didn't follow that pattern though, so the NF didn't evaluate the limits of the range and instead defined the range's size in terms of those parameters.

The change I've made is to simply consider parameter ranges to be structural in a model context, so that the NF always evaluates their sizes. There might be some cases where this isn't strictly necessary, but generally we need to know the size of expressions for type checking and scalarization to work properly.

comment:3 by Francesco Casella, 5 years ago

Sounds good!

Let's see the next NF report as soon as Jenkins is finised with the test run.

comment:4 by Francesco Casella, 5 years ago

Resolution: fixed
Status: newclosed

Success!

In fact the model fails later for other reasons, I'll open another ticket about that.

Note: See TracTickets for help on using tickets.