On Tue, Mar 5, 2013 at 10:03 AM, Tim Tautges <tautges at mcs.anl.gov> wrote:
> In a previous pull request, Jed suggested "Unless you have grand plans > for matrices "in MOAB", you should avoid masquerading as a matrix format > and just implement DMCreateMatrix_MOAB (preferring a BAIJ matrix, it > seems)." But, in the documentation for many specific matrix types (I > checked BAIJ and AIJ), it says "For good matrix assembly performance the > user should preallocate the matrix storage by setting the parameters d_nz > (or d_nnz) and o_nz (or o_nnz). By setting these parameters accurately, > performance can be increased by more than a factor of 50." So if a matrix > can be created DMCreateMatrix (which passes just the dm and a Mat*), how > does one efficiently create this matrix generically without calling the > type-specific function? Do you set options for nz and nnz, or are there > MatSet-type functions for setting these? See the other DMCreateMatrix_ImplName(). The DM can use MatMPIBAIJSetPreallocation() (and others for different formats, only the matching routine is used) or MatXAIJSetPreallocation() to preallocate for any format that can understand this specification. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20130305/f1771ddb/attachment.html>
