-
Notifications
You must be signed in to change notification settings - Fork 130
introducing GroupTarget struct for SingleWellState #6654
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
base: master
Are you sure you want to change the base?
Conversation
|
jenkins build this please |
|
could not reproduce the failure. mpi.compareECLFiles_flow+02-WGRUPCON will try again. |
|
jenkins build this failure_report please |
|
Locally, the PR did not introduce residual difference for the case Somehow it looks there is small difference from this PR while it not big enough to be visible. |
Very strange, you haven't introduced anything here that should change the results? |
One thing that this pull request changes is that the comparison operator for the bool operator==(const GroupTarget& other) const {
return ( group_name == other.group_name
&& target_value == other.target_value
&& production_cmode == other.production_cmode
&& injection_cmode == other.injection_cmode );
} |
1a23d6f to
80e4f79
Compare
|
jenkins build this failure_report please |
The new test results show it might not be due to this. |
|
jenkins build this failure_report please |
|
removing other members from |
|
jenkins build this failure_report please |
80d910d to
f540381
Compare
|
jenkins build this please |
f540381 to
a5b6685
Compare
|
jenkins build this please |
1 similar comment
|
jenkins build this please |
|
recovered the regression. putting here for record. static GroupTarget injectionGroupTarget(const std::string& gname,
Group::InjectionCMode cmode,
Scalar value) {
+ std::cout << "Creating injection group target for group " << gname
+ << " with cmode " << Group::InjectionCMode2String(cmode)
+ << " (Int: " << static_cast<int>(cmode) << ")"
+ << " and value " << value << std::endl;
return {gname, Group::ProductionCMode::NONE, cmode, value};
}
static GroupTarget productionGroupTarget(const std::string& gname,
Group::ProductionCMode cmode,
Scalar value) {
+ std::cout << "Creating produduction group target for group " << gname
+ << " with cmode " << Group::ProductionCMode2String(cmode)
+ << " (Int: " << static_cast<int>(cmode) << ")"
+ << " and value " << value << std::endl;
return {gname, cmode, Group::InjectionCMode::NONE, value};
} |
a5b6685 to
08d7c3b
Compare
|
jenkins build this please |
08d7c3b to
cff6970
Compare
|
jenkins build this please |
|
cff6970 fixes the regression. It appears that using -> or (*) for a std::optional will not trigger an exception if the std::optional is std::nullopt. it might be safer to use .value(). |
2740766 to
a532a02
Compare
|
jenkins build this please |
steink
left a comment
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.
To me it would be good to get this in, since I need a slightly extended version of it in an upcomping PR. So since this part is just a refactorization, I am very much in favour of merging.
bska
left a comment
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.
I think this is good for the most part, but I'd like some additional information–and ideally some Doxygen-style documentation–about the data members of the new type.
| }; | ||
|
|
||
| struct GroupTarget { | ||
| std::string group_name; |
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.
The group_name member appears to be unused. Is that intentional?
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.
Basically, nothing in this PR is used in the master branch. It is more about helping other development. Maybe it should go in with other development that actually needs the content in this PR? Please just suggest.
| struct GroupTarget { | ||
| std::string group_name; | ||
| Group::ProductionCMode production_cmode {Group::ProductionCMode::NONE}; | ||
| Group::InjectionCMode injection_cmode {Group::InjectionCMode::NONE}; |
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.
Might you need one injection control mode for each phase, or at least a way to associate this "target" to a specific injection phase?
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.
| template<class Serializer> | ||
| void serializeOp(Serializer& serializer) { | ||
| serializer(group_name); | ||
| serializer(production_cmode); | ||
| serializer(injection_cmode); | ||
| serializer(target_value); | ||
| } |
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.
Why do you need this function?
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.
not totally sure, actually, i thought it is standard.
what types of data structure need its own serializeOp function? or your question is rather about something else? Thanks.
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 types of data structure need its own
serializeOpfunction?
Mostly those that use object serialisation for broadcasting from the MPI I/O rank to other MPI ranks. This function is the underpinning of the object distribution process from loading the model from a .DATA file to starting the actual simulation in parallel but as long as there's no type of MPI communication for the type then we don't really need a serializeOp() member function.
PR #5338 muddies the water a little bit as it uses the object serialisation protocol to collect data onto the I/O rank instead of distributing from the I/O rank, but as I said for the most part we don't really need per-type serializeOp() functions in opm-simulators.
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.
When @steink compiles on his computer, it looks like this part might be needed, possible related to HDF5 support.
a532a02 to
7852484
Compare
7852484 to
7e6527e
Compare
so it can record the group name that results the group target, the group control mode (either injecting or producing) of the group, and also the target value enforced to this well.
|
I suggest this PR go in with other development that actually uses it, so it is easier to evaluate. |
|
jenkins build this please |
|
https://ci.opm-project.org/job/opm-simulators-PR-builder/9194/ jenkins also shows that we need the serializeOp function. I do not have HDF5 support enabled, so it was not spotted. |
PRs #6596 and #6545 call for more information through the
SingleWellState::group_target.Introducing a dedicated struct can be one way to make it easier to extend.
In its current form, we are not using the extension for now. It will be potentially used by other PRs like #6596 and #6545 , or debugging purposes.
not sure it is strong argument to get this PR in with its current form.