Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#6407 closed defect (fixed)

The new OpenModelica compiler frontend

Reported by: toheed.ghandriz@… Owned by: Per Östlund
Priority: blocker Milestone: 1.17.0
Component: New Instantiation Version: 1.16.2
Keywords: Cc: arunkumar.palanisamy@…

Description

Hello,

It is unclear for us why we need to switch to the old frontend for compiling our code. It does not work otherwise.
In the attached code please run for example "OpenPBS.Manoeuvres.Longitudinal.mo"
or other midels in "OpenPBS.Manoeuvres". (I was not able to attach the code here, please contact us!)
The problem is seen in OpenModelica v1.17.0-dev.beta3 (64-bit) and v1.16.2.

Regards,
Toheed Ghandriz

Attachments (1)

OpenPBS.zip (172.2 KB ) - added by toheed.ghandriz@… 4 years ago.
a zip file containing the example library.

Download all attachments as: .zip

Change History (11)

by toheed.ghandriz@…, 4 years ago

Attachment: OpenPBS.zip added

a zip file containing the example library.

comment:1 by Francesco Casella, 4 years ago

Component: FrontendNew Instantiation
Milestone: NeedsInput1.18.0
Priority: normalblocker

The package is invalid, there is no package.mo file in the Manoeuvres director. Can you please fix that first?

comment:2 by Per Östlund, 4 years ago

Fixed in PR 7276.

The issue was due to a pattern like this:

model M
  parameter Boolean b[2];
equation
  for i in 1:size(b, 1) loop
    if i == 1 then
      if b[i + 1] == false then
        ...
      end if;
    end if;
  end for;
end M;

We flattened the if-equations in a depth-first manner, leading to the frontend trying to evaluate b[3] and failing since b only has two elements. The fix was trivial, just don't flatten equations in if-branches that are discarded.

Replying to casella:

The package is invalid, there is no package.mo file in the Manoeuvres director. Can you please fix that first?

It's fine, it just needs an empty package to work.

comment:3 by Per Östlund, 4 years ago

Seems Jenkins is broken once again, so the PR won't be merged for a while.

comment:4 by Per Östlund, 4 years ago

Resolution: fixed
Status: newclosed

The PR is now merged in c048acb.

comment:5 by Francesco Casella, 4 years ago

@perost, thanks for the quick fix. Can we port it safely to maintenance/1.17, so it will already be available in 1.17?

in reply to:  5 comment:6 by Per Östlund, 4 years ago

Replying to casella:

@perost, thanks for the quick fix. Can we port it safely to maintenance/1.17, so it will already be available in 1.17?

Yes, it should be safe since the fix was just to not flatten equations that were immediately discarded anyway. We should of course wait for the test results, but I can't see how this could break anything.

comment:7 by Francesco Casella, 4 years ago

OK, let's wait for tomorrow's library testsuite results.

comment:8 by Per Östlund, 4 years ago

The test results didn't show any changes, so I made PR 7278 to port it to maintenance/1.17.

comment:9 by arunkumar palanisamy, 4 years ago

@perost, Thanks Per for the fix, The OpenPbs library should now work with the new front end

Last edited 4 years ago by arunkumar palanisamy (previous) (diff)

comment:10 by Francesco Casella, 4 years ago

Milestone: 1.18.01.17.0
Note: See TracTickets for help on using tickets.