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

fixing memory leaks in cuSolver #554

Merged
merged 2 commits into from
Oct 4, 2022
Merged

fixing memory leaks in cuSolver #554

merged 2 commits into from
Oct 4, 2022

Conversation

kswirydo
Copy link
Collaborator

@kswirydo kswirydo commented Oct 1, 2022

I fixed several memory leaks (9 variables were not freed and 1 was freed without a guard).

At the end of hiopLinSolverSymSparseCUSOLVER::refactorizationSetupCusolverRf(), I added

 cudaFree(d_Lp_csr);
    cudaFree(d_Li_csr);
    cudaFree(d_Lx_csr);

    cudaFree(d_Up_csr);
    cudaFree(d_Ui_csr);
    cudaFree(d_Ux_csr);

In the ~hiopLinSolverSymSparseCUSOLVER(), I added

 if(refact_ == "rf") {
      cudaFree(d_P_);
      cudaFree(d_Q_);
      cudaFree(d_T_);
    }

In IR class, in hiopLinSolverSymSparseCUSOLVERInnerIR::~hiopLinSolverSymSparseCUSOLVERInnerIR(), I added:

    if(orth_option_ == "cgs2") {
      cudaFree(d_H_col_);
    }

@kswirydo kswirydo requested a review from pelesh October 1, 2022 02:53
@pelesh
Copy link
Collaborator

pelesh commented Oct 2, 2022

PNNL pipelines are broken, so they are giving false negatives.

CC @cameronrutherford

@cameronrutherford
Copy link
Collaborator

cameronrutherford commented Oct 2, 2022

@jdmacam is helping with this. I think since they aren't a part of @LLNL I can't quite tag them/assign them to this PR

Co-authored-by: pelesh <peless@ornl.gov>
Copy link
Collaborator

@pelesh pelesh left a comment

Choose a reason for hiding this comment

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

This is safe to merge. PNNL pipelines have been fixed and all tests pass.

@cnpetra cnpetra merged commit a0b07f4 into develop Oct 4, 2022
@cnpetra cnpetra deleted the cusolver-memleak-fix branch September 11, 2023 17:15
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.

None yet

4 participants