Fix leak in new csr/cscLayout records' implementation #26193
Merged
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.
In re-implementing the technique that I used for
blockDist
as a record, I cut a corner too fast and failed to create a destructor for thecsr/cscLayout
records that would free up its distribution class. Here, I add in a variation of the deinitializer forblockDist
, but simplified due to the fact that this is a single-locale, completely local layout. I also made the cloning-style initializer do a deep copy of the class from the other initializer rather than sharing, as before, to avoid correctness errors.An unexpected benefit of these changes is that communication was also reduced for a few of our benchmarks that measure communication for CSR/CSC-related codes, including the sparse matrix-matrix multiplication routines, seemingly due to the new clone code resulting in local copy of the class rather than a remote one.