>>> That's good to keep in mind. PETSc performance (at least in the older >>> versions where I've made this mistake) becomes atrocious if it's asked >>> to create new non-zero matrix entries on the fly without >>> preallocation. >> >> Presumably MatMatMult in PETSc (or the equivalent in trilinos) handles >> this in some sensible way though. > > Sensible in the sense that "ask the user to estimate the ratio > nnz(A*B)/(nnz(A)+nnz(B))" is probably the least bad of a bunch of bad > alternatives. > > That's kind of a quirky thing to try and encapsulate in a > non-solver-specific API, though...
Yep. Back to the origin of the question then - do you really *need* the product? Since sparse matrix multiplication is not trivial it may be preferable to carry out the action of the sparse matrix - for example a matvec C=A*B y=C*x instead could be carried out as y = (A*B)*x = A*(B*x) which would eliminate the need for explicitly forming C. Similar things can be done with solves, but there I'm not sure you'd gain anything! -Ben ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Libmesh-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-users
