Commit Graph
19733 Commits
Author SHA1 Message Date
Magne Sjaastad 7b11292839 #14596 Skip computing corner coordinates for cells excluded by the K filter
Move the call to cellCornerVertices below the K filter early out, so the corner coordinates are only computed for the cells that are actually tested against the polygon.
2026-08-25 08:22:29 +02:00
Magne Sjaastad 4a6ebedade #14596 Name the remaining unnamed OpenMP critical sections
All unnamed critical regions map to the same implicit name, so a single process wide lock was shared by summary import, geometry generation, grid bounding box computation and NNC merging. Unrelated parallel loops therefore serialized against each other.

Give each region a critical_section_ name describing what it protects. The two regions guarding RifOpmCommonEclipseSummary::sm_createdEsmryFileCount deliberately share one name, as they protect the same counter.
2026-08-25 08:22:29 +02:00
Magne Sjaastad 63f73a2154 #14596 Document OpenMP conventions for agents
Describe the OpenMP 2.0 constraints that follow from building with MSVC /openmp, and why an orphaned work sharing construct can deadlock the application when the master thread is also the Qt GUI thread.

Also document the pattern of collecting results in per thread buffers and merging after the parallel region, the convention of naming critical sections, and the rule that exceptions must not escape a structured block.
2026-08-25 08:22:29 +02:00
Magne Sjaastad eec9a88bd3 #14596 Collect cells per thread in polygon filter instead of using critical sections
All four cell filter loops guarded a push_back into a shared container with an unnamed critical section, taking a process wide lock for every cell matching the polygon. On large grids with a permissive polygon this can be slower than running single threaded, and it made the resulting cell order vary between runs.

Collect the cells in per thread buffers and append them in thread order after the parallel region, following the pattern used elsewhere in the code base. This removes eight critical sections.
2026-08-25 08:22:29 +02:00
Magne Sjaastad 5c325dcc0b #14596 Remove unnecessary critical section in RiaCurveMerger
Each iteration writes to its own element of accumulatedValidValues, which is sized before the loop, so no synchronization is required. The write to curveValues a few lines below uses the same pattern without a critical section.

All unnamed critical regions share a single process wide lock, so this also removes contention against unrelated parallel loops.
2026-08-25 08:22:29 +02:00
Magne Sjaastad ad0f5f1bce #14596 Remove dead ordered clause and per-triangle lock in NNC geometry generation
The loop was declared with an ordered clause, but the body contains no ordered region, so the clause only enabled the ordered scheduling machinery without providing any ordering. The intended deterministic vertex order was not achieved either, because the actual synchronization was a critical section, which does not preserve iteration order.

Collect vertices in per thread buffers and merge them in thread order after the parallel region, following the pattern already used in RivFaultGeometryGenerator. This removes a lock acquisition per triangle in the innermost polygon loop, and makes the generated geometry identical from run to run.
2026-08-25 08:22:29 +02:00
Magne Sjaastad fa85100da7 #14596 Remove dead reserve and redundant barrier in NNC computation
totalNumberOfConnections was declared, listed in the reduction clause and used to size otherConnections, but it was never incremented. The counting was lost when the loop body was moved into extractConnectionsForFace, so the call has always been reserve( size() + 0 ), which RigConnectionContainer::reserve turns into a no-op.

The reserve was also called by every thread on the shared container without synchronization. Removing it eliminates that data race. The explicit barrier is redundant as well, since the omp for construct has no nowait clause and therefore already synchronizes before the merge.
2026-08-25 08:22:29 +02:00
Magne Sjaastad a7684a14d6 #14596 Use #pragma omp parallel for when building corner point grids
The loops were annotated with #pragma omp for, which is a work-sharing construct that does nothing outside an enclosing parallel region. Replace it with #pragma omp parallel for so the cell loops actually run in parallel.
2026-08-25 08:22:29 +02:00
Magne Sjaastad d2862941f6 #14596 Remove stray #pragma omp for in cvfqt::Utils::toTextureImageRegion
The pragma had no enclosing parallel region, so it did not parallelize anything and only added confusion.

