Commit Graph

144 Commits

Author SHA1 Message Date
Markus Blatt
6a0bad0243 Need to set ENV{CUDAHOSTCXX}, too.
No variables are used by check_language and hence we need
ti make nvc aware of the host compiler by the environment
variable.
2020-04-29 13:58:48 +02:00
Markus Blatt
2d32fde1c9 Fix CMake CUDA documentation. 2020-04-29 13:29:45 +02:00
Markus Blatt
2c7556d286 Use CMAKE_CUDA_HOST_COMPILER instead of ENV{CUDAHOSTCXX}. 2020-04-29 13:29:45 +02:00
Markus Blatt
46ccc77959 Use CMAKE_CUDA_FLAGS_${CMAKE_BUILD_TYPE} if appropriate. 2020-04-27 22:05:47 +02:00
Markus Blatt
4e0cd2a77e Prevent multiple "-ccbin g++" in nvcc command.
If ENV{CUDAHOSTCXX} is set then this will cause CMake to add
"-ccnin ${ENV{CUDAHOSTCXX}}" to variable CMAKE_CUDA_FLAGS
even if there already is one.
2020-04-27 22:05:47 +02:00
Markus Blatt
ddb0940336 Prevent Cmake error for CUDA with incompatible c++.
At least on Debian 10 the standard c++ compiler is g++-8,
but CUDA only supports g++-7 and our test for CUDA in cmake
did send an error in that case/combination which is quite
annoying.

The reason was that check_language(CUDA) did not honor
the CMAKE_CUDA_FLAGS variable and always used the default g++7,
but enable_language(CUDA) did honor it. As we do set the underlying
host compiler the fromer reported that CUDA is available while the
latter marked the CUDA compiler as broken.

