Package: ert
ertert - Ensemble based Reservoir Tool - is designed for running
ensembles of dynamical models such as reservoir models,
in order to do sensitivity analysis and data assimilation.
ert supports data assimilation using the Ensemble Smoother (ES),
Ensemble Smoother with Multiple Data Assimilation (ES-MDA) and
Iterative Ensemble Smoother (IES).Installation$pipinstallert
$ert--helpor, for the latest development version (requires Python development headers):$pipinstallgit+https://github.com/equinor/ert.git@main
$ert--helpFor examples and help with configuration, see theert Documentation.Developingert was originally written in C/C++ but most new code is Python.Developing PythonYou might first want to make sure that some system level packages are installed
before attempting setup:- pip
- python include headers
- (python) venv
- (python) setuptools
- (python) wheelIt is left as an exercise to the reader to figure out how to install these on
their respective system.To start developing the Python code, we suggest installing ert in editable mode
into avirtual environmentto
isolate the install (substitute the appropriate way of sourcing venv for your shell):# Create and enable a virtualenvpython3-mvenvmy_virtualenvsourcemy_virtualenv/bin/activate# Update build dependenciespipinstall--upgradepipwheelsetuptools# Download and install ertgitclonehttps://github.com/equinor/ertcdert
pipinstall--editable.Test setupAdditional development packages must be installed to run the test suite:pipinstall"ert[dev]"pytesttests/Git LFSmust be installed to get all the files. This is packaged asgit-lfson Ubuntu, Fedora or macOS Homebrew. For Equinor RGS node users, it is possible to usegitfrom Red Hat Software Collections:source/opt/rh/rh-git227/enabletest-data/block_storage is a submodule and must be checked out.gitsubmoduleupdate--init--recursiveIf you checked out submodules without having git lfs installed, you can force git lfs to run in all submodules with:gitsubmoduleforeach"git lfs pull"Style requirementsThere are a set of style requirements, which are gathered in thepre-commitconfiguration, to have it automatically run on each commit do:$pipinstallpre-commit
$pre-commitinstallTrouble with setupIf you encounter problems during install, try deleting the_skbuildfolder before reinstalling.As a simple test of yourertinstallation, you may try to run one of the
examples, for instance:cd test-data/poly_example
# for non-gui trial run
ert test_run poly.ert
# for gui trial run
ert gui poly.ertNote that in order to parse floating point numbers from text files correctly,
your locale must be set such that.is the decimal separator, e.g. by setting# export LC_NUMERIC=en_US.UTF-8in bash (or an equivalent way of setting that environment variable for your
shell).Developing C++C++ is the backbone of ert as in used extensively in important parts of ert.
There's a combination of legacy code and newer refactored code. The end goal is
likely that some core performance-critical functionality will be implemented in
C++ and the rest of the business logic will be implemented in Python.While running--editablewill create the necessary Python extension module
(src/ert/_clib.cpython-*.so), changing C++ code will not take effect even when
reloading ert. This requires recompilation, which means reinstalling ert from
scratch.To avoid recompiling already-compiled source files, we provide thescript/buildscript. From a fresh virtualenv:gitclonehttps://github.com/equinor/ertcdert
script/buildThis command will updatepipif necessary, install the build dependencies,
compile ert and install in editable mode, and finally install the runtime
requirements. Further invocations will only build the necessary source files. To
do a full rebuild, delete the_skbuilddirectory.Note: This will create a debug build, which is faster to compile and comes with
debugging functionality enabled. This means that, for example, Eigen
computations will be checked and will abort if preconditions aren't met (eg.
when inverting a matrix, it will explicitly check that the matrix is square).
The downside is that this makes the code unoptimised and slow. Debugging flags
are therefore not present in builds of ert that we release on Komodo or PyPI. To
build a release build for development, usescript/build --release.NotesIf pip reinstallation fails during the compilation step, try removing the_skbuilddirectory.The default maximum number of open files is normally relatively low on MacOS
and some Linux distributions. This is likely to make tests crash with mysterious
error-messages. You can inspect the current limits in your shell by issuing the
commandulimit -a. In order to increase maximum number of open files, runulimit -n 16384(or some other large number) and put the command in your.profileto make it persist.Running C++ testsThe C++ code and tests requireresdata. As long
as you havepip install resdata'd into your Python virtualenv all should work.# Create and enable a virtualenvpython3-mvenvmy_virtualenvsourcemy_virtualenv/bin/activate# Install build dependenciespipinstallpybind11conancmakeresdata# Build ert and testsmkdirbuild&&cdbuild
cmake../src/clib-DCMAKE_BUILD_TYPE=Debug
make-j$(nproc)# Run testsctest--output-on-failureExample usageBasic ert testTo test if ert itself is working, go totest-data/poly_exampleand start ert by runningpoly.ertwithert guicd test-data/poly_example
ert gui poly.ertThis opens up the ert graphical user interface.
Finally, test ert by starting and successfully running the simulation.ert with a reservoir simulatorTo actually get ert to work at your site you need to configure details about
your system; at the very least this means you must configure where your
reservoir simulator is installed. In addition you might want to configure e.g.
queue system in thesite-configfile, but that is not strictly necessary for
a basic test.