equinor / semeio

Semeio is a collection of jobs and workflow jobs used in ert (https://github.com/equinor/ert).
https://github.com/equinor/semeio
GNU General Public License v3.0
10 stars 27 forks source link

AHM_ANALYSIS: Doesn't support DUNIF distributions, several attempts to run the workflow failed #546

Closed hnformentin closed 11 months ago

hnformentin commented 1 year ago

Describe the bug I asked for support (and some others also did) for AHM_ANALYSIS workflow a couple of times in #ert-users with no concrete help, but I think it needs some maintenance/testing because it is not running on the model I am working on.

(1) First I had an uncertain parameter as DUNIF, which seems not to be supported (and if this is correct, I think the info should be add it in the documentation). (2) Secondly I run a new case without the parameter that was DUNIF and added HOOK_WORKFLOW AHM_ANALYSIS PRE_UPDATE. The case went through. The problem was that the files generated were only 3 bytes and webviz did not display anything. I read a recommendation on wiki to use "POST_SIMULATION" instead of PRE_UPDATE, but I think it should not make any difference. (3) Then I used the case from (2) and tried to run the AHM_ANALYSIS workflow manually through the gui "Run workflow". I got an error message in the terminal "Processing: WOPT_F20K Processing: WGPT_F20K Processing: WWPT_F20K The script 'AhmAnalysisJob' caused an error while running: 'GLOBVAR:FWL_LN_ON'" But the ert log does't show any more than "2023-10-24 16:10:36,762 - ert.job_queue.workflow_runner - ThreadPoolExecutor-0_0 - ERROR - Workflow job AHM_ANALYSIS failed"

Some resources I have read: AHM_ANALYSIS workflow (https://fmu-docs.equinor.com/docs/ert/reference/workflows/added_workflow_jobs.html#AHM_ANALYSIS) and a plugin to visualize results in webviz (https://equinor.github.io/webviz-subsurface/#/webviz-subsurface?id=assistedhistorymatchinganalysis). Some more documentation about it can be found on wikie: FMU Wiki Portal - Equinor Enterprise Wiki

To Reproduce Use an uncertain parameter with DUNIF, contact me to run the case I am running if needed.

Expected behavior AHM_ANALYSIS workflow to work

Screenshots

"GLOBVAR": [{"key": "FAULTSEAL_ALTERNATIVE", "function": "DUNIF", "parameters": {"STEPS": 3.0, "MIN": -1.0, "MAX": 1.0}}

dafeda commented 1 year ago

I have never used AHM_ANALYSIS before so I think it's helpful for me to try and run it on the poly-case.

Here are the modifications I did to the poly-case:

I get the following warnings when running ES using this modified poly-case:

(.venvfmu) ➜  poly_example git:(ahm_analysis_poly) ert gui poly.ert 
Processing: POLY_RES
/Users/FCUR/git/semeio/semeio/workflows/ahm_analysis/ahmanalysis.py:208: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '0 active/4' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  active_obs.at["ratio", group_name] = (
/Users/FCUR/git/semeio/semeio/workflows/ahm_analysis/ahmanalysis.py:404: UserWarning: WARNING: no MISFIT value for observation POLY_RES
  warnings.warn("WARNING: no MISFIT value for observation " + obs_keys)
Processing: POLY_RES
/Users/FCUR/git/semeio/semeio/workflows/ahm_analysis/ahmanalysis.py:208: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '0 active/4' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  active_obs.at["ratio", group_name] = (
/Users/FCUR/git/semeio/semeio/workflows/ahm_analysis/ahmanalysis.py:404: UserWarning: WARNING: no MISFIT value for observation POLY_RES
  warnings.warn("WARNING: no MISFIT value for observation " + obs_keys)

This produces the folder reports with the following file-structure:

reports
└── poly
    ├── default
    │   └── AhmAnalysisJob
    │       ├── POLY_RES.csv
    │       ├── active_obs_info.csv
    │       ├── ks.csv
    │       ├── misfit_obs_info.csv
    │       ├── prior.csv
    │       └── workflow-log.txt
    └── default_smoother_update
        └── AhmAnalysisJob
            ├── POLY_RES.csv
            ├── active_obs_info.csv
            ├── ks.csv
            ├── misfit_obs_info.csv
            ├── prior.csv
            └── workflow-log.txt

I have not tried running webviz, but the .csv files in the reports folder seem to contain somewhat resonable content.

  1. Is my set-up reasonable? Here's a draft pull request that contains the modifications I've made to the poly-case: https://github.com/equinor/ert/pull/6487
  2. If my set-up is reasonable, would you expect it to fail given that I am using DUNIF together with AHM_ANALYSIS here?
hnformentin commented 1 year ago

Thanks for picking the issue. Your set-up seems reasonable and I would not expect it to fail. Good that it did not! My setup was similar to yours but it did :-( Differences:

As I mentioned above, removing the DUNIF parameter made the workflow go through, but the files were empty.

I will share with you the path with the reports, in case this can be useful to check the logs.

For info, there is another issue related to the workflow in fmu-drogon, maybe more experienced users are there. https://github.com/equinor/fmu-drogon/issues/11

Roger helped me to find out that removing the DUNIF parameter could help. Maybe he has some additional insight about this from other cases.

dafeda commented 1 year ago

I re-ran with PRE_UPDATE instead of POST_SIMULATION and got the same result.

dafeda commented 1 year ago

Moving this to backlog since I am not able to reproduce it locally. We can look at this again if more users start reporting similar issues.

dafeda commented 11 months ago

Closing for now as we don't know if this really is an issue.