With this commit we work around this by setting the environment
variable ENV{CUDAHOSTCXX} which nvcc will use. Hence now we only try
to enable CUDA if it is compatible with the C++ compiler
2020-04-27 15:22:56 +02:00
Joakim Hove
2696160f56
Merge pull request #2520 from akva2/extra_tests
add norne and norne_parallel as ExtraTests
2020-04-22 13:35:25 +02:00
Arne Morten Kvarving
16a1ddfe5e fixed: use PROJECT_BINARY_DIR, not CMAKE_BINARY_DIR
tests fail to execute in super-build otherwise
2020-04-21 08:50:51 +02:00
Markus Blatt
695e6c9449 Only warn abou CUDA version if CUDA was actually found. 2020-04-15 14:21:36 +02:00
Arne Morten Kvarving
e5b32dd82d add norne and norne_parallel as ExtraTests
to execute these you have to use ctest -C ExtraTests
or 'make extra_test'
2020-04-14 16:02:21 +02:00
Markus Blatt
340bad4b17 Fix policy warnings (needed by OPM/opm-common#1675 2020-04-02 20:31:54 +02:00
Markus Blatt
59916a7526 Move CUDA tests to a later stage to make time for setting policies. 2020-04-02 20:30:20 +02:00
Markus Blatt
1f876e693b Check for cuda 9.0 or newer as we are supposed to.
9.7 was a local change to see whether deactivating CUDA for old
version works.

Completes #2488
2020-03-23 11:10:17 +01:00
Markus Blatt
74051ebf01 Fix CUDA version check to allow versions 9.0 or newer. 2020-03-20 14:36:24 +01:00
T.D. (Tongdong) Qiu
04fe46a9da Only accept CUDA 9.0 for the WellContributions kernel. Also removed unused variables 2020-03-19 11:46:57 +01:00
Markus Blatt
843903dfdc Make Cmake version check for CUDA work for CMake 3.6.
It seems like the VERSION_GREATER_EQUAL operator for boolean
expressions was introduced after CMake 3.6 and hence the current
check whether to activate CUDA or not is broken in version 3.6 and
below.

This PR fixes this by using VERSION_GREATER.

Closes #2375.
2020-03-02 12:10:45 +01:00
Arne Morten Kvarving
42b290133a
Merge pull request #2366 from blattms/makes-mixing-incompatible-gcc-nvcc-fail
Make mixing incompatible host compiler/device compiler versions fail.
2020-02-26 09:00:34 +01:00
Markus Blatt
80c7bc179b Make mixing incompatible host compiler/device compiler versions fail.
We experienced weired linker errors when using host compiler version for
compilation that were not supported by the nvcc used to compile the
cuda code:
```
[ 15%] Linking CXX executable bin/test_timer
/usr/bin/ld: /home/mblatt/src/dune/opm-2.6/opm-common/opm-seq/lib/libopmcommon.a(Parser.cpp.o): in function `Opm::(anonymous namespace)::file& std::vector<Opm::(anonymous namespace)::file, std::allocator<Opm::(anonymous namespace)::file> >::emplace_back<std::filesystem::__cxx11::path&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&>(std::filesystem::__cxx11::path&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)':
Parser.cpp:(.text+0x1096): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/usr/bin/ld: Parser.cpp:(.text+0x10ad): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/usr/bin/ld: /home/mblatt/src/dune/opm-2.6/opm-common/opm-seq/lib/libopmcommon.a(Parser.cpp.o): in function `Opm::(anonymous namespace)::ParserState::loadFile(std::filesystem::__cxx11::path const&)':
Parser.cpp:(.text+0x23a1): undefined reference to `std::filesystem::canonical(std::filesystem::__cxx11::path const&)'
/usr/bin/ld: Parser.cpp:(.text+0x24e0): undefined reference to
`std::filesystem::__cxx11::path::_M_split_cmpts()'
```
The reason turned out to be that the library path was build up by
paths of the old (g++-7) compiler used by nvcc and the actual (newer) compiler
g++-8. This completely messed up the linker paths for CMake.

To detect this situation already when running cmake we have resorted
to first setting the CMAKE_CUDA_FLAGS to force cmake to make nvcc use
the host compiler and to activate CUDA (if available) before calling
`find_package(CUDA)`. If the host compiler is not supported CMake will
error out during `enable(CUDA)`

Note that we still use (deprecated) FindCUDA later to determine the
libraries to link to.

The users has the option to either deactivate CUDA by setting
`-DCMAKE_DISABLE_FIND_PACKAGE_CUDA=ON` or to use a compiler supported
by nvcc (setting `-DCMAKE_CXX_COMPILER=compiler`).

Additionally we do not try to activate CUDA the CMake version is <
3.8. Please note that previously CMake would have errored out here
anyway since we used the unsupported `enable_language(CUDA)` even in
this case.

Closes #2363.
2020-02-25 16:54:53 +01:00
Arne Morten Kvarving
8e8d187805 disable building of tests if Boost::test is not found 2020-02-19 12:41:27 +01:00
Robert Kloefkorn
e04bb6e91a [feature][flow_blackoil] Added a variant to compile the blackoil option
only for faster development.
2020-02-10 12:11:30 +01:00
Joakim Hove
1e26b7333e
Remove the stale flag ENABLE_3DPROPS_TESTING 2020-01-24 17:06:56 +01:00
Joakim Hove
0e9535319b
Simulate with only active cells (#2213)
Use FieldProps implementation for 3D properties
2020-01-13 15:46:50 +01:00
Tor Harald Sandve
c3424a5716 remove depricated ebos_saltwater from install list 2020-01-09 14:14:38 +01:00
Tor Harald Sandve
8b93953ef5 clean-up after rebase 2020-01-09 14:14:38 +01:00
Trine S. Mykkeltvedt
99e7785fb5 renamed saltwater-->brine and removed keywords from missingFeatures 2020-01-09 14:14:38 +01:00
Trine S. Mykkeltvedt
5749615bd8 addd simple salt/brine implementation 2020-01-09 14:14:38 +01:00
Markus Blatt
b9062396be
Merge pull request #2209 from Tongdongq/master
Added cusparseSolver, needs GPU to be used
2019-12-20 11:37:27 +01:00
T.D. (Tongdong) Qiu
8e7eddb3ea Reduced number of library includes 2019-12-16 12:38:32 +01:00
Robert Kloefkorn
44e4ea3cdf [feature][ebos] Adding oil-water-polymer option of ebos. 2019-12-09 18:16:23 +01:00
Joakim Hove
5259fb93ca Add cmake switch to enable testing of new 3D property implementation 2019-12-07 12:34:07 +01:00
T.D. (Tongdong) Qiu
69033ca7f2 Changed structure of cusparseSolver to fit into master branch 2019-12-04 16:59:58 +01:00
T.D. (Tongdong) Qiu
4db2e7ca4e Added cusparseSolver. Automatically compiled when CUDA is detected. Must be enabled at runtime by adding '--use-gpu=true' 2019-12-03 14:29:06 +01:00
Michael Sargado
a600adf518 Add python folder to top-level CMakeLists. 2019-10-31 16:41:13 +01:00
Kai Bao
0605b2fe6f the version information of opm-fem is needed. 2019-10-22 13:00:33 +02:00
Arne Morten Kvarving
8261a51e6e remove libecl dependency 2019-10-15 14:36:05 +02:00
Atgeirr Flø Rasmussen
71c5129d3d Do not build the extra Flow variants by default. 2019-10-11 08:46:17 +02:00
Atgeirr Flø Rasmussen
10e2200a25 Add two new flow variants for one-phase (water, water+energy) simulation. 2019-10-11 08:19:18 +02:00
Arne Morten Kvarving
ba698abfd1 changed: rename ewoms to opm-models 2019-08-23 11:27:16 +02:00
Andreas Lauser
993f1133c8 enable the foam extension for ebos/mebos 2019-08-09 11:04:45 +02:00
Franz G. Fuchs
7fb90bff47 Use foam module. 2019-08-07 10:39:16 +02:00
Arne Morten Kvarving
795f412047 changed: simplify buildsystem a little
- use loops instead of copy-paste
- use object libraries to avoid some unnecessary archives
- tab scrubbing
2019-06-13 14:59:31 +02:00
Andreas Lauser
ca8ea76818 add mebos, a multiplexed ebos variant
`mebos` works similarly as `flow`, but in contrast to `flow`, `mebos`
only creates the deck in the common code path whilst the
'EclipseState' and the other higher-level parser objects are always
created internally by the vanguard. this approach avoids code
duplication and the worst effects of parser API creep.

to avoid having to compile non-trivial compile units multiple times,
the actual code of the variants is moved into `ebos_$VARIANT.{hh,cc}`
files and the respective compile units are each put into a small
static library whilst the main function of said libraries are invoked
by either the multiplexed or the respective specialized simulator's
`main()`. This is also somewhat similar of how `flow` works, with the
difference that `mebos` uses the blackoil variant to determine the
parameters it needs to know for parsing the deck instead of
introducing a "fake" type tag for this. The rationale is to reduce
compile time compared to the "fake type tag" approach and -- to a
lesser extend -- avoid unnecessary copy-and-pasting of code. In
particular, this means that for the vast majority of cases, only one
place needs changed in the code for all `ebos` variants if, for
example, the parser API requires further objects in the future.
2019-06-11 10:27:47 +02:00
Andreas Lauser
44a396d1c8 add ebos_plain to the ebos debug extensions 2019-06-03 11:20:41 +02:00
hnil
f05a9fdb25 Version of cpr amg which can reuse setup and also change smoothers of fine and coarse system by changing tags 2019-04-10 14:40:46 +02:00
Andreas Lauser
fe62b4fe5e add an ebos variant which uses completely different numbering for phases and components
for some reason, this yields quite different results for norne than
the default variant, e.g. when comparing PRESSURE, we get

```
> compareECL -k PRESSURE -t UNRST ebos/NORNE_ATW2013 ebos_altidx/NORNE_ATW2013 1 1e-4
Comparing 'ebos/NORNE_ATW2013' to 'ebos_altidx/NORNE_ATW2013'.
Comparing PRESSURE...
Occurrence in first file    = 9
Occurrence in second file   = 9
Value index                 = 0
(first value, second value) = (254.195, 253.191)

Program threw an exception: [/home/and/src/opm-common/build-cmake/fake-src/examples/test_util/EclRegressionTest.cpp:161] Deviations exceed tolerances.
The absolute deviation is 1.00311, and the tolerance limit is 1.
The relative deviation is 0.00394624, and the tolerance limit is 0.0001.
```

IMO this is a bug, but the reasons for it are currently unknown.
2019-03-13 11:14:22 +01:00
Andreas Lauser
fb70fe2ba3 add but do not build disabled targets
this simply excludes the disabled simulators from `make all` while
`make flow` will continue to work even if the cmake variable
`BUILD_FLOW` was set to `OFF`. This requires a small patch for
opm-common.
2019-03-07 12:45:15 +01:00
Andreas Lauser
d8148d281f add cmake build switches to enable/disable flow and/or ebos 2019-03-06 11:54:21 +01:00
Andreas Lauser
383009e031 add some ebos variants
these variants should cover most of the common use cases. That said,
there are no plans to provide simulators for combinations of blackoil
extensions or a "multiplexing" simulator like `flow`: If someone is
interested in e.g., an oil-water simulator with polymer and energy
enabled, a separate self-compiled executable should be added locally.
2019-03-05 18:30:35 +01:00
Andreas Lauser
a5863a1f36 CMakeLists.txt: remove unecessary condition
thanks to [at]akva2 for catching this.
2019-03-04 15:42:57 +01:00
Andreas Lauser
f4435a5de9 fix the default build system
for some reason, libraries produced for a module are not linked to the
executables of the module by the default build system. so far this did
not matter for `ebos` but with this PR, it starts using stuff from
`libopmsimulators`...
2019-03-04 15:38:07 +01:00