This code caused a deadlock on Windows for the following workflow:
1. import a grid model
2. Import a large summary ensemble with no ESMRY that triggers display of a progress dialog. Make sure the progress dialog is displayed on top of the 3D models -> deadlock
2026-08-25 08:22:29 +02:00
Kristian Bendiksen 565d7b7819 #14571 Orion Events: Expand Python usage examples 2026-08-24 13:26:19 +02:00
Kristian Bendiksen 41b7df5a20 #14571 Orion Events: Preserve post-processed events during merge 2026-08-24 13:26:19 +02:00
Kristian Bendiksen 64317dfad7 #14575 Orion Events: Rename WELLSPEC event to WELSPECS 2026-08-24 13:26:19 +02:00
Kristian Bendiksen da6eb2062c Orion Events: Align imported schedule output in example code 2026-08-24 13:26:19 +02:00
Kristian Bendiksen 0adf471a5d #14514 Orion Events: Include report dates in schedule 2026-08-24 13:26:19 +02:00
Kristian Bendiksen 15adbeb9a1 #14575 Orion Events: Add context to validation errors 2026-08-24 13:26:19 +02:00
Kristian Bendiksen e1b192ff86 #14570 Orion Events: Fix schedule user metadata 2026-08-24 13:26:19 +02:00
Kristian Bendiksen d6878ea562 #14513 Orion Events: Add raw schedule text events 2026-08-24 13:26:19 +02:00
Kristian Bendiksen 1803c636a5 Python: Fix keyword event example rendering 2026-08-24 13:26:19 +02:00
Kristian Bendiksen 2ef4814257 #13672 Python: Add APIs to arrange and link views 2026-08-24 12:43:44 +02:00
Magne Sjaastad c9750f4698 Avoid crash when grid data is missing in shared grid ensemble 2026-08-24 09:10:22 +02:00
Magne Sjaastad a6b903acf3 Avoid terminate on parse error in element property file 2026-08-24 09:10:22 +02:00
Magne Sjaastad d53e5b48b3 Avoid GUI cleanup on a main window being destroyed 2026-08-24 09:10:22 +02:00
Magne Sjaastad 7032832774 Avoid crash when displacements are missing for GeoMech intersections 2026-08-24 09:10:22 +02:00
Magne Sjaastad abefc17f3f CI: Reduce Actions cache pressure in ResInsightWithCache
Only save the buildcache from the default branch. GitHub scopes cache writes to the current ref, so a cache saved from a feature branch or PR is invisible to every other branch while still counting against the 10 GB per-repository quota and evicting the shared caches on the default branch.

Disable unity build for all configurations. Unity blobs invalidate on any change to the sources they bundle, which defeats buildcache reuse and fills the cache with objects that are unlikely to be hit again.
2026-08-22 16:42:24 +02:00
Magne Sjaastad c6c5ff5808 #14584 Move ResInsight-tests out of the shared build root
ResInsight-tests linked into the build root and copied its full runtime DLL
set there as a POST_BUILD step, the same pattern that made
extract-projectfile-versions race against the generated_classes.py edge. The
set is a superset of the one that failed, covering Qt6Gui, Qt6Widgets and the
rest, and nothing orders it against the code generation edge either. It fires
rarely only because copy_if_different compares content, so windeployqt having
already placed identical DLLs makes it a no-op. On a cold build where the copy
wins that race it genuinely writes.

Give the target its own RUNTIME_OUTPUT_DIRECTORY, and point the companion
PreBuildFileCopyTest target at the same directory so the ODB, OpenVDS and HDF5
runtime files stay next to the executable. That target runs before the link
creates the directory, so create it first.

Update the three workflows that run the test executable by path.
2026-08-22 11:50:55 +02:00
Magne Sjaastad f68c0fe2cb #14584 Fix Windows build race copying Qt DLLs into the build root
extract-projectfile-versions linked into the shared build root and copied
Qt6Core.dll and Qt6Sql.dll next to its executable as a POST_BUILD step. The
generated_classes.py edge runs ResInsight.exe out of that same directory with
those DLLs loaded, and nothing orders the two edges relative to each other, so
Ninja was free to schedule them concurrently. Overwriting a mapped DLL is a
sharing violation on Windows, which failed the copy and took the build down.

