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

How to free memory of SuperLU_dist solver? #52

Open
cdelv opened this issue Jul 19, 2021 · 2 comments
Open

How to free memory of SuperLU_dist solver? #52

cdelv opened this issue Jul 19, 2021 · 2 comments

Comments

@cdelv
Copy link

cdelv commented Jul 19, 2021

Hi, I'm using SuperLU with MFEM to solve Stokes equations. The solver works very well. But I noticed that if I made a for loop of the part of the solver and call the solver over and over again, it starts using more and more memory. Even though I'm deleting the solver's pointer.

    HypreParMatrix *H = HypreParMatrixFromBlocks(hBlocks, &blockCoeff);

    SuperLUSolver *superlu = new SuperLUSolver(MPI_COMM_WORLD);
    Operator *SLU_A = new SuperLURowLocMatrix(*H);
    superlu->SetOperator(*SLU_A);
    superlu->SetPrintStatistics(true);
    superlu->SetSymmetricPattern(true);
    superlu->SetColumnPermutation(superlu::PARMETIS);
    superlu->SetIterativeRefine(superlu::SLU_DOUBLE);

    //Solve the linear system Ax=B
    X.Randomize();
    superlu->Mult(B, X);
    //Delete used memory
    delete H;
    delete superlu;
    delete SLU_A;

I tried to use delete[] superlu and other ways of freeing the memory but nothing works. It's important to make that work because I want to use the solver in conjunction with a time-dependent problem and I have to call it multiple times. What should I do to fix the problem?

@cdelv cdelv changed the title How to free memory of SuperLU_dist solver How to free memory of SuperLU_dist solver? Jul 19, 2021
@xiaoyeli
Copy link
Owner

xiaoyeli commented Jul 20, 2021 via email

@cdelv
Copy link
Author

cdelv commented Jul 20, 2021

To complement this @xiaoyeli , I have been searching for a potential solution and found this http://www.elmerfem.org/forum/viewtopic.php?t=3625. I also have found people reporting similar leaks.

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

No branches or pull requests

2 participants