Deallocate all the assigned memory in one go when MODFLOW finalizes #2156
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To optimize the deallocation of variables when MODFLOW finalizes, this PR moves the responsibility of deallocation to a single method instead of having the responsibility per package.
Add the moment the responsibility is moved away from the packages by simply having the mem_deallocate return immediately. In the end the entire mem_deallocate method should be removed
@mjr-deltares provided a test-case to stress test the deallocation of variables.
The test case consist of 1521820 variables and a single timestep.
The time from start to till completion of the solution is about 5 seconds. The remainder of the time is spent finalizing the simulation.
The total time spent running the simulation is:
Checklist of items for pull request
ruff
on new and modified python scripts in .doc, autotests, doc, distribution, pymake, and utils subdirectories.fprettify
For additional information see instructions for contributing and instructions for developing.