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

changed: only keep keywords in sched_deck if there are actions #4234

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

akva2
Copy link
Member

@akva2 akva2 commented Sep 26, 2024

This becomes very significant with large schedules. This is probably too naive but I want to check fallout.

@akva2
Copy link
Member Author

akva2 commented Sep 26, 2024

jenkins build this please

@akva2 akva2 changed the title changed: only store keywords in sched_deck if there are actions changed: only keep keywords in sched_deck if there are actions Sep 26, 2024
@akva2 akva2 force-pushed the dont_store_sched_deck branch from 5c383e6 to 184885a Compare September 26, 2024 13:20
@akva2
Copy link
Member Author

akva2 commented Sep 26, 2024

jenkins build this please

@akva2
Copy link
Member Author

akva2 commented Sep 27, 2024

jenkins build this opm-simulators=5635 please

Copy link
Member

@bska bska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked at the details here yet, I'll do that later, but I just want to point out that in a restarted simulation run (rst != nullptr) it is possible, though unlikely, that all of the ACTIONX data has been entered prior to the restart step. If we're going with this approach then you might want to add something like

if (!keepKeywords) {
    keepKeywords = !rst->actions.empty();
}

to the if (rst) branch. This includes RstState::actions as one more source of information on whether to keep the input keywords.

@akva2 akva2 force-pushed the dont_store_sched_deck branch from 1fa2021 to 8a77f5b Compare September 27, 2024 12:30
@akva2
Copy link
Member Author

akva2 commented Sep 27, 2024

done.

@akva2
Copy link
Member Author

akva2 commented Sep 27, 2024

jenkins build this opm-simulators=5635 please

1 similar comment
@akva2
Copy link
Member Author

akva2 commented Sep 27, 2024

jenkins build this opm-simulators=5635 please

@blattms
Copy link
Member

blattms commented Sep 30, 2024

I have no overview here, so my question might make no sense.

How does this behave with MULT* in the schedule? We do have tests for this (opm-tests/mult/MULT2D_SCHD?.DATA), but even there the changes are still at the start of the simulation.

@akva2
Copy link
Member Author

akva2 commented Sep 30, 2024

It would not affect it. The normal way the schedule operate is that we

  1. list/copy all the keywords into the ScheduleDeck class.
  2. iterate over the schedule deck and parse the keywords into appropriate classes (well instances with new multipliers applied) for each step. this is done once, before the simulation starts.

Then we can throw away the keywords as everything has been stored in those classes. The exception for this is if there is an action. It will then, once an action triggers, replay the deck keywords starting with the step the action happened.

Thus we only need these keywords IF there are actions that need the replaying when triggered.

@bska
Copy link
Member

bska commented Sep 30, 2024

Does the API change here mean that this must be merged together with the companion PR (i.e., OPM/opm-simulators#5635)?

Copy link
Member

@bska bska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me and should be merged. I'll defer merging, however, until I know if the downstream PR must be merged alongside this PR.

@akva2
Copy link
Member Author

akva2 commented Sep 30, 2024

There is an api change, but as there is a default value corresponding to old behavior it should in theory build separate of the downstream. I did not test that however.

@bska
Copy link
Member

bska commented Oct 1, 2024

there is a default value corresponding to old behavior it should in theory build separate of the downstream

I saw the new default value, but I'm always uneasy when adding new defaulted parameters in the middle of the parameter list.

I did not test that however

Okay, I'll run a build check now to see.

@bska
Copy link
Member

bska commented Oct 1, 2024

jenkins build this please

@bska
Copy link
Member

bska commented Oct 1, 2024

I did not test [if this PR could be merged in isolation] however

Okay, I'll run a build check now to see.

That experiment failed so the two PRs must be merged in concert. Very well, I'll have a look at the other PR as well.

@akva2
Copy link
Member Author

akva2 commented Oct 1, 2024

yeah, i can't resolve that one as it passed values for parameters after the added parameter.

Copy link
Member

@bska bska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reviewed the downstream PR and everything looks good. I'm open to discussing what the default value of keepKeywords should be at the simulator level, but that's a separate issue to having the feature. I'll merge this and its downstream companion PR into the master branch now.

@bska bska merged commit 8cb19e2 into OPM:master Oct 1, 2024
1 check failed
@akva2 akva2 deleted the dont_store_sched_deck branch October 1, 2024 11:19
bska added a commit to bska/opm-common that referenced this pull request Oct 8, 2024
This appears to have been inadvertently missed in commit 8a77f5b
(PR OPM#4234).
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.

3 participants