[Opm] Suggestion: new debug configuration

Joakim Hove joakim.hove at opm-op.com
Thu Jun 3 08:39:35 UTC 2021


Fellow opm'ers;

we would like to suggest a new system for controlling and configuring 
debug information. The plan consists of both a change affecting the end 
users with a new keyword - e.g. DEBUGF - and updates to the code at 
callsites.

_
_

_Keyword DEBUGF_

The new keyword should be modelled after e.g the RPTSHCED keyword with 
use of mnemonics:


    RUNSPEC

    DEBUGF

         INIT=1 /

    ...

    SCHEDULE

    -- Turn on the PVT debugging (default level)

    DEBUGF

        PVT /


    DATES

       10 'MAI' 2020 /


    -- Turn on maximum debugging of wells, debug level 1 for groups and
    turn off the PVT debugging.

    DEBUGF

         WELL=3 GROUP=1 PVT=0 /


    DATES

        20 MAI 2020 /


    -- Turn off all debugging

    DEBUGF

    /


Some points/thoughts:

 1. As indicated the keyword can be both in RUNSPEC section and the
    SCHEDULE section - the latter is important to turn debugging on and off.
 2. The set of mnemonics is quite relaxed - this should be developer
    centric and it should be simple to add more mnemonics.
 3. In the default configuration with no DEBUGF keyword in the deck the
    .DBG output file should be empty.
 4. ...


_Changes to code:
_

The DEBUGF keyword should be internalized to datastructure looking 
something like this:

    struct DebugConfig {

          int well_debug = 0;

          int group_debug = 0;

          pvt_debug = 0;

         ....

    };

Such DebugConfig reference should be passed around in the simulator (and 
other places), and then every debug call  should be protected in C++ 
code as:

    if (debug_config.well_debug > 0) {

          OpmLog::debug("The wells are difficult today");

          if (debug_config.well_debug > 3)

              OpmLog::debug( lots_of_details_about_problematic_well );

    }


Observe that:

 1. The actual printing to the debug file will still be handled with
    OpmLog::debug() calls.
 2. The system with DebugConfig will add to the debug configuration from
    OpmLog - maybe not 100% logical but hopefully not too bad.


Bring on the critque and suggestions!


Joakim








__

__






-- 
OPM-OP AS
Heyerdahlsvei 12b, 0777 Oslo, Norway
Joakim Hove
CEO
T: +47 92 68 57 04
E: joakim.hove at opm-op.com



More information about the Opm mailing list