Skip to content

How to free memory of SuperLU_dist solver? #52

@cdelv

Description

@cdelv

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions