Customizing the simulation workflow in enkf

From Ert

Jump to: navigation, search


Contents

General overview

The default simulation workflow, or forward model, when using the enkf application, is to run the ECLIPSE 100 reservoir simulator between the requested report steps. However, it may be convenient to change the forward model, for example if:

When using the ERT application, it the forward model can be changed quite easily, and allows for a great deal of flexibility. In principle, it is possible to add any program to the forward model, the only requirement is that it must be callable in batch, i.e. without user interaction. The forward model is defined with the FORWARD_MODEL keyword in the ERT configuration file. The FORWARD_MODEL keyword expects a sequence of strings, referring to jobs that are executed sequentially. These jobs are defined with the INSTALL_JOB keyword in the main configuration file. As explained in Creating a configuration file for ERT, the INSTALL_JOB keyword takes two arguments, a name for the job and the name of a configuration file for the job. A list of already installed jobs can be found in available jobs in ERT.

The INSTALL_JOB configuration file

The configuration file presented to INSTALL_JOB is quite similar to the main configuration file. It is a plain text file, with one statement per line. The first word on each line is a keyword, which then is followed by some data for that particular keyword. Please note the following:

Keywords

STDIN

If your program expects to read from standard input you must redirect stdin. That is done with the STDIN keyword:

Example:

  -- Re-direct standard input.
  STDIN my_program.stdin

Observe that when you are redirecting standard input the file you are redirecting from must exist when the job starts, i.e. if your program does not expect to read from standard input you should not redirect it with the STDIN keyword.

STDOUT

The keyword STDOUT is used to re-direct the standard output to a file. Observe that if you do not set STDOUT, it takes the default value /dev/null and everything written to stdout by the program is lost.

Example:

  -- Re-direct stdout.
  STDOUT my_program.stdout
STDERR

The keyword STDERR is used to re-direct the standard error stream to a file.

Example:

  -- Re-direct the standard error stream.
  STDERR my_program.stderr
TARGET_FILE

This is the name of a file which the external program should produce. When the external program is complete the job_script checks if this file has indeed been produced, and exits with failure if the file can not be found.

Example:

  -- Set the target file
  TARGET_FILE my_program_output_<IENS>.txt
EXECUTABLE

This is the name of the program to run, it can either be a full path, or just the name of a binary. In the latter case the PATH variable of the user is consulted to locate the executable. Observe that it is assumed that the same executable can be invoked on all platforms, in the case of binary applications in a heterogenous cluster EXECUTABLE must point to a portable script, which will subsequently execute the correct binary.

  -- Set the name of the program
  EXECUTABLE my_program.exe


ENV

The ENV keyword can be used to set environmental variables. It takes two arguments, the environment variable and the value to set.

Example:

  -- Setting up the environment for the job.
  ENV   LM_LICENSE_FILE   1700@osl003lic.hda.hydro.com
  ENV   LD_LIBRARY_PATH   /some/funny/lib/path:$LD_LIBRARY_PATH
ARGLIST

The ARGLIST keyword is used to give a list of arguments to the executable.

Example:

  -- Set some flags
  ARGLIST -ia -some_option <RESTART_FILE2>


Magic strings

Since the data for the keywords in the INSTALL_JOB configuration file (e.g. the input for the program to be executed) often will be a function of the ECLIPSE base name, the realization number, the report steps etc., a set of magic strings are provided. These a replaced when the job is submitted, e.g. <IENS> will be replaced with 0 for realization number 0, 1 for realization number 1 and so on.

Magic string Replaced with
<RESTART_FILE1> The name of the restart file this simulation is starting from.
<RESTART_FILE2> The name of the restart file this simulation should end up with.
<SMSPEC_FILE> The name of the SMSPEC file for this simulation.
<REPORT_STEP1> The report step we are starting from - without leading zeroes.
<REPORT_STEP2> The report step we are simulating to - without leading zeroes.
<ECLBASE> The ECLIPSE base name of this simulation.
<IENS> The realization number of this simulation - without leading zeroes.
<IENS4> The realization number of this simulation formatted as a four digit number - with leading zeroes.

The set of magic strings can easily be extended upon request.

Example

The following INSTALL_JOB configuration file is used for ECLIPSE100.

STDIN     eclipse.stdin
STDERR    eclipse.stderr
STDOUT    eclipse.stdout 
TARGET_FILE <RESTART_FILE2>

EXECUTABLE            /ERT/Scripts/run_eclipse.py
ENV  F_UFMTENDIAN     big
ENV  LM_LICENSE_FILE  *********

Passing arguments to the job

In addition to the magic strings mentioned above you can insert your own magic string enclosed in '<' and '>' in the job description file. These strings can then either be provided with DATA_KW command, or by using KEY = VALUE in the spesification of the forward model. The following INSTALL_JOB configuration file used to copy a file, illustrates this:

PORTABLE_EXE  /bin/cp
ARGLIST       <FILE> <STORAGE_PATH>  

In the following configuration file the STORAGE_PATH variable is set with the DATA_KW argument, and the FILE argument is set when the job is specified in the FORWARD_MODEL>:

...
DATA_KW         <STORAGE_PATH>  /some/path/where/I/store/results
FORWARD_MODEL   ECLIPSE100      COPY_FILE(<FILE> = file1.txt)  COPY_FILE(<FILE> = <ECL_BASE>.SMSPEC)
...
Personal tools
Namespaces
Variants
Actions
Navigation
Download code
Support
Toolbox