Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix leak in new csr/cscLayout records' implementation #26193

Merged
merged 2 commits into from
Nov 1, 2024

Conversation

bradcray
Copy link
Member

@bradcray bradcray commented Nov 1, 2024

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 the csr/cscLayout records that would free up its distribution class. Here, I add in a variation of the deinitializer for blockDist, 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.

---
Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
This also reduced some comm counts, so ... bonus!

---
Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
@bradcray bradcray merged commit d549d7c into chapel-lang:main Nov 1, 2024
7 checks passed
@bradcray bradcray deleted the fix-csr-leak-1 branch November 1, 2024 04:32
Copy link
Contributor

@e-kayrakli e-kayrakli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Post-merge) Looks good!

@bradcray
Copy link
Member Author

bradcray commented Nov 1, 2024

Thanks Engin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants