Commit Graph
100 Commits
Author SHA1 Message Date
Markus Blatt 9ed02b33bc Fix verbosity parameter used for parallel istl solvers.
These are not aware whether they are parallel or not. Therefore
the user should only specify a verbose verbosity only on one rank.
With this commit we do this on the process responsible for terminal
output.
2017-04-06 12:11:26 +02:00
Markus Blatt 30f3d4e2d0 Get rid off TypeTag system in StandardWellsDense.
Previously, we kind of hard coded the problem using the TypeTag system.
Instead of this we now simply pass the only additional thing needed, the
ElementContext, as an additional template parameter.

Removes the include of removed header BlackoilModelEbosTypeTags.hpp.
2017-04-04 11:08:17 +02:00
Markus Blatt 312aa24f86 Revert "Factor out ewoms typetag system to separate header."
This reverts commit 05c70491257a615472e68fb44776bcd7effb60b8.
2017-04-04 11:08:17 +02:00
Markus Blatt 2bf7f8efa7 Revert "Moved copyright notice to top of header BlackoilModelEbosTypeTags.hpp"
This reverts commit d341de0d8b796b66f7bd6d871c84e1c2db265ff1.
2017-04-04 11:08:17 +02:00
Markus Blatt e56e2cae15 Added requested braces. 2017-04-04 11:08:17 +02:00
Markus Blatt 6b8b8b971e Use global wellsActive to see whether wells are active at all.
This bug must have sneaked in during rebasing. Kudos to Atgeirr for
spotting this.
2017-04-04 11:08:17 +02:00
Markus Blatt cde162b3d6 Use the global number of cells for the average.
This number is still wrong in master but well become correct once
PR #1107 is merged.
2017-04-04 11:07:57 +02:00
Markus Blatt a6f6e4806e Moved copyright notice to top of header BlackoilModelEbosTypeTags.hpp 2017-04-04 11:06:41 +02:00
Markus Blatt 29fb281406 Updated Copyright stuff 2017-04-04 11:06:41 +02:00
Markus Blatt 781eadb561 Removed unused method detail::convergenceReduction 2017-04-04 11:06:41 +02:00
Markus Blatt 0e83496740 Make getWellConvergence parallel and omit unnecessary computations.
detail::getConvergence computes a lot more than we actually need.
We only need the average over B and the maximum of the well residual.

Therefore we now compute these quantities in getWellConvergence and
do the global reductions manually.
2017-04-04 11:05:50 +02:00
Markus Blatt 4768bc9e90 Remove usage of cachedIntensiveQuantities from getWellConvergence 2017-04-04 11:05:50 +02:00
Markus Blatt f6153f8133 Factor out ewoms typetag system to separate header.
We will need the typetag information also for the wells.
If it is not in a separate header we get problems
with recursive inclusion of the headers (BlackoilEbos.hpp
includes the header that also needs the typetag information).
2017-04-04 11:05:50 +02:00
Markus Blatt 2b0a9351d5 Iterate over Interior_Partition instead of All_Partition and if-clause 2017-03-24 12:25:28 +01:00
Markus Blatt 863bef4722 Fix superfluous dereferencing that broke compilation. 2017-03-24 08:22:32 +01:00
Markus Blatt 30e8753288 Use Interior_Partition when iterating over grid instead of if(..) continue.
Makes the code a bit cleaner.
2017-03-22 11:51:52 +01:00
Markus Blatt 990ea7c44c Remove unused variable warning for endElementIt.
It was redefined and initialized in an inner scope.
2017-03-20 19:53:27 +01:00
Markus Blatt ad1fe8fac0 Prevent using dangling references in BlackoilModelEbos::getConvergence.
Using cachedIntensiveQuantities on parallel grids will cause/is causing
dereferencing a null pointer here. Therefore we resort to iterating over
the grid and using the element Context.

If this turns out ot be performance regression @andlaus owes me a beer!
2017-03-20 16:46:10 +01:00
Markus Blatt aa5940a2ff Prevent using dangling references in BlackoilModelEbos::updateState.
Using cachedIntensiveQuantities on parallel grids will cause/is causing
dereferencing a null pointer here. Therefore we resort to iterating over
the grid and using the element Context.

If this turns out ot be performance regression @andlaus owes me a beer!

Closes #1110
2017-03-20 16:46:00 +01:00
Markus Blatt 13956625b6 Removed duplicate output writer setup.
The cat must have dragged that in during some of the various rebases of this branch.
This introduced a segmentation fault as for the second setup eclIO was already null.
2017-03-17 11:08:55 +01:00
Markus Blatt bb7934b1a2 [Ebos,bugfix] Correctly compute the global number of cells.
Currently, all parallel DUNE grid store some cells in addition to
interior cells. Therefore assuming that the global number of cells
(i.e. the number of cells a sequential grid needs to cover the same
whole domain with indentical cells) is not the sum of the number of
cells of the local grid. Previously, the latter was used.
2017-03-17 10:26:00 +01:00
Markus Blatt 0650f9b42e Deactivate gather code when MPI is not available.
In this case some of the used classes do not exist.
2017-03-16 14:52:59 +01:00
Markus Blatt 35ff439ee1 Make ParallelDebugOutput constructable with global or distributed grid view.
That makes coding a little more me/fool proof.
2017-03-16 14:52:59 +01:00
Markus Blatt 03cb9f4afa ParalleDebugOutput needs the distributed grid.
Because for the global grid the communicator sees just one process.
Unfortunately this is not documented.
2017-03-16 14:52:59 +01:00
Markus Blatt 2f95e33d59 Do not use the equilGrid in Ebos as it is deleted after the constructor.
Instead we create our own global grid representation.
2017-03-16 14:52:59 +01:00
Markus Blatt fd3e3596a9 Setup output writer and write initial values in parallel correctly.
Before this commit only the solution of process 0 was written.
To fix this we make the equilGrid of Ebos available. It is used
for the output writer. The properties written initially are gathered from
all processes first using the new gather/scatter utility.
2017-03-16 14:52:59 +01:00
Markus Blatt 45cee3d9f4 Added missing header include. 2017-03-16 14:52:59 +01:00
Markus Blatt aacbdb1777 Switch off non-owner entries during accumulation.
Previously entries attached to cells that are present
on multiply processes were acumulated several times.
2017-01-11 12:20:32 +01:00
Markus Blatt 86209139db Make StandardWells support cases with no wells.
Dense case was handled in PR #1002. I was not aware that the same
regression was in the legacy code. wells_manager.c_wells() might return
a null pointer if there are no wells in the domain of a process.
2017-01-09 16:12:07 +01:00
Markus Blatt 7c91be92a9 Added missing global sum for FIP totals. 2017-01-09 15:55:39 +01:00
Markus Blatt fb55aedf4b Fix unit conversion of fip totals (pav) again.
This was (accidentally?) introduced in c880efae5b (labelled
"mostly eliminate Eigen in the FIP and VFP code"). As it is neither
present in flow_ebos nor in flow_mpi and was previously removed in
ccec17f8 (labelled "Fixed missing unit conversion for total fluid in place")
I assume that this is a bug.
2017-01-09 15:31:40 +01:00
Markus Blatt 0a904deb02 Only try to merge files from a parallel run if ouptput requested.
If it is not requested then output_dir is not created and boost
will throw an exception if we try to read from a non existing
directory.
2017-01-09 12:09:49 +01:00
Markus Blatt 601dc77a37 Fix typo in exception message 2017-01-09 11:41:34 +01:00
Markus Blatt 6b2c33978e Implement parallel fip total computation.
Up to now parallel runs aborted due to an exception with
the message "FIP not yet implemented for MPI". With this
commit we do the computation in parallel, too. And flow_ebos
runs a bit longer...
2017-01-09 11:40:57 +01:00
Markus Blatt 5bcdb01f5a Make StandardWellsDense support cases with no wells.
In that case `wells_manager.c_wells()` returns a null pointer
which made `updateListEconLimited` segfault. With this commit
we treat a null wells_struct as having zero wells.

With this this and #1001 opm-data/equilibrium at least runs
through in parallel. Results will be checked next.
2017-01-09 11:36:12 +01:00
Markus Blatt 51dabf36f2 Only log messages about failed timesteps on one processes.
This OPM_THROW was introduced lately and results in all processes
logging the failure. With this commit the message is logged only once.
2016-12-16 11:30:04 +01:00
Markus Blatt dcb3a20f7a Specialize direct solver for Dune::MatrixBlock.
In upstream they expect to be used with FielMatrix as
the block type only. Thus it it is impossible to use AMG
with a direct coarse solver within OPM. With this patch
it would be possible if we did not use field type float.
2016-12-02 15:34:31 +01:00
Markus Blatt 0179a17704 Gather well controll, too. 2016-11-21 21:20:47 +01:00
Markus Blatt f601ac4013 Gather perforation phase rates, too.
To do this we needed to switch from WellState to WellStateFullyImplicitBlackoil
as only the latter stores this information.
2016-11-21 21:19:51 +01:00
Markus Blatt 88e118d76a Consistently use WellStateFullyImplicitBlackoil in output
Otherwise we cannot write out all the data in a parallel run.
2016-11-21 21:19:51 +01:00
Markus Blatt a6c323c48b Read and write rate and pressure per well perforation when gathering. 2016-11-21 21:19:39 +01:00
Markus Blatt a16bce8785 Fixes unsused parameter warnings for ebos stuff 2016-11-21 15:23:12 +01:00
Markus Blatt 80bbabc0b6 Start with a clean globalCellData_ for each data gathering.
Otherwise there might entries from the last call that should
either not be there this time or might have a different size.
2016-11-16 21:21:51 +01:00
Markus Blatt 098bd8f9fc Added assertion that entry was added to globalCellData_ for pack/unpack 2016-11-16 21:20:14 +01:00
Markus Blatt 00440ab344 Use data::Solution to gather cell data including user requested data.
Previously only the cell data registered with SimulationDataContainer
war gathered during parallel output. User requested data was neglected
and a warning was issued. With this commit we intialize the local view
of data::Solution on all processes with the data registered in
SimulationDataContainer and add cell data requested by the user. This is
then gathered on the IO process, and used for the output layer. To
rudimentarily support matlab we also create a global view of
SimulationDataContainer for it.
2016-11-16 17:11:24 +01:00
Markus Blatt 5ad813b4bd Warn about broken parallel matlab output.
If this is a parallel run and matlab output is requested then
we issue a warning that it is broken because of wrong velocities.
2016-11-16 17:09:53 +01:00
Markus Blatt b91f747a3e Removed second implementation of matlab output.
There is already a generic one with the Grid implementation
being the template parameter in the header file. The other
implementation using UnstructuredGrid does exactly the same.
Therefore we remove it with this commit.
2016-11-16 12:16:40 +01:00
Markus Blatt 55362ecdc2 Fix spelling in warning about unhandled parallel ouput. 2016-11-15 12:08:58 +01:00
Markus Blatt 1882d3315a Do not throw for unrecognized file when merging log files.
The regex we are using might also consider a file named bla.2.blub.
In that case it is not nice to throw an exception. Instead we print
a message to std::cerr.
2016-11-11 12:00:49 +01:00
Markus Blatt 8632c71cef Do not populate cellData but issue a warning in parallel.
This will lead to some data missing in the parallel runs
but will allow successful runs.
2016-11-10 17:46:49 +01:00
Markus Blatt 747c93e898 Removed ternary operator in inline initialization.
This made the code rather hard to read. Now we do the initialization
in the constructor body if needed.
2016-11-10 13:28:21 +01:00
Markus Blatt 3eba3353d0 Correctly mark transfer of ownership for ouptut writer 2016-11-10 13:04:30 +01:00
Markus Blatt 85c0bbcc10 Indent nested #if 2016-11-09 10:08:56 +00:00
Markus Blatt 3f7f81ef03 Cater variable name change in BCRSMatrix of DUNE 2.5
One of the variables now has a trailing underline.
2016-11-08 18:59:08 +00:00
Markus Blatt 077dc02481 Fix using local active cells for writing eclipse files in parallel.
Previously, the eclipseGrid used by EclipseWriter was constructed from
the one in the EclipseState with the current CpGrid. Unfortunately the
latter was the distributed version resembling only the local part that
the processor works on. Therefore the information about the active cells
was wrong when writing results (which raised an exception in the writer).

With this commit we construct the EclipseWriter before distributing the grid
and use this writer later on in the OutputWriter.
2016-11-07 19:35:53 +01:00
Markus Blatt a7cc4962e2 Let only one rank write to step_timing.txt
All ranks were still writing to step_timing.txt at the same time.
This made it unusable for parallel runs. With this commit only
one processes writes to this file.
2016-10-14 11:14:54 +02:00
Markus Blatt a424516639 Do not refer users to issue tracker if multiple procs log.
This is currently still happening due to the implementation of
OPM_THROW whenever the linear solver does not converge. This
happens quite often and we might not want to get overwhelmed by
the issue tracker.
2016-10-14 10:47:16 +02:00
Markus Blatt 828f118801 Do not store collective communication in the wells object.
Instead of this we rely on the default constructor of
WellSwitchingLogger. This finally fixes the compile
issues with DUNE 2.3.
2016-10-07 10:46:54 +02:00
Markus Blatt 3e6b1949ea Make sure that updateWellControls is called on each process.
The new WellSwitchingLogger within updateWellControls uses
collective communication with all processes. Therefore all
of them need to enter the function as other flow_mpi will deadlock.
Therefore this commit calls the method even with non local wells
active.
2016-10-05 23:53:43 +02:00
Markus Blatt 2a1388d124 Make WellSwitchingLogger work with DUNE 2.3
That version does not provide a default constructor for
CollectiveCommunication, Therefore we now use
MPIHelper::getCollectiveCommunication() for the default
constructor argument.
2016-10-05 16:13:11 +02:00
Markus Blatt 14eeb7c39a Removed warning in WellSwitchLogger::calculateMessageSize 2016-10-05 13:51:08 +02:00
Markus Blatt 3dbc6f5500 Correctly initialize MPI for multisegment wells test 2016-10-05 12:29:56 +02:00
Markus Blatt 99bf74c705 Changed some names in WellSwitchingLogger 2016-10-05 11:45:59 +02:00
Markus Blatt 80fb5b66d7 Use speaking name for bool in getCellData 2016-10-05 11:45:59 +02:00
Markus Blatt ab05cb66d9 Whitespace and other formatting changes 2016-10-05 11:45:51 +02:00
Markus Blatt d86f552a76 Added missing const reference to constructor argument 2016-10-05 11:39:28 +02:00
Markus Blatt bfb7ccfa8b Moved ParallelFileMerger to its own file. 2016-10-05 11:39:06 +02:00
Markus Blatt c0ca9afe5a Prevent loss of log messages in parallel by merging multiple files.
This completes f94459d5ed
Each process with rank >0 will use .<deckname>.<rank>.DEBUG, and
<deckname>-<rank>.PRT for logging (instead of <file>.<rank>as before.
After the simulator has finished running we will append the content
of those files to the usual log files. If these files have a non-zero
size we will omit a warning as this should not happen if logging is
done right.
2016-10-05 10:33:15 +02:00
Markus Blatt 07318edfa1 Added a parallel aware logger for switching wells.
It will collect all the switches. Afterwards they are collect on
the root process and logged there.

This commit includes a small test program.
2016-10-05 10:33:15 +02:00
Markus Blatt 02e8211067 Use <FILE>.<rank for nonzero ranks to capture fallout.
These files will be empty unless we fail to to log messages
only on the root process. Currently that is the case for
the messages about switching the well controls.
2016-10-05 10:33:15 +02:00
Markus Blatt fd52d0e223 Print "Reading parameters" only once in parallel. 2016-10-05 10:33:15 +02:00
Markus Blatt 12b3456f3b Fixup 46e22f515 2016-10-05 10:33:15 +02:00
Markus Blatt c5fd95affe Stop creating file outside output_dir for parallel runs.
Only the root process did set the output_dir correctly. Others
used the default. Therefore all messages logged by non-root
processes did end up in the current directory even if an
output_dir was passed to flow_mpi.
2016-10-05 10:33:15 +02:00
Markus Blatt 61a28cf12f Disable relperm diagnosis for non-root processes 2016-10-05 10:33:15 +02:00
Markus Blatt 81a617e892 Switch off output in EclipsePRTLog for non-root processes. 2016-10-05 10:33:15 +02:00
Markus Blatt 70d4dedfd2 Omit deck check warnings on non-root processes 2016-10-05 10:33:14 +02:00
Markus Blatt 6d0d063413 Omit "Unhandled keyword" messages on non-root processes 2016-10-05 10:33:14 +02:00
Markus Blatt d4b818c948 Omit fluid in place messages on non-root process 2016-10-05 10:33:14 +02:00
Markus Blatt fd24070931 Omit "well converge" on non-root process 2016-10-05 10:33:14 +02:00
Markus Blatt 2a6494cfcd Only extract parser message on process 0 2016-10-05 10:33:14 +02:00
Markus Blatt 66f0b71fc1 Log the message of exceptions in the catch clause of adaptive time stepper. 2016-10-04 10:33:56 +02:00
Markus Blatt 0bdab6e579 Correct number of (nonlineat) iterations/linearizations in step_timing.txt
Previously, for all step zero was reported. With this commit
we set these numbers in the SimulatorReport and now they end
up correctly in step_timings.txt
2016-09-28 12:05:52 +02:00
Markus Blatt 815480d052 Only call writeTimeStep for real sub steps.
Previously, we also called it when the full time step was done.
As the simulator writes that information anyway and we cannot call
it a sub step, we omit the final write in the adaptive time stepper.
2016-09-26 11:51:17 +02:00
Markus Blatt 2c70f05d6b Correctly parallelize computeFluidInPlace.
Its first implementation computed wrong results in parallel. With this commit
we noe have completely parallelized the computations and the results seem correct
for parallel runs with norne.
2016-09-15 15:43:08 +02:00
Markus Blatt e15f9bfb9c Save space in computeFluidAndSpace.
Both hcpv and res will be used to save only dims elements. As dims
will most likely be much smaller than the number of cells, we only
allocate containers of size dims with this commit.
2016-09-15 15:35:27 +02:00
Markus Blatt 8c18bfcc50 Added missing include for unordered_set.
This is what the travis build
https://travis-ci.org/OPM/opm-simulators/builds/159576974 complained about.
2016-09-14 14:41:27 +02:00
Markus Blatt 63d785d7ba Work around explicit empty constructor of unordered_set in C++11
With GCC version (Debian 4.9.2-10) 4.9.2 we get the following error
when compiling with -std=c++11 (default for dune 2.4):

converting to ‘const std::unordered_set<std::basic_string<char> >’ from initializer list would use explicit constructor
2016-09-13 10:58:26 +02:00
Markus Blatt 33edf62a78 Use set of names of defunct wells from load balancer for parallel WellManager.
Instead of the WellsManager guessing which wells are handled by other
processes we now use tha ouput of the load balancer to compute wells
that are handled by other processes.

With the previous approach it was not possible to calculate this information
correctly. Wells with only one completion next to the border of the
processes' partition were represented on multiple processes. In additition
wells that the eclipse schedule section defined with completions on non-active
cells in sequential runs were not at all calculated in parallel runs.

With the new approach the CpGrid::loaBalance routine returns the set names of
wells that are not handled by this process when setting up the simulation. This
information is then used throughout the simulation.
2016-09-13 10:58:26 +02:00
Markus Blatt 4a6be3d33b Fix step number used to create global well state in parallel output.
When running in parallel a well state object with the well information
of the whole grid needs to constructed to gather the information from all
processes. Previously, this was done with the report step exported by the
timer. This was wrong for the following reason:
The output occurs after solving the time step and the timer is already
incremented. This means that we constructed the well state for gathering the
data for the next report step, already. Unfortunately, at that step some
wells that we have computed results for might have been shut. In that case
an exception with message "global state does not contain well ..." was thrown.

This problem occured for Model number 2 and might have been due to shut wells
because of banned cross flow.

With this commit we use the last report step if this is not an initial write
and not a substep.
2016-09-02 14:41:47 +02:00
Markus Blatt 5ecead8e6f OutputWriter::writeTimeStep needs the report step and not the sub step.
At least that is what is documented.
2016-09-02 14:41:47 +02:00
Markus Blatt b6c06738b5 Do not assume ordering in an unordered_map when gathering data.
The order of an unordered_map is quite unpredictable. (The same
order will only hold with the same hash function, comparison
operator, and insertion order). Therefore we cannot assume that
the global SimulationDataContainer uses the same order for the
cell data as the local one (This was done before this commit).
But we can assume that the local one uses the same order on every
process.

Before this commit data got mixed up (e.g. gasoilratio with surfacevol)
when gathering local data for writing eclipse files on the master
process. This commit fixes this.

Instead of iterating over the cell data of the global state when
writing the data received, we again iterate over the cell data of
the local state and simply use the key to request the correct data
for writing from the global state.
2016-07-25 17:17:06 +02:00
Markus Blatt d6aea1663d Call writeInit with global grid and properties.
Previously, the call was made after the grid was distributed.
This means that each process wrote it, but only with his cells
active which was just a part of the whole domain.

With this commit we make the writeInit call before distributing the
grid and make sure that only one process calls it.
2016-07-22 17:37:14 +02:00
Markus Blatt fb76737bea Moved step_msg inside if-branch
as it is not used outside of it.
2016-07-04 15:07:02 +02:00
Markus Blatt 047ae8f444 Use termininal_output_ to only print time step status once for parallel runs.
Previously each process printed this to the terminal
2016-07-04 13:46:29 +02:00
Markus Blatt 79670b1c29 Prevent signed-unsigned-comparison warning. 2016-06-28 15:50:50 +08:00
Markus Blatt c7cca46b2c Adds missing parallel reduction to euclidianNorm for multiple components 2016-06-28 15:50:50 +08:00
Markus Blatt 72d0b8123b Fixes the parallel Euclidian product for multiple phases.
This is used to compute the Euclidian product for the saturations.
Thes are ordered in an interleaved manner (all saturations for cell
with index 0, the all for index 1, ...). Up to now the implementation
assumed a different ordering: blockwise (all saturations for phase 0 first,
then all saturations phase 1, ...).
With this commit the computation uses the right assumption.
2016-06-28 15:50:50 +08:00
Markus Blatt 302d881557 Removed trailing underscore for local variable. 2016-06-28 15:50:50 +08:00
Markus Blatt b4feb28389 Make numWellVars work for null well pointers. 2016-06-28 15:50:50 +08:00
Markus Blatt 1a1797a061 Set wellsActive to false for null well pointers. 2016-06-28 15:50:50 +08:00