Skip to content

Improve parallel performance - #177

Open
dbrakenhoff wants to merge 10 commits into
devfrom
improve-parallel-mp
Open

Improve parallel performance#177
dbrakenhoff wants to merge 10 commits into
devfrom
improve-parallel-mp

Conversation

@dbrakenhoff

@dbrakenhoff dbrakenhoff commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

This PR fixes memory usage issues related to parallel processing. Before the entire model class was sent over to each process for each task, this quickly grew the memory used to significant amounts, especially, for larger models and lots of points at which to compute the heads.

This is now fixed by setting up a single model on each worker, then performing all calculations using those copied models.

Some additional changes:

  • tqdm is now a required dependency.
  • progress bars are shown by default but can be turned off.
  • parallel can be set to True/False or a number, if a number, use that many workers
  • better default number of workers when parallel=True

dbrakenhoff and others added 6 commits August 26, 2026 13:41
For semi-confined aquifers (ilap == 0) in steady models, the vcontour_array
method was using aq.z for z-coordinates which includes all layer boundaries
(leaky and aquifer), but the arr array only had values for aquifer layers.
This caused dimension mismatches or incorrect contour plots.

The fix builds a z array that matches the structure of the arr array:
- z[0] = top boundary (where head = hstar)
- z[1], z[3], ... = aquifer tops
- z[2], z[4], ... = aquifer bottoms

This ensures dimensions always match and the head values are properly
aligned with the z-coordinates.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
- send one model copy per worker
- modify disvec signature to match head
- parallel progressbars updates per completed chunk
- add disvec_array method
@dbrakenhoff
dbrakenhoff requested a review from mbakker7 August 26, 2026 13:08
@dbrakenhoff dbrakenhoff self-assigned this Aug 26, 2026
@dbrakenhoff dbrakenhoff added the bug Something isn't working label Aug 26, 2026
- use passed in x1 if x1 is finite, otherwise compute x1 from x2 - some offset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant