Commit Graph
100 Commits
Author SHA1 Message Date
Markus Blatt 7ed960b6d1 Use normal pointer to assembled matrix. 2020-05-13 12:23:20 +02:00
Markus Blatt ddd947bf0a Use correct matrix for flexible solver when parallel.
In this case matrix_ is a nullptr and noGhostMat_ is the optimized
matrix to use. Before this commit we experienced a segmentation fault
as the nullptr was dereferenced and passed to the solver.
2020-05-12 19:06:12 +02:00
Markus Blatt 1f177b33e7 Use communicator to decide whether this is a truly parallel. 2020-05-12 12:46:04 +02:00
Markus Blatt 1ff1f24fbb Fix when the matrix with no ghosts will be used. 2020-05-12 12:46:04 +02:00
Markus Blatt e8b79b2b63 Prevent matrix copy in serial run. 2020-05-12 12:46:04 +02:00
Markus Blatt 357469dc21 Only extract overlap and interior information if needed.
That is, if actually set up the additional matrix with no ghosts.
2020-05-12 11:52:19 +02:00
Markus Blatt aa54b4d8db Remove unused weight_filename from json file. 2020-05-12 11:52:19 +02:00
Markus Blatt 47acb6ecb3 Make flexible solvers and CPR accessible for flow binary.
Previously, one had to call a seperate binary called
flow_blackoil_dunecpr. Unforntunately, that was only built if users
requested that the tests (`-DBUILD_TESTING=ON`) and the flow
variants (`-DBUILD_FLOW_VARIANTS=ON`) should be built. In addition
it would use a slightly different nonlinear solver implementation.

With this commit flow can be asked to either use
CPR (`--use-cpr=true --matrix-add-well-contributions=true`) or to use
the flexible solvers bx setting the `--linear-solver-configuration`
option. In all other cases the usual solver implementations are still
used.

Note that the flexible solvers still need
`--matrix-add-well-contributions=true` and hence cannot cope with
multi-segment wells.
2020-05-12 11:52:19 +02:00
Markus Blatt 71b234ec54 Make CprReuseSetup always use same default value.
The default was 0 for flow and 3 for flow_blackoil_dunecpr. Now we
always use 3. This is safe as it will not be used for any other
solvers than the flexible ones.
2020-05-12 11:52:19 +02:00
Markus Blatt 5b4acd5417 Do not query wells for solver if it is actually not needed. 2020-05-12 11:52:19 +02:00
Markus Blatt d54d69df25 Merge pull request #2610 from blattms/fix-write-matrix-dune-2,7
For DUNE 2.7 and up we need to specialize for Opm:MatrixBlock
2020-05-12 11:50:21 +02:00
Markus Blatt 19bd9cea65 for DUNE 2.7 and up we need to specialize for Opm:MatrixBlock
as there already is a specialization for an arbitrary Block
and that one leads to compile errors because we redefine it
in OPM (and miss some other specializations for Opm:MatrixBlock,
e.g. isNumber).
2020-05-11 21:29:47 +02:00
Markus Blatt d26c993d86 Merge pull request #2579 from akva2/quell_dep_warning_boost_1.71
quell deprecation warnings with boost 1.71
2020-05-05 17:29:33 +02:00
Markus Blatt 3f65235935 Merge pull request #2591 from atgeirr/fix-parameter-setup
Do not run setupParameter_() twice for the static-typed sims.
2020-05-05 17:27:44 +02:00
Markus Blatt c6fe4c7bab Merge pull request #2569 from blattms/prevent-cmake-error-for-cuda-g++-master
Prevent Cmake error for CUDA with incompatible c++ compiler.
2020-05-05 13:32:10 +02:00
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 9b8887d39f Merge pull request #2576 from blattms/remove-unused-code-blackoilmodelebos
Removes unused member istlSolver_ and method to get it from BlackoilM…
2020-04-28 22:14:40 +02:00
Markus Blatt ca744231b1 Removes unused member istlSolver_ and method to get it from BlackoilModelEbos
It is not used since quite some time and tends to confuse me.
2020-04-28 16:46:17 +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 f03b56c261 Complete future-proofing ILU usage in the preconditioner factory.
SeqILU0/SeqILU0 are removed in master and one should use SeqILU
2020-04-27 15:52:43 +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
Markus Blatt e61e2bd399 Merge pull request #2551 from akva2/fix_test_dir
fixed: use PROJECT_BINARY_DIR, not CMAKE_BINARY_DIR
2020-04-21 11:16:00 +02:00
Markus Blatt 057a0ceeeb Removes stale CPR headers that have been superseeded.
No need to drag them along and confuse people.
2020-04-15 21:38:28 +02:00
Markus Blatt 83d30547f6 Merge pull request #2517 from blattms/refactor-policy-settings
Refactor policy settings (Needed by OPM/opm-common#1675)
2020-04-15 21:02:29 +02:00
Markus Blatt 695e6c9449 Only warn abou CUDA version if CUDA was actually found. 2020-04-15 14:21:36 +02:00
Markus Blatt 11b0a409d1 Merge pull request #2534 from akva2/janitoring
remove unused lambda parameter
2020-04-14 22:25:29 +02:00
Markus Blatt 6f913d3a85 Merge pull request #2532 from hakonhagland/add_main_hpp
Add Main.hpp to CMakeLists_files.cmake.
2020-04-14 22:23:34 +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 20f26bffbf fixup! [FlexibleSolver] Added missing headers determine IsComm. 2020-04-02 17:16:17 +02:00
Markus Blatt 9ce008ef7d [FlexibleSolver] Added missing headers determine IsComm.
Seems needed for some compilers
2020-04-02 17:10:43 +02:00
Markus Blatt e8145656de Merge pull request #2512 from alfbr/enable-owner-first
Enable owner first ordering by default
2020-04-02 13:07:48 +02:00
Markus Blatt a8184df3c2 Corrected expected exception type in PreconditionerFactory test 2020-03-31 16:49:37 +02:00
Markus Blatt 2c432e09af Error when json file is requested for insufficient boost version. 2020-03-31 16:49:37 +02:00
Markus Blatt 589b70ff26 Correct errror message when json file is not specified. 2020-03-31 16:49:37 +02:00
Markus Blatt 910ecdb78d Addedmissing space. 2020-03-31 16:49:37 +02:00
Markus Blatt b16f635b90 Deleted commented out code. 2020-03-31 16:49:37 +02:00
Markus Blatt a72ab9d283 Fixed typo and reworded. 2020-03-31 16:49:37 +02:00
Markus Blatt 2fc2703aba Use special default for LinearSolverMaxIter for CPR and honor CprMaxEllIter 2020-03-31 16:49:37 +02:00
Markus Blatt 2c1df912fe honor ilulevel for ParallelOverlappingILU0 2020-03-31 16:49:37 +02:00
Markus Blatt 9019a52937 Use enable_if on comm constructor parameter.
As this is the one we want to check.
2020-03-31 16:49:37 +02:00
Markus Blatt b016a1a714 [FlexibleSolver] active CPR if UseCpr is true and adjust maxIter.
If no LinearSolverConfiguration is specified but UseCpr is true we
use cpr_quasiimpess. If the user does not specify the maximum
iteration number we use 20 for cpr.
2020-03-31 16:49:37 +02:00
Markus Blatt 74b958c258 Improves exceptions and message and resort to OPM_THROW for flexible solvers. 2020-03-31 16:49:37 +02:00
Markus Blatt ff0d54d4ea Add sensible defaults for flexible solver properties...
to prevent throwing. The get methods will throw if called without a
default value. This quite unfortunate and not very user friendly, as
there are many properties and the throwing will happen during the
linear solve and result in time step chopping.

This commit should prevent such throws and allow users to provide
jsdon files omitting some options.
2020-03-31 16:49:37 +02:00
Markus Blatt 2e4824cbc7 Change default configuration to "ilu0".
The previous was "file" which resulted in runtime errors
like

Program threw an exception: No linear-solver-configuration-json-file given for linear-solver-configuration=file
2020-03-31 16:49:37 +02:00
Markus Blatt dcb316f442 Make update method of preconditioners parameter-less again.
Previously, it got passed the weights only needed for CPR.
Additionally those were passed with the parameter tree to the
update method and constructor.

Now the CPR constructor gets a function to use for recalculating
the weights and the property is not changed. Unfortunately this
means that the preconditioner creators of the factory get another
parameter.
2020-03-31 16:49:37 +02:00
Markus Blatt 95a1e1ca0e Remove property tree parameter from PreconditionerWithUpdate::update
It is not used, needed parameters can stored in the constructor, and
it made de design a bit suboptimal.
2020-03-31 16:49:37 +02:00
Markus Blatt 70cff4b342 Refactor to a single function that calculates true impes weights.
Two identical versions seemed like a lot of maintenance for no gain.
2020-03-31 16:49:37 +02:00
Markus Blatt 3d04df9759 Merge pull request #2493 from blattms/fix-cuda-version-fix
Check for cuda 9.0 or newer as we are supposed to.
2020-03-23 11:11:35 +01: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 53d636a3b1 Merge pull request #2488 from blattms/fix-cuda-version-check
Fix CUDA version check to allow versions 9.0 or newer.
2020-03-23 09:45:20 +01:00
Markus Blatt 03b2c44dce Prevent some unnecessary copies. 2020-03-23 09:40:14 +01:00
Markus Blatt b41b449c7d Removed suplicated code for calculating quasi impes weights.
Maintaining two versions is just to error prone.
2020-03-23 09:40:14 +01:00
Markus Blatt c14bf078a1 Make ParallelOverlappingILU0 updateable & use it to construct ILU0/n
This should force the flexible solver approach to recalculate the
decomposition during update.

Closes #2490
2020-03-23 09:39:51 +01:00
Markus Blatt 74051ebf01 Fix CUDA version check to allow versions 9.0 or newer. 2020-03-20 14:36:24 +01:00
Markus Blatt c0a82ff335 Merge pull request #2475 from Tongdongq/separate_wellcontributions_for_gpu
Separate wellcontributions for gpu
2020-03-20 12:14:06 +01:00
Markus Blatt 0970867e47 Merge pull request #2484 from akva2/janitoring
avoid potentially uninitialized warnings in serial
2020-03-19 13:07:08 +01:00
Markus Blatt 5fc248f786 Rely on local ids being persistent across grid modifications
as the issue in CpGrid was fixed, recently.
2020-03-17 12:26:30 +01:00
Markus Blatt a45c278c4a Merge pull request #2458 from blattms/use-indices-for-modifying-matrices
Do not use local id set to index matrices.
2020-03-13 20:10:17 +01:00
Markus Blatt 1c2d3fbcc7 Do not use local id set to index matrices.
That the local ids were consecutive and starting from 0 was just
a coincidence and they should never be used to access linear systems
or vectors. This commit fixes this by using the correct mappers instead.

Note the we removed some computations from the constructor of
ISTLSolverEbosCpr as it inherits from ISTLSolverEbos and the operations
already happnen in constructor of the base class.
2020-03-13 17:56:49 +01:00
Markus Blatt e65f6c02bb Merge pull request #2220 from andrthu/owners-first
[For testing] Enable "owners first" ordering. Altered SpMV, SP and ILU.
2020-03-13 17:48:22 +01:00
Markus Blatt fed22e5189 Tighten parallel tolerances for SPE1CASE2_THERMAL 2020-03-10 15:45:01 +01:00
Markus Blatt 400ca4230b Use dynamic_cast to ParallelEclipseState and do error checking. 2020-03-10 14:29:19 +01:00
Markus Blatt eb8ac2af2d Use correct region temperature when calculating RS/RV
The InitialStateComputer::temperature_ array, previously used,
was of cartesian size, but used as if it only contained the
values of the cells of a region.
With this commit InitialStateComputer::temperature_ is a compressed local
array and we explicitly copy out only the region values when computing
RS/RV.

Closes #2423.
2020-03-10 11:54:58 +01:00
Markus Blatt 04311f6337 Allow auto creation of field properties arrays in ParallelEclipseState.
There are field properties that can usually be queried even if they
are not explicitly specified in the input
file (e.g. PVTNUM). Unfortunately, the ParallelEclipseState cannot
forsee which of these will be queried at startup and after the
loadbalancing only the master process is able to auto creates
these (easily). Hence this commit uses a fall-back if an unstored
keyword is queried. In this case we use get_global-* to auto create
the keyword and use functions of the cartesian mapper to extract the
relevant values on the process.

Of course this temporarily wastes space and we might want to resort to
a more memory savy approach later.
2020-03-10 11:36:02 +01:00
Markus Blatt f4876becfb Improve exception handling in ParallelEclipseState::get_global-*
In particular we make sure that all processes throw on unknown
keywords.
2020-03-10 11:36:02 +01:00
Markus Blatt fa158893db Merge pull request #2447 from akva2/simplify_serializer
changed: simplify eclmpiserializer
2020-03-10 11:21:50 +01:00
Markus Blatt 1e65a1421b Merge pull request #2448 from akva2/serialize_aquifer_config
fixed: serialize AquiferConfig
2020-03-10 08:37:22 +01:00
Markus Blatt 5c8cdc8024 Use get_int instead of get_int_global in initstateequil.hh.
With the arrival of compressed field properties there is no need
to extract the global arrays just to compress them manually
afterwards. This change should remove commununication and
synchronization points.
2020-03-09 21:32:41 +01:00
Markus Blatt 9ccd4be5e3 Shrink EclEquilInitializer::initialFluidStates_.
There is not reason to it as a vector of cartesian size as we access
its entries by the compressed element index. This should save space
and speedup the lookup.
2020-03-08 16:25:35 +01:00
Markus Blatt f90cfa7ef9 Merge pull request #2425 from blattms/no_serialization_polymermodule
Rebased #2419: changed: no need to serialize PolymerModule any longer
2020-03-08 15:20:35 +01:00
Markus Blatt 8bab43ffbd Removed now unused variables. 2020-03-08 15:18:55 +01:00
Markus Blatt 0702f48abc Merge pull request #2424 from blattms/no_serialization_brine
rebased #2408: changed: no need to serialize BrineModule any longer
2020-03-06 20:32:42 +01:00
Markus Blatt 6aeac6cb3a Merge pull request #2407 from akva2/no_serialization_foam
changed: no need to serialize FoamModule any longer
2020-03-06 20:11:27 +01:00
Markus Blatt eea15e5659 Merge pull request #2417 from blattms/loadbalance-centroids
Also distribute the centroids when loadbalancing CpGrid.
2020-03-06 19:47:51 +01:00
Markus Blatt 4c962e61d1 Also distribute the centroids when loadbalancing CpGrid.
They are attached to the cells as well and are now distributed
during CpGrid::loadBalance. Due to this change we also rename
FieldPropsDataHandle to PropsCentroidsDataHandle.
2020-03-06 14:09:32 +01:00
Markus Blatt 1b03b040a3 Merge pull request #2422 from blattms/fix-2406-without-mpi
Only compile FieldPropsDataHandle if MPI was found
2020-03-06 14:03:12 +01:00
Markus Blatt 4baa1ba038 Only compile FieldPropsDataHandle if MPI was found 2020-03-06 13:05:29 +01:00
Markus Blatt 1f00870660 Merge pull request #2406 from blattms/loadbalance-fielprops
Use CpGrid::loadBalance to distribute the field properties.
2020-03-06 11:51:14 +01:00
Markus Blatt 77478a59eb Use CpGrid::loadBalance to distribute the field properties.
The created data handle for the communication could in theory be used
with other DUNE grids, too. In reality we will need to merge with the
handle that ALUGrid already uses to communicate the cartesian indices.

This PR gets rid of using the get_global_(double|int) method in
ParallelEclipseState and reduces the amount of boilerplate code there.
2020-03-06 09:48:04 +01:00
Markus Blatt c0c403aba3 Merge pull request #2380 from blattms/make-cmake-cuda-check-work-for-3.6
Make Cmake version check for CUDA work for CMake 3.6.
2020-03-02 13:21:15 +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
Markus Blatt 9faf2979b9 Merge pull request #2377 from akva2/use_compressed_numbers
changed: use compressed field properties setting up numbers
2020-03-02 11:32:22 +01:00
Markus Blatt 396f84b764 Merge pull request #2372 from akva2/compressed_props_material
Use compressed properties in material law setup
2020-03-02 09:47:09 +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
Markus Blatt 22d4e784d3 Merge pull request #2356 from akva2/boost_prune
Lessen boost usage
2020-02-21 13:15:03 +01:00
Markus Blatt 0e45f0827c Merge pull request #2330 from akva2/bump_to_cxx17
remove usage of CXX11Features module
2020-02-11 17:50:01 +01:00
Markus Blatt 11c1574405 Merge pull request #2316 from akva2/fix_bda_onephase
fixed: add explicit template instantation for blocksize 1
2020-02-10 11:23:06 +01:00
Markus Blatt daa8f778bb Merge pull request #2310 from akva2/noecl_small_stuff
Preparatory changes for single-process parsing
2020-01-30 09:13:14 +01:00
Markus Blatt 7e700c11e0 Move PreconditionerFactory into namespace Opm.
This fixes name clashes with DUNE's own factory that is introduced
in DUNE 2.7. Hence it closes issue #2266.

BTW: Dune's factory has more template parameters than ours.
2020-01-07 17:59:23 +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
Markus Blatt 3968d23a5a Merge pull request #2249 from joakim-hove/test-throw
Throw std::runtime_error() instead of std::abort() in test failure
2019-12-20 11:28:01 +01:00
Markus Blatt 68272d5861 Merge pull request #2243 from blattms/construct-cpgrid-from-eclgrid-pointer
Pass a pointer to the EclipseGrid to CpGrid::processEclipseGrid.
2019-12-19 11:40:23 +01:00
Markus Blatt 2511121a84 Merge pull request #2222 from dr-robertk/PR/ebos-polyhedralgrid2
Make ebos compile with PolyhedralGrid again.
2019-12-18 23:57:38 +01:00
Markus Blatt ecfbb0e491 Pass a pointer to the EclipseGrid to CpGrid::processEclipseGrid.
... instead of a reference This is needed as we only want to read the
full deck and construct the EclipseGrid only on the master process
with rank 0. Hence all other ranks will pass a nullptr to this
function. This will be possible with this move from a reference to a
pointer.
2019-12-18 21:39:08 +01:00
Markus Blatt d255e1cad6 Merge pull request #2215 from dr-robertk/PR/fix-compile-dune27
Fix compilation with DUNE 2.7
2019-12-18 08:56:51 +01:00
Markus Blatt 75a551c668 Merge pull request #2230 from totto82/addOutput
add group name to output
2019-12-18 08:14:17 +01:00