Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@blattms
Copy link
Member

@blattms blattms commented Nov 12, 2024

Previously we threw an exception that was poorly handled by the logging system. The user e.g. saw:

Reading from: BLA.INC line 2

Error: An error occurred while creating the reservoir schedule
Internal error: input IJK index above valid range

Error: Unrecoverable errors while loading input: input IJK index above valid range

With this commit we use the ParseContext to give a more meaningful error message like:

Error: Problem with COMPDAT in ACTIONX
In BLA.INC line 19
Cell (83, 273, 47) of well EX_WA is not part of the grid (Input IJK index (83, 273, 47) not part of grid with dimensions 169x359x46.).

Error: Problem with keyword COMPDAT
In BLA.INC line 19
Problem with COMPDAT in ACTIONX
In BLA.INC line 19
Cell (83, 273, 47) of well EX_WA is not part of the grid (Input IJK index (83, 273, 47) not part of grid with dimensions 169 x 359 x 46.).

Error: Unrecoverable errors while loading input: Problem with keyword COMPDAT
In BLA.INC line 19
Problem with COMPDAT in ACTIONX
In BLA.INC line 19
Cell (83, 273, 47) of well EX_WA is not part of the grid (Input IJK index (83, 273, 47) not part of grid with dimensions 169 x 359 x 46.).

"Input index above valid range" might not ring any bells.
Now we include information about the index and the expected range.
Previously we threw an exception that was poorly handled by the loggin
system. The user e.g. saw:
```
Reading from: BLA.INC line 2

Error: An error occurred while creating the reservoir schedule
Internal error: input IJK index above valid range

Error: Unrecoverable errors while loading input: input IJK index above valid range
```
With this commit we use the ParseContext to give a more meaningful error message like:
```
Error: Problem with COMPDAT in ACTIONX
In BLA.INC line 19
Cell (83, 273, 47) of well EX_WA is not part of the grid (Input IJK index (83, 273, 47) not part of grid with dimensions 169x359x46.).

Error: Problem with keyword COMPDAT
In BLA.INC line 19
Problem with COMPDAT in ACTIONX
In BLA.INC line 19
Cell (83, 273, 47) of well EX_WA is not part of the grid (Input IJK index (83, 273, 47) not part of grid with dimensions 169x359x46.).

Error: Unrecoverable errors while loading input: Problem with keyword COMPDAT
In BLA.INC line 19
Problem with COMPDAT in ACTIONX
In BLA.INC line 19
Cell (83, 273, 47) of well EX_WA is not part of the grid (Input IJK index (83, 273, 47) not part of grid with dimensions 169x359x46.).

```
@blattms
Copy link
Member Author

blattms commented Nov 12, 2024

jenkins build this please

@blattms
Copy link
Member Author

blattms commented Nov 12, 2024

Note that we might not give such nice error outside of ACTIONX for well stuff...

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.

On the one hand, it's always good to give better diagnostics. On the other hand, we arguably should never throw from a function that explores the possible future connections without knowing if these connections materialise. At least I'd prefer if we made the action be InputErrorAction::WARN instead of throwing an exception in the context of prefetching potential future connections.

@blattms
Copy link
Member Author

blattms commented Nov 12, 2024

I think this something that the current users should decide.

The decision is basically between whether we should fail fast because a keyword does obviously not make sense as is or risk to run a simulation for hours in the hope that in ACTION never becomes executed to then realize the next morning the simulation was aborted....

If course we can warn and ignore these problems in the running simulation.

Anyway, I also want to check how the simulator behaves for such problems outside of ACTIONX. Marking this as WIP, therefore.

@blattms blattms marked this pull request as draft November 12, 2024 15:02
@bska
Copy link
Member

bska commented Nov 12, 2024

If course we can warn and ignore these problems in the running simulation.

Yeah...I'm conflicted. If the parsing mode is strict I want to know about these things, but for "normal" I think I'd prefer a warning and that connections outside the model just be ignored. For "low" such connections might just be silently ignored altogether.

@blattms
Copy link
Member Author

blattms commented Nov 12, 2024

BTW We also have problematic behavior if such problems appear outside ACTIONX (modifying SPE1CASE2) parsing aborts prematurely with

Error: Problem with keyword COMPDAT
In SPE1CASE2_BAD.DATA line 394
Internal error: Input IJK index (10, 10, 4) not part of grid with dimensions 10x10x3.

Error: Problem with keyword COMPDAT
In SPE1CASE2_BAD.DATA line 394
Internal error: Input IJK index (10, 10, 4) not part of grid with dimensions 10x10x3.

Error: Unrecoverable errors while loading input: Problem with keyword COMPDAT
In SPE1CASE2_BAD.DATA line 394
Internal error: Input IJK index (10, 10, 4) not part of grid with dimensions 10x10x3.

Note that the error message is at least improved with this PR (previously: "Internal error: input IJK index above valid range").

@bska
Copy link
Member

bska commented Nov 12, 2024

parsing aborts prematurely with [a diagnostic]

And that's arguably a bug in ScheduleGrid. ScheduleGrid could decide that those connections will never be active, issue a warning, and then just ignore them.

@blattms blattms marked this pull request as ready for review November 13, 2024 07:20
@blattms
Copy link
Member Author

blattms commented Nov 13, 2024

I am undrafting this as it is a real improvement to the current situations for usersand does not change the behavior of the simulator. Therefore this should be merged.
The behavior of the simulator will be discussed with others and changed accordingly if necessary.

@bska
Copy link
Member

bska commented Nov 13, 2024

I am undrafting this as it is a real improvement to the current situations for users and does not change the behavior of the simulator. Therefore this should be merged.

Okay, fair enough.

The behavior of the simulator will be discussed with others and changed accordingly if necessary.

Cool. I'll merge into master.

@bska bska merged commit 46573fe into OPM:master Nov 13, 2024
1 check passed
@blattms
Copy link
Member Author

blattms commented Nov 13, 2024

Thanks. Highly appreciated.

@atgeirr
Copy link
Member

atgeirr commented Nov 13, 2024

The decision is basically between whether we should fail fast because a keyword does obviously not make sense as is or risk to run a simulation for hours in the hope that in ACTION never becomes executed to then realize the next morning the simulation was aborted....

If course we can warn and ignore these problems in the running simulation.

About this, the consensus seems to me that we should fail fast here. Is that what we are doing now, or are more changes required for that?

@blattms
Copy link
Member Author

blattms commented Nov 13, 2024

We are currently failing as soon as possible, i.e. when parsing the SCHEDULE for the very first time.

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