Skip to content

State Sync + Simulation Performance#372

Draft
lukelowry wants to merge 1 commit intodevelopfrom
lukel/ida-interface-dev
Draft

State Sync + Simulation Performance#372
lukelowry wants to merge 1 commit intodevelopfrom
lukel/ida-interface-dev

Conversation

@lukelowry
Copy link
Copy Markdown
Collaborator

Description

In my feature branch, where I have larger models with more signals, I was running into some strange state synchronization issues between the machine, exciter, and bus. I noticed that Ida.cppand SystemModel.hpp seem to pass state in a different order, fixing the inter-model issues I had. Ida stopped failing during fault events in a 240-Bus case I am constructing, and it reduced the solve time by ~3x across all examples.

I'm not sure why this has such a big impact on performance, or whether it's related to my build configuration. Worth looking at because GK now simulates faster than PowerWorld for my machine on this branch, but not on the develop branch.

Example of change

Before

  model->updateTime(tres, 0.0);
  copyVec(yy, model->y());
  copyVec(yp, model->yp());

After (i.e., share state before invoking so it's not stale)

  copyVec(yy, model->y());
  copyVec(yp, model->yp());
  model->updateTime(tres, 0.0);

Closes #(issue)

Mentions @(user)

Proposed changes

Describe how your changes here address the issue and why the proposed changes
should be accepted.

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask. We're here
to help! This is simply a reminder of what we are going to look for before
merging your code.

  • All tests pass.
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows GridKit™ style guidelines.
  • There are unit tests for the new code.
  • The new code is documented.
  • The feature branch is rebased with respect to the target branch.
  • I have updated CHANGELOG.md to reflect the changes in this PR. If this is a minor PR that is part of a larger fix already included in the file, state so.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining
why you chose the solution you did and what alternatives you considered, etc...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant