Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple OPM Flow From Libecl #1107

Merged
merged 9 commits into from Oct 17, 2019
Merged

Decouple OPM Flow From Libecl #1107

merged 9 commits into from Oct 17, 2019

Conversation

bska
Copy link
Member

@bska bska commented Oct 15, 2019

This PR adds a very rudimentary time-service protocol in opm/common/utility. It is just sufficient to replace various time-related utility functions used from libecl. We get a substantial reduction in available time range (down to about 292 years on my Ubuntu system, although this depends on chrono::system_clock's "period".) I have not looked into what we would need to extend the time range. 292 years is typically not a problem for usual reservoir applications, but will be a concern for CCS.

We replace the usage of the time-related utility functions mentioned earlier. As of this PR none of the libraries that constitute OPM Flow reference libecl functions or types.

@bska
Copy link
Member Author

bska commented Oct 15, 2019

jenkins build this please

@akva2
Copy link
Member

akva2 commented Oct 15, 2019

jenkins build this opm-material=350 opm-grid=397 opm-models=550 opm-simulators=2060 opm-upscaling=281 please

@bska
Copy link
Member Author

bska commented Oct 15, 2019

Jenkins goes through the base change (up to and including the changes to test_Restart).

I have brought in @akva2's build system changes too. Please don't merge this (#1107) until we've ensured that the build system changes are also okay.

@akva2
Copy link
Member

akva2 commented Oct 15, 2019

please amend with

diff --git a/python/setup.py b/python/setup.py
index 897a73f81..f5790e913 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -47,7 +47,7 @@ ext_modules = [
                 'cxx/well.cpp',
                 'cxx/export.cpp'
         ],
-        libraries=['opmcommon', 'boost_filesystem', 'boost_regex', 'ecl', 'z'],
+        libraries=['opmcommon', 'boost_filesystem', 'boost_regex'],
         language='c++',
         undef_macros=["NDEBUG"],
         include_dirs=["pybind11/include"]

Diff edited by @joakim-hove

@bska
Copy link
Member Author

bska commented Oct 15, 2019

please amend With [changes]

Okay, gives me a chance to try GitHub's editor...

@akva2
Copy link
Member

akva2 commented Oct 15, 2019

jenkins build this opm-material=350 opm-grid=397 opm-models=559 opm-simulators=2060 opm-upscaling=281 please

@bska
Copy link
Member Author

bska commented Oct 15, 2019

The build check including changes to the build system goes through—at least when launched from opm-common. I think this is ready for review now.

redhat/opm-common.spec Outdated Show resolved Hide resolved
@bska
Copy link
Member Author

bska commented Oct 15, 2019

Thank you for your comments, @joakim-hove. I'll adjust this PR accordingly.

@bska
Copy link
Member Author

bska commented Oct 16, 2019

I have rebased this onto the current master branch and tried to address review comments in the process. I will rerun the build test now.

@bska
Copy link
Member Author

bska commented Oct 16, 2019

jenkins build this opm-material=350 opm-grid=397 opm-models=559 opm-simulators=2060 opm-upscaling=281 please

@joakim-hove joakim-hove self-requested a review October 16, 2019 05:19
@bska
Copy link
Member Author

bska commented Oct 16, 2019

This PR was approved by module maintainer. I intend to merge this (and downstream PRs) no later 4pm CEST today (Wednesday).

In particular, use EGrid, ERst and EclFile as appropriate.
Instead, switch to 'int' for the 'before' and 'after' row indices.
The 'ssize_t' Posix type alias is not appropriate for this usage
since its range is only guaranteed to be [ -1 .. (1<<15)-1 ].
Mostly for converting between std::time_t and broken-down time
stamps.  Uses UTC and std::chrono::system_clock.  May wrap in as
little as 292 years, depending on the period of system_clock.

Intended to replace various timestamping utility functions from
libecl.  A comprehensive time-service protocol for Flow is much more
work than this, and will likely not be easily realized before we
have C++17 and its much expanded time/calendar library.
Note that we have to reduce the year-range in the specific test

    createDeckWithDRSDTthenDRVDT

in order not to wrap around for system_clock.  This is a deficency of
the new time-service protocol.
Mostly just to provide a simple overload of the utility function

    ecl_util_make_date

from libecl.  The rest of the test code remains intact.
@bska
Copy link
Member Author

bska commented Oct 17, 2019

jenkins build this opm-material=350 opm-grid=397 opm-models=559 opm-simulators=2060 opm-upscaling=281 please

@bska
Copy link
Member Author

bska commented Oct 17, 2019

Final pre-merge build check goes through. I'm merging this into master now per prior approval from module maintainer.

@bska bska merged commit 3ea66e4 into OPM:master Oct 17, 2019
@bska bska deleted the decouple-libecl-final branch October 17, 2019 02:44
blattms added a commit that referenced this pull request Oct 17, 2019
Decouple OPM Flow From Libecl  (Backport of pr #1107)
@blattms
Copy link
Member

blattms commented Oct 17, 2019

Backported to release via #1118

@bska
Copy link
Member Author

bska commented Oct 17, 2019

Backported to release via #1118

Thanks @blattms. Much appreciated!

@bska bska mentioned this pull request Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants