[Trilinos-Users] Memory usage advice

Veltz Romain romain.veltz at inria.fr
Sun Dec 2 15:14:58 MST 2012


Hello,

I seek some help for some large scale problem.

I am doing some computation with Epetra on a vector of X size 262144 component. Note that I am doing multicore programming.
I want to compute the Matrix-Vector product W*X where W is a Epetra_CrsMatrix. In my problem, roughly 5% of each row are nonzero.
Hence, my first question is:
- Q1: Is it too much for sparsity? Should the number of nonzero elements be much smaller?

Then, I create the matrix W:

	int NumGlobalElements = nx_*ny_;
	Epetra_Map * Map = new Epetra_Map(NumGlobalElements,0,*Comm);
	int NumMyElements = Map->NumMyElements();
	cout<< "NumMyElements = "<<NumMyElements<<endl;std::flush(cout);
	int * MyGlobalElements = Map->MyGlobalElements();
	// We ask for maxNbLR nonzero elements per row
	cout<<"Creation de matrice...";std::flush(cout);
	W = Teuchos::rcp(new Epetra_FECrsMatrix(Copy,*Map,maxNbLR)); 
	cout<<"done.\n";
/*
do some stuff on the rows
*/
boolres = jLR->FillComplete();
	if(boolres!=0)
	{
		cout<<"Pb with jLR->FillComplete();\n";
		throw 1;
	}
return 0;
}

My problem is that just before  the call
	W = Teuchos::rcp(new Epetra_FECrsMatrix(Copy,*Map,maxNbLR)); 
the memory usage explode. Hence, to save up some memory,my second question is:

-Q2 Can I free the map Map with delete[] Map? 

Thank you for your help,

Best regards,

Romain.



More information about the Trilinos-Users mailing list