[Trilinos-Users] Amesos memeory leak?

Burkhard Doliwa doliwa at temf.tu-darmstadt.de
Tue Oct 25 05:42:21 MDT 2005


Hi all,

I am using the following version of an Amesos driver routine. Several 
calls to this routine (via function amesos, see below) lead to a 
continous increase in memory usage within the program. Can it be that 
there is some hidden memory leak present in amesos_driver2(...)?

Thanks,
Burkhard



int amesos_driver2(Epetra_CrsMatrix* A0, Epetra_MultiVector* x, 		 
Epetra_MultiVector* b) {

	A0->FillComplete();
	// THIS CONVERSION IS ESSENTIAL SINCE KLU IS SERIAL!?????
	Amesos_TestRowMatrix A(A0);

	Epetra_LinearProblem Problem;
	Amesos_Klu Solver(Problem);

	Problem.SetOperator(&A);
	Problem.SetLHS(x);
	Problem.SetRHS(b);

	Solver.SymbolicFactorization();
	Solver.NumericFactorization();
	Solver.Solve();

	return 0;
}


int  amesos(const MatrixEpetra& A0, VectorDense<double>& x0, const 		 
VectorDense<double>& b0)
{
	Epetra_CrsMatrix * A = A0->pmat;
	double* x_pr = x0->contigous_array(); // use views of arrays
	double* b_pr = b0->contigous_array();

	assert (x_pr);
	assert (b_pr);
	Epetra_Map * Map = A0->prowmap;

	Epetra_Vector* b = new Epetra_Vector( ::View, *Map, b_pr );
	Epetra_Vector* x = new Epetra_Vector( ::View, *Map, x_pr );

	amesos_driver2(A, x, b);

	delete x;
	delete b;

	return 0;
}



More information about the Trilinos-Users mailing list