Give the target its own RUNTIME_OUTPUT_DIRECTORY. It is a standalone developer
tool with no reason to share the application output directory, so moving it
removes the conflict instead of narrowing it. Also switch the copy to
copy_if_different, matching the equivalent step in the unit test target.
2026-08-22 11:50:55 +02:00
JJ e9b60d7167 Add tile windows feature (#14583)
Support tiling and maximizing views
2026-08-21 16:25:32 +02:00
Magne Sjaastad 135ed69369 #14559 Summary Calculator: Update dependent data when the last calculation is deleted
deleteCalculation() removes the calculation before rebuildCaseMetaData() is called, and updateDataDependingOnCalculations() returned early for an empty collection. The addresses created by the last calculation were then left behind in the readers until the next refresh or a reload of the project.

Perform one more update after the last calculation is deleted, and keep the early return for the case where no calculations have been present.
2026-08-21 15:54:28 +02:00
Magne Sjaastad 1778a9637b #14559 Delta Ensemble: Refresh calculated addresses for all realizations
A delta ensemble creates summary addresses for all realizations of the source ensembles. When a calculation was created after this, only the realizations showing tree nodes had their addresses recreated. The other realizations had no calculated address, and RimDeltaSummaryCase::values() discarded the vector as being present in only one of the source ensembles. Only realization 0 was plotted until the project was reloaded.

Add RifSummaryReaderInterface::refreshCalculatedAddresses() to recreate the addresses of the calculated readers without touching the native readers, and call it for all cases in an ensemble when calculations are updated.
2026-08-21 15:54:28 +02:00
Magne Sjaastad 2a35edcca9 #14555 Make sure views in a grid ensemble are updated when a grid calculation is evaluated
A case in a grid ensemble is displayed by views in the view collection of the grid ensemble, but RimEclipseCase::reservoirViews() only inspected the view collection of the case itself and the global view collection. No views were found for such a case, so the display model was never rebuilt after a grid calculation was evaluated. When loading a project file, the view was left with the display model created before the calculation was evaluated, showing no legend and no cell colors.
2026-08-21 14:53:48 +02:00
Magne Sjaastad 6022980d54 #14555 Allow statistical grid cases to be used as source for grid calculator expressions
Statistics cases were filtered out of the case lists used by the grid calculator, both in the variable table and in the Select Result dialog. Statistics cases belonging to a grid ensemble were also missing from RimProject::allGridCases(), as only the source cases of the ensemble were collected. Statistics cases in a grid case group were already included.

A statistics case can be used as source only. A calculated result stored in a statistics case is interpreted as computed statistics, and would block recomputation of the statistics, so a statistics case is never assigned as destination case.

A statistics case with no computed statistics is not necessarily opened. Make sure source cases are opened before grid dimensions are validated and before result data is read.
2026-08-21 14:53:48 +02:00
Magne Sjaastad e2319d0bd3 #14566 OpenTelemetry: stop unbounded log flood on send failures
Send one batched request per event batch instead of one request per event.
Application Insights v2/track accepts an array of envelopes, so a batch of up
to maxBatchSize (512) events was previously issued as 512 concurrent POSTs.
QNetworkAccessManager only opens a handful of connections per host, so the
queued requests were aborted by their own transfer timeout before reaching the
wire, reported as "HTTP 0: Operation canceled".

Honour the circuit breaker in processEvents(). It was only checked when
enqueuing, so the up to 10000 already queued events kept being posted at full
rate after the breaker opened. The crash and shutdown flush bypasses the
breaker so a crash report is still attempted.

Keep at most one request in flight. Failures are only observed when the reply
finishes, which for an unreachable endpoint takes the full transfer timeout,
and the 100 ms timer kept launching requests during that window.

Log the circuit breaker transition once instead of on every subsequent failure.

Only read the reply body when the device is open. An aborted reply has a closed
device, and reading from it emitted a QIODevice warning per request.

Call attemptReconnection() from the process timer. It was dead code, so once
the breaker opened it could only close if a reply happened to succeed.
2026-08-21 14:37:58 +02:00
Magne Sjaastad f13fbbbd87 #14565 Grid model results: Make SGAS for Two-phase Gas/Water models when missing in output
Simulators for two-phase gas/water models may report only SWAT. In this case no SGAS result entry was created, so SGAS was missing from the result list and TERNARY fell back to computing SOIL = 1 - SWAT, presenting the gas saturation as oil saturation.

Add RigSgasResultCalculator that creates a placeholder SGAS entry when the model has gas and water but no oil phase, SWAT is present and SGAS is missing. SGAS is then computed as SGAS = 1 - SWAT. The computation is dispatched from findOrLoadKnownScalarResult() and findOrLoadKnownScalarResultForTimeStep() the same way as SOIL.

The equivalent logic in RigCaseCellResultsData::testAndComputeSgasForTimeStep() was only reachable from RigSoilResultCalculator, which never runs for models without an oil phase. This function is replaced by computeSgasForTimeStep() delegating to the new calculator, and the unreachable call in RigSoilResultCalculator is removed.
2026-08-21 14:36:22 +02:00
magnesj 51a62edec9 Bump to version 2026.06.2-dev.05 2026-08-21 11:43:36 +02:00
Kristian Bendiksen fb0b05958f Python: Reject ambiguous generated enum names 2026-08-21 11:42:34 +02:00
Kristian Bendiksen 51aa090668 Python: Restore WellTypeForExport enum export 2026-08-21 11:42:34 +02:00
Magne Sjaastad 5b6307bc81 #14563 Fix truncated display of axis values for summary data
The 'g' number format interprets the precision as the number of significant digits, not as the number of decimals. Using the number of decimals directly caused tick labels to be rounded to too few digits, so 10.5 was displayed as 11 and the same label could appear twice. Add the number of integer digits to the precision when the automatic number format is used.
2026-08-20 15:20:58 +02:00
Magne Sjaastad fad56ae483 #14562 Summary Plot Editor: Improve default source selection
Select the first ensemble when no top level summary cases are available, and never use a realization of an ensemble as the default source. The default source is now resolved by RiuSummaryVectorSelectionUi::defaultSummarySource(), used both when the editor is opened without a selection and when the editor is populated from a plot without curves. Also guard against a null curve set when matching ensemble curve sets in the preview plot.
2026-08-20 15:20:58 +02:00
Jørgen Herje 0d9d4fed19 Improved Sumo summary data fetching (#14551)
Sumo data is loaded so the application stays responsive while it waits.

Run Sumo transfers on a dedicated thread
Split RiaSumoConnector into transport and data delegates
Load Sumo summary vectors concurrently and without waiting
Show that Sumo data is being loaded
2026-08-20 11:48:25 +02:00
Magne Sjaastad 9b268e6d98 #14543 Use time from simulation start in Show Plot Data
When the summary plot time axis is configured to show time from simulation start, the text produced by Show Plot Data and the ASCII export now reports the same values instead of date and time. The time column header becomes "Time [<unit>]", and each row reports the elapsed time relative to the first time step of the first curve, scaled to the display unit selected on the time axis. Plots using the date based time axis are unchanged.

Time in months and years is computed using calendar arithmetic instead of a fixed number of seconds per unit, so a time step exactly N calendar months or years after the simulation start reports exactly N. This makes resampled data report whole numbers also when a leap year is part of the interval. The calendar arithmetic is available as RiaQDateTimeTools::calendarYearsBetween() and calendarMonthsBetween(), and is used both when plotting the curves and when reporting the time column.
2026-08-20 11:26:56 +02:00
Kristian Bendiksen ce12272721 #14557 Orion Events: Rename tubing event to segment 2026-08-20 11:02:55 +02:00
Kristian Bendiksen db1c1f1f13 #14554 Orion Events: Add WELLSPEC event 2026-08-20 11:02:55 +02:00
Kristian Bendiksen 3947e5ee4e Orion Events: Expand experimental schedule example 2026-08-20 11:02:55 +02:00
Kristian Bendiksen 27b45353ea Orion Events: Add restart schedule cutoff 2026-08-20 11:02:55 +02:00
Kristian Bendiksen 1278ee2404 Orion Events: Add group member events 2026-08-20 11:02:55 +02:00
Kristian Bendiksen c94d00a02a Orion Events: Merge matching dated events 2026-08-20 11:02:55 +02:00
Kristian Bendiksen 61f615ac4c Orion Events: Preserve event comments 2026-08-20 11:02:55 +02:00
Kristian Bendiksen c41e74b706 Orion Events: Verify aligned schedule columns 2026-08-20 11:02:55 +02:00
Kristian Bendiksen a362f868c3 Orion Events: Generate COMPORD for new wells 2026-08-20 11:02:55 +02:00
Kristian Bendiksen 0b7ce2252c Orion Events: Add schedule generation metadata 2026-08-20 11:02:55 +02:00