Commit Graph

651 Commits

Author SHA1 Message Date
Bård Skaflestad
0c71d0701c Add MPI Support to Saturation Function Consistency Checks
This commit adds a new public member function

    SatfuncConsistencyChecks<>::collectFailures(root, comm)

which aggregates consistency check violations from all ranks in the
MPI communication object 'comm' onto rank 'root' of 'comm'.  This
amounts to summing the total number of violations from all ranks and
potentially resampling the failure points for reporting purposes.

To this end, extract the body of function processViolation() into a
general helper which performs reservoir sampling and records point
IDs and which uses a call-back function to populate the check values
associated to a single failed check.  Re-implement the original
function in terms of this helper by wrapping exportCheckValues() in
a lambda function.  Extract similar helpers for numPoints() and
anyFailedChecks(), and add a new helper function

    SatfuncConsistencyChecks<>::incorporateRankViolations()

which brings sampled points from an MPI rank into the 'root's
internal data structures.

One caveat applies here.  Our current approach to collecting check
failures implies that calling member function reportFailures() is
safe only on the 'root' process in a parallel run.  On the other
hand functions anyFailedChecks() and anyFailedCriticalChecks() are
safe, and guaranteed to return the same answer, on all MPI ranks.

On a final note, the internal helper functions are at present mostly
implemented in terms of non-owning pointers.  I intend to switch to
using 'std::span<>' once we enable C++20 mode.
2024-06-28 11:04:53 +02:00
Kjetil Olsen Lye
9b414419e7
Merge pull request #5404 from multitalentloes/add_dilu_LU_splitting
Add cudilu lu splitting
2024-06-27 14:30:45 +02:00
Arne Morten Kvarving
386fbed37f changed: remove hipification at configure time
the outputs will be generated when needed by the custom_command

since these outputs are not intended to be edited, there is no reason
to hipify them up front. in particular this removes the long sequential
process at configure time, allowing all hipification to run in parallel
(if using multiple build jobs, ie. ninja -jx or make -jx)
2024-06-26 16:01:16 +02:00
Bård Skaflestad
c3939c5444 Add New Platform for Saturation Function Consistency Checks
The intention is that this will ultimately replace the existing
RelpermDiagnostics component which does not really work in parallel
and which does not report enough context to help diagnose underlying
issues.  For now, though, we just add the shell of a new set of
checks and hook that up to the build.

Class SatfuncConsistencyChecks<Scalar> manages a configurable set of
consistency checks, the implementations of which must publicly
derive from SatfuncConsistencyChecks<Scalar>::Check.  Client code
will configure a set of checks by first calling

    SatfuncConsistencyChecks<Scalar>::resetCheckSet()

then register individual checks by calling

    SatfuncConsistencyChecks<Scalar>::addCheck()

and finally build requisite internal structures by calling

    SatfuncConsistencyChecks<Scalar>::finaliseCheckSet()

Client code will then run the checks by calling

    SatfuncConsistencyChecks<Scalar>::checkEndpoints()

typically in a loop.  Class SatfuncConsistencyChecks<Scalar> will
count consistency check failures and attribute these to each
individual check as needed.  We also maintain separate counts for
"Standard" and "Critical" failures.  The former will typically
generate warnings while the latter will typically cause the
simulation run to stop.  Individual checks get to decide which check
is "Critical", and client code gets to decide how to respond to
"Critical" failures.

Member function SatfuncConsistencyChecks<Scalar>::reportFailures()
will generate a textual report of the known set of consistency check
failures at a give severity level.

As an internal implementation detail, SatfuncConsistencyChecks uses
"reservoir sampling"
(https://en.wikipedia.org/wiki/Reservoir_sampling) to track details
about individual failed checks.  We maintain at most a fixed number
of individual points (constructor argument).
2024-06-26 12:17:00 +02:00
Bård Skaflestad
26cd7ab993 Move opm/core/props to opm/simulators/utils
The opm/core directory is no longer meaningful, and it contains only
components which might collectively be described as simulator
utilities.
2024-06-25 12:22:09 +02:00
Lisa Julia Nebel
ecf7bd1e52 Test for skipping the ghost entries using Jacobi preconditioner 2024-06-07 14:40:58 +02:00
Tobias Meyer Andersen
9b2f41ad96 Add option to split the matrix into diagonal,
strictly lower and stricly upper part.
Add tests checking that the result matches
the CPU dilu implementation.
2024-06-05 13:35:54 +02:00
Tobias Meyer Andersen
e9d6b326cc Add HIP support for AMD GPUs
This commits adds cmake functionality that can
hipify the cuistl framework to support AMD GPUs.

Some tests have been written as HIP does not mirror
CUDA exactly.

CONVERT_CUDA_TO_HIP is the new CMAKE argument.
CMAKE version is increased to include HIP
as a language (3.21 required).

A macro is added to create a layer of indirection
that will make only cuistl files that have been
changed rehipified.

Some BDA stuff is extracted to make sure CUDA
is not accidentally included.
2024-05-06 15:56:53 +02:00
Bård Skaflestad
2fcefbd743
Merge pull request #5226 from akva2/avoid_alu_poly
changed: put SupportsFaceTag in separate header
2024-03-11 12:35:26 +01:00
Arne Morten Kvarving
2a91fb4c2f remove unused ebos/eclnewtonmethod.hh 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
fb7c4f6fd2 move ebos/eclproblem.hh to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
6f5d53b20b move ebos/eclgenericproblem.[hh|cc] to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
15339fe02f move ebos/eclproblem_properties.hh to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
57905c1069 move ebos/ecltransmissibility[_impl].[hh|cc] to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
9facaaf816 ebos/damariswriter: move to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
76ccaf45ef ebos/damaris_properties.hh: move to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
1362143e48 move ebos/eclgenericvanguard.[hh|cc] to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
6949abbf0d move ebos/eclbasevanguard.hh to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
9fe969378d move ebos/eclgenericcpgridvanguard.[hh|cc] to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
04ed17ebd0 move ebos/eclcpgridvanguard.hh to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
bc2dd1110e move ebos/eclfluxmodule.hh to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
2d604e12a7 move ebos/eclequilinitializer.hh to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
d717d96590 move ebos/eclthresholdpressure.hh to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
f6475f8c1e move ebos/eclgenericthresholdpressure[_impl].[hh|cc] to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
e6eac2039b move ebos/vtkecltracermodule.hh to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
9d256bc233 move ebos/ecltracermodel.hh to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
3a3881e8d9 move ebos/eclgenerictracermodel[_impl].[hh|cc] to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
a01e1bd902 move ebos/eclsolutioncontainers.[hh|cc] to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
eb90588fa9 move ebos/eclmixingratecontrols.[hh|cc] to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
ddb7c65f97 move ebos/eclwriter.hh to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
8d667301cc move ebos/eclgenericwriter[_impl].[hh|cc] to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
e7094558ef move ebos/eclpolyhedralgridvanguard.hh to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
e168066003 move ebos/FIBlackOilModel.hpp to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Arne Morten Kvarving
c9b3de16f1 move ebos/femcpgridcompat.hh to opm/simulators/flow 2024-03-08 12:39:48 +01:00
Markus Blatt
f04f4c5765
Merge pull request #5239 from akva2/move_flow_utilities_dedicated_file
changed: rename FlowMain.cpp to FlowUtils.cpp
2024-03-07 17:35:59 +01:00
Arne Morten Kvarving
5618a2b0d2 changed: put SupportsFaceTag in separate header
this way we don't have to pull in alugrid and polyhedralgrid
in simulator objects that does not use them
2024-03-07 12:21:21 +01:00
Kai Bao
75f38ca726
Merge pull request #5178 from akva2/baseaquifermodel_move
move ebos/eclbaseaquifermodel.hh to opm/simulators/flow
2024-03-06 12:47:51 +01:00
Arne Morten Kvarving
233d4c90ac ebos/collecttoiorank: move to opm/simulators/flow 2024-03-06 09:30:21 +01:00
Arne Morten Kvarving
8d033f94de move ebos/eclbaseaquifermodel.hh to opm/simulators/flow 2024-03-06 09:17:19 +01:00
Arne Morten Kvarving
fdb285c03a changed: rename FlowMain.cpp to FlowUtils.cpp
and add a dedicated header.

this way we don't need to pull in FlowMain.hpp for the prototypes,
avoiding pulling in the entire simulator machinery just to build
some simple utility functions.
2024-03-06 07:57:25 +01:00
Kai Bao
9f13a25ebc
Merge pull request #5175 from akva2/move_alugrid
Move AluGrid files from ebos to opm/simulators/flow
2024-03-06 00:02:12 +01:00
Arne Morten Kvarving
b6cbf513bc move ebos/ecloutputblackoilmodule.hh to opm/simulators/flow 2024-03-04 13:09:48 +01:00
Arne Morten Kvarving
41319eab7d move ebos/eclgenericoutputblackoilmodule.[hh|cc] to opm/simulators/flow 2024-03-04 13:03:42 +01:00
Markus Blatt
5bafd76b94
Merge pull request #5230 from akva2/fractioncalculator_split
FractionCalculator: put in separate translation unit
2024-02-29 08:22:59 +01:00
Bård Skaflestad
d1d22668ea Add Utility for Region-Based Phase-Filled Averages
The initial use case is calculating the phase-filled pore-volume
weighted average of the fluid mass densities per PVT region.  This
value goes into calculating depth-corrected per-cell phase pressure
values such as the BPPO and BPPG summary vectors.

This class manages a single linear array which separately tracks the
averages' numerators and denominators as running sums per region and
region set.  We pick this data structure to simplify the cross-rank
reduction needed in MPI parallel runs.  Client code is expected to
add individual per-cell and per-phase contributions using the
addCell() member function and then call the accumulateParallel()
member to affect the cross-rank reduction.  The averages will then
be available through the fieldValue() and value() member functions.

As a further view towards the initial use case, we track two
different types of average per phase--one for the phase-filled
volume and one for the pore-volume filled volume.  The latter is the
average we would get for the case of the phase saturation being one
throughout the region.  This alternative value is the fallback
option for the case of the phase saturation being identically zero
throughout the region.
2024-02-28 12:08:24 +01:00
Arne Morten Kvarving
33dcc0bd50 FractionCalculator: put in separate translation unit 2024-02-27 13:00:23 +01:00
Arne Morten Kvarving
0039c1f25f move ebos/eclalugridvanguard.hh to opm/simulators/flow 2024-02-23 15:27:53 +01:00
Arne Morten Kvarving
f95c114716 move ebos/alucartesianindexmapper.hh to opm/simulators/flow 2024-02-23 15:27:28 +01:00
Arne Morten Kvarving
3087950c35
Merge pull request #5181 from akva2/move_gradient_calculator
move ebos/ecldummygradientcalculator.hh to opm/simulators/flow
2024-02-23 15:24:44 +01:00
Markus Blatt
cc9d9bab41
Merge pull request #5193 from akva2/move_timestepping_params
move ebos/ecltimesteppingparams.hh to opm/simulators/timestepping
2024-02-23 10:13:24 +01:00