Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse dependencies improvements #10

Open
chria opened this issue Jun 2, 2021 · 4 comments
Open

Reverse dependencies improvements #10

chria opened this issue Jun 2, 2021 · 4 comments
Labels
OCT OPTIMICA Compiler Toolkit performance New feature or request
Milestone

Comments

@chria
Copy link
Collaborator

chria commented Jun 2, 2021

Event indicators with reverse dependencies on derivatives when the effect is actually to modify the variable. This can cause extra QSS work and prevents QSS from exploiting information about whether the change is to a derivative or value for efficiency in the future.

BouncingBall: has reverse dependencies on der(v) and der(h) when a single reverse dependency on v would suffice
EventIndicator2: the event indicator has a reverse dependency is on der(x) but it would be more accurate if it were on x since the action of the when clause is reinit(x,1)

Some models have a number of event indicators with no reverse dependencies. If these are not relevant to states/simulation they could be omitted. Otherwise, it is worth checking that needed reverse dependencies aren't missing due to variable "short-circuiting".

Case600
Case600FF
SimpleHouseDiscreteTime
TwoFloor_TwoZone
A number of others...

@chria chria added performance New feature or request OCT OPTIMICA Compiler Toolkit labels Jun 2, 2021
@DeadParrot DeadParrot changed the title Reserve dependencies improvements Reverse dependencies improvements Jun 9, 2021
@DeadParrot
Copy link
Collaborator

DeadParrot commented Jun 10, 2021

Versions

The issue was observed with these component versions (may occur with others):

Component Version Date
OCT OCT-r23206_JM-r14295 2021/05
Buildings 9c37781 2021/05/04
QSS e4a0f62 2021/06/08

Build

Build the FMU with bld from the OCT directory as described in the Status page.

The dependencies can be examined in the modelDescription.xml file.

@mwetter mwetter added this to the 0.0.1 milestone Aug 18, 2021
@DeadParrot
Copy link
Collaborator

In the ACControl10 model all the event indicators have the same 10 reverse dependencies on the derivatives of all 10 elements of the th[] temperature vector. The 20 event indicators for the temperature-triggered AC on/off when statements should each have a reverse dependency on only its own der(th[i]) since it alters the on[i] vector element:

der(th[i]) = ( THA - th[i] ) / ( RES[i] * CAP[i] ) - ( POT[i] * on[i] ) / CAP[i];

The unnecessary reverse dependencies are a performance/scalability problem.

@DeadParrot
Copy link
Collaborator

Parts of this issue may be solved by the use of the new OCT option that adds a <Dependencies> annotation section to the modelDescription.xml and it will be updated as testing progresses with the new OCT and related QSS update.

@DeadParrot
Copy link
Collaborator

With the OCT dev build OCT-dev-cw-5212-18478f3488ff1272c52222a29d72215983eadeec QSS is using the new <Dependencies> section for dependencies and the BouncingBall and EventIndicator2 "reverse" dependencies are as preferred.

Until other specific "reverse" dependency issues are identified I am moving this to the Future Milestone.

@DeadParrot DeadParrot modified the milestones: 0.0.1, Future Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCT OPTIMICA Compiler Toolkit performance New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants