Skip to content

Commit

Permalink
Merge Pull Request trilinos#11950 from vbrunini/Trilinos/vebruni/fix_…
Browse files Browse the repository at this point in the history
…fastilu_memory_leak

Automatically Merged using Trilinos Pull Request AutoTester
PR Title: fastilu: Fix memory leak.
PR Author: vbrunini
  • Loading branch information
trilinos-autotester committed Jun 7, 2023
2 parents ea7ea22 + 6c32ee1 commit 563e453
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions packages/shylu/shylu_node/fastilu/src/shylu_fastilu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,32 +451,30 @@ class FastILUPrec
using std::sort;
OrdinalArrayMirror ia = aRowMapHost;
OrdinalArrayMirror ja = aColIdxHost;
int *nzu;
int *nzl;
nzu = new int[1];
nzl = new int[1];
int nzu;
int nzl;
Ordinal i;

//Compute sparsity structure of ILU
*nzl = aRowMapHost[nRows];
*nzu = aRowMapHost[nRows];
nzl = aRowMapHost[nRows];
nzu = aRowMapHost[nRows];

*nzl *= (level + 2);
*nzu *= (level + 2);
nzl *= (level + 2);
nzu *= (level + 2);
vector<int> ial(nRows+1);
vector<int> jal(*nzl);
vector<int> levell(*nzl);
vector<int> jal(nzl);
vector<int> levell(nzl);
vector<int> iau(nRows+1);
vector<int> jau(*nzu);
vector<int> levelu(*nzu);
vector<int> jau(nzu);
vector<int> levelu(nzu);

// TODO: if (initGuess & level > 0), call this with (aRowMap_, aColIdx_) and level = 1
findFills(level, aRowMapHost, aColIdxHost, // input
nzl, ial, jal, levell, // output L in CSR
nzu, iau, jau, levelu // output U in CSR
&nzl, ial, jal, levell, // output L in CSR
&nzu, iau, jau, levelu // output U in CSR
);
int knzl = *nzl;
int knzu = *nzu;
int knzl = nzl;
int knzu = nzu;
#ifdef FASTILU_INIT_TIMER
std::cout << " findFills time : " << timer.seconds() << std::endl;
timer.reset();
Expand Down

0 comments on commit 563e453

Please sign in to comment.