-
Notifications
You must be signed in to change notification settings - Fork 114
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
Activate WELPI and WPIMULT for use in Pyaction #4136
Activate WELPI and WPIMULT for use in Pyaction #4136
Conversation
jenkins build this opm-simulators=5467 opm-tests=1193 please |
1 similar comment
jenkins build this opm-simulators=5467 opm-tests=1193 please |
This PR contains the WELPI kw (#4133) and also WPIMULT, same for other two PRs OPM/opm-simulators#5467 and OPM/opm-tests#1193. |
084a4e4
to
b44105e
Compare
jenkins build this opm-simulators=5467 opm-tests=1193 please |
1 similar comment
jenkins build this opm-simulators=5467 opm-tests=1193 please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I am wondering is the lifetime of the member of wellPIMap
. Please elaborate a bit.
It is a member, Yet it seems to be used only as a temporary.
dce741f
to
f641a36
Compare
jenkins build this opm-simulators=5467 opm-tests=1193 please |
@blattms: I've updated the description, also we can discuss if this really is the best approach before merging! Thanks! |
jenkins build this opm-simulators=5467 opm-tests=1193 please |
benchmark please |
No realize that this benchmark will not work as it needs the other branches. I'll try with the correct repos, but I don't know whether the cases tested even use ACTIONX/PYACTION. |
benchmark opm-simulators=5467 opm-tests=1193 please |
Benchmark result overview:
View result details @ https://www.ytelses.com/opm/?page=result&id=2545 |
Hm.. the main change performance-wise is that instead of fetching the well productions indices for each action per step, we fetch those now once per step (only if there are pending actions or pyactions, if there are no actions, we don't fetch anything at all). |
Let's rerun. A serial run should not be affected by this. |
benchmark opm-simulators=5467 opm-tests=1193 please |
2851055
to
32bde2e
Compare
jenkins build this opm-simulators=5467 opm-tests=1193 please |
@blattms: what is the further plan with this? |
32bde2e
to
af89438
Compare
jenkins build this opm-simulators=5467 please |
benchmark opm-simulators=5467 please |
af89438
to
8494806
Compare
jenkins build this opm-simulators=5467 please |
2 similar comments
jenkins build this opm-simulators=5467 please |
jenkins build this opm-simulators=5467 please |
eea26f0
to
16de16f
Compare
jenkins build this opm-simulators=5467 please |
I haven't looked at the details here, I'll do that later, but I would really prefer that we not add the proposed data member since the |
Yes, I know this is not ideal, yet I need to communicate back the well production indices back to the Schedule.
Hence, my approach was to give a map containing all PI values to the Schedule before the Pyactions and ActionX's get executed, then also this map does not need to be passed around in all applyAction functions like before. It might also be a (possibly wiser) option to move all the Pyaction/Python classes to opm-simulators and make them aware of the ActionHandler, yet I have not estimated other implications this would have, since it's a rather large change. |
16de16f
to
efc8094
Compare
jenkins build this opm-simulators=5467 please |
@bska: How do you suggest to move on with this? Thanks! |
…the WELPI keyword and not only for ActionX but also for Pyaction
This indicates that the 'handleWELPIRuntime' instead of 'handleWELPI' function should be used when inserting the keyword WELPI from a PyAction
…d function This is not needed anymore, since welpi_action_mode is an attribute of the Schedule.
This is set in the ActionHandler. Use the wellPIMap when calling handleKeyword in the applyKeywords function.
…ion function Instead, use the wellPIMap of the Schedule Object
… needed anymore now
efc8094
to
075feb8
Compare
jenkins build this opm-simulators=5467 please |
As a side effect, this makes every action more expensive since this means unconditionally computing information that's needed only if the action involves
To be honest, I actually like the separate argument. It makes the separation between static and dynamic information more explicit. By putting the current PIs into the
How does the current PyAction system work? Most of the examples in opm-tests/pyaction appear to go through one of the |
Closing as the alternative was merged |
To activate the WELPI keyword for the use in a PyAction, I had to add a way of communicating the old well production indices from the ActionHandler (i.e. the Well Model) back to the Schedule. For this, I have added the function setWellPIMap to the Schedule object, setting the attribute m_wellPIMap, a std::unordered_map<std::string, double>, of the Schedule . This map is set from the Action Handler before pending PyActions are executed.
Then, to further simplify the code, I have removed this map from the arguments of the handleKeyword, applyAction and iterateScheduleSection (there it was called target_wellpi), since these functions can now use the m_wellPIMap.
Then, I have removed a call that was done before for each ActionX: This call fetched such a map for the matching wells of each ActionX, but now, since we have the m_wellPIMap, these calls are not needed anymore.
It would be interesting to have a benchmark for this, possibly time and memory wise.
For the reference manual: With this PR and OPM/opm-simulators#5467, the keywords WELPI and WPIMULT can be used in the "insert keywords"-function in Pyaction.