MTL slow on large matrices?
"Yaron Kretchmer" <[email protected]> Tue, 3 Apr 2007 08:29:34 -0700
| Newsgroups | gmane.comp.lib.mtl.devel |
|---|---|
| Message-ID | <D500AB0F5C034F48AB08127D359BEA1FDC1243@sj-ismsg01.altera.priv.altera.com> |
This is a multi-part message in MIME format. --===============0617347446== Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C77604.E1B87A00" This is a multi-part message in MIME format. ------_=_NextPart_001_01C77604.E1B87A00 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi There. I'm trying to construct a large (4e6 * 1e6) sparse matrix, with nnz per = row/column at <10.=20 MTL gives really horrible performance compared to other sparse matrix = libraries (Such as Petsc)- I'm talking about just the construction of = the matrix itself, no arithmetic operations. In tests I've conducted the = difference is about 30X. I'm suspecting this is because MTL does not preallocate sparse matrix = memory. but rather enlarges the underlying STL objects as new values are = put into the matrix- does that make sense? Is there a way of enforcing preallocation (preferably individually at a = per-row/per-column basis, but even globally would be a good place to = start) when creating sparse matrix objects? Cheers Yaron ------_=_NextPart_001_01C77604.E1B87A00 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <TITLE>MTL slow on large matrices?</TITLE> </HEAD> <BODY> <!-- Converted from text/plain format --> <P><FONT SIZE=3D2>Hi There.<BR> I'm trying to construct a large (4e6 * 1e6) sparse matrix, with nnz per = row/column at <10.<BR> MTL gives really horrible performance compared to other sparse matrix = libraries (Such as Petsc)- I'm talking about just the construction of = the matrix itself, no arithmetic operations. In tests I've conducted the = difference is about 30X.<BR> I'm suspecting this is because MTL does not preallocate sparse matrix = memory. but rather enlarges the underlying STL objects as new values are = put into the matrix- does that make sense?<BR> <BR> Is there a way of enforcing preallocation (preferably individually at a = per-row/per-column basis, but even globally would be a good place to = start) when creating sparse matrix objects?<BR> <BR> Cheers<BR> Yaron</FONT> </P> </BODY> </HTML> ------_=_NextPart_001_01C77604.E1B87A00-- --===============0617347446== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/ --===============0617347446==--