Opened 6 years ago

Closed 6 years ago

#5516 closed defect (fixed)

tableOnFile parameter of a CombiTable2D appears modifiable when using NF

Reported by: massimo ceraolo Owned by: Per Östlund
Priority: normal Milestone: 1.14.0
Component: New Instantiation Version: v1.14.0-dev-nightly
Keywords: Cc:

Description (last modified by massimo ceraolo)

Consider the enclosed "Test.mo" along with "Test.TXT"
The table output should be 1 when tableOnFile is false, 0.5 when it is true.
This is what happens when we simulate.

If, instead, we change the tableOnFile value from the Variables Browser and re-simulate, the table output stays unchanged.

To obtain this behaviour one has to set -d=newInst,nfAPI.
Tested from OMEdit Connected to OpenModelica v1.14.0-dev-26504 (64 bit, Win)

Attachments (4)

Test.mo (1.1 KB ) - added by massimo ceraolo 6 years ago.
Test.txt (70 bytes ) - added by massimo ceraolo 6 years ago.
Untitled.png (132.9 KB ) - added by Adeel Asghar 6 years ago.
Test.mos (77 bytes ) - added by Adeel Asghar 6 years ago.

Download all attachments as: .zip

Change History (17)

by massimo ceraolo, 6 years ago

Attachment: Test.mo added

by massimo ceraolo, 6 years ago

Attachment: Test.txt added

comment:1 by massimo ceraolo, 6 years ago

Component: *unknown*OMEdit
Owner: changed from somebody to Adeel Asghar

comment:2 by Adeel Asghar, 6 years ago

I haven't tested it yet but just guessing if this is the same issue as was reported in #5377.

comment:3 by massimo ceraolo, 6 years ago

Unfortunately not: I've verified that "Evaluate all parameters" is unchecked

by Adeel Asghar, 6 years ago

Attachment: Untitled.png added

by Adeel Asghar, 6 years ago

Attachment: Test.mos added

comment:4 by Adeel Asghar, 6 years ago

It is always a good idea to post the omeditcommunication.log file so we know which flags are used for the simulation.

I tested a bit and for me tableOnFile is not changeable. I also attached a sample script that simulates the model without any flags and then you can see the Test_init.xml file and look for variable combiTable2D1.tableOnFile and attribute isValueChangeable. Note that it is false.

in reply to:  4 comment:5 by massimo ceraolo, 6 years ago

Replying to adeas31:

It is always a good idea to post the omeditcommunication.log file so we know which flags are used for the simulation.

Sorry for this!

In fact, repeating the test here from my home PC I don't see tableOnfile as modifiable. Tomorrow I'll repeat from work and will send you also omeditcommunication.log.
So maybe we will understand what strange setting makes it look as modifiable.

comment:6 by massimo ceraolo, 6 years ago

I've checked.
tableOnFile (wrongly) appears to be modifiable if you set -d=newInst,nfAPI as Additional Translation Flags.

So it is a NF issue: I'm going to change ticket title and description

comment:7 by massimo ceraolo, 6 years ago

Component: OMEditNew Instantiation
Description: modified (diff)
Owner: changed from Adeel Asghar to Per Östlund
Priority: highnormal
Summary: Re-simulate does not modify boolean tableOnFiletableOnFile parameter of a CombiTable2D appears modifiable when using NF

comment:8 by massimo ceraolo, 6 years ago

Description: modified (diff)

comment:9 by Per Östlund, 6 years ago

The tableOnFile parameter is defined as structural by the NF, because it's used as a condition in an if-equation with only parameter expression conditions. So it gets evaluated everywhere in the model. The OF is less consistent in this regard, and evaluates the parameter in some places but not in others. I take it this isn't the issue, but rather that OMEdit shouldn't allow the parameter to be modified if it's structural?

How does OMEdit decide which parameter are modifiable? Does it look at the _init.xml or does it use some API call?

in reply to:  9 ; comment:10 by Adeel Asghar, 6 years ago

Replying to perost:

The tableOnFile parameter is defined as structural by the NF, because it's used as a condition in an if-equation with only parameter expression conditions. So it gets evaluated everywhere in the model. The OF is less consistent in this regard, and evaluates the parameter in some places but not in others. I take it this isn't the issue, but rather that OMEdit shouldn't allow the parameter to be modified if it's structural?

How does OMEdit decide which parameter are modifiable? Does it look at the _init.xml or does it use some API call?

It looks for isValueChangeable attribute value inside _init.xml file.

in reply to:  10 comment:11 by Per Östlund, 6 years ago

Replying to adeas31:

Replying to perost:

The tableOnFile parameter is defined as structural by the NF, because it's used as a condition in an if-equation with only parameter expression conditions. So it gets evaluated everywhere in the model. The OF is less consistent in this regard, and evaluates the parameter in some places but not in others. I take it this isn't the issue, but rather that OMEdit shouldn't allow the parameter to be modified if it's structural?

How does OMEdit decide which parameter are modifiable? Does it look at the _init.xml or does it use some API call?

It looks for isValueChangeable attribute value inside _init.xml file.

Good, tableOnFile has that attribute set to true when using the NF. I'll see if I can figure out where that's coming from and fix it.

comment:12 by Per Östlund, 6 years ago

Fixed in PR #237.

The issue was that the OF kept a BST with all the parameters it marked as structural, and this was used in the "before backend transform" to mark all such parameters as final. The NF has this information available when creating the DAE, so I decided to just cut out the middleman and mark those parameters as final at that stage instead since it's practically free.

This means that structural parameters are now marked as final in the flat model when using the NF, while the OF adds the prefixes immediately after dumping the model. As far as the backend is concerned it's all the same, the only difference is what the users see.

comment:13 by Per Östlund, 6 years ago

Resolution: fixed
Status: newclosed

Fixed in 4c6b5ee.

Note: See TracTickets for help on using tickets.