[petsc-dev] PetscHashIJ scaling problem?

Jed Brown jedbrown at mcs.anl.gov
Mon Nov 11 16:20:31 CST 2013


Matthew Knepley <knepley at gmail.com> writes:
> I did not check, but it would be interesting to check 3D since that it 4
> part keys. 

That should just change the cost of the hash function, so I wouldn't
expect a big difference.

> It by far the leading cost in mesh setup, but matrix preallocation is
> 3x more expensive right now.

Okay, the brain-dead way to make preallocation easy is to use a hash to
store (row,column).  Then the user does a dummy assembly (MatSetValues)
that adds to the hash (and could discard the values).  I used to want a
more elegant solution, but the perfect is the enemy of the good and this
would be perfectly sufficient and users would love it because they
wouldn't have to think about preallocation.  It uses a bit more memory,
but preallocation is usually before preconditioner setup and if we leave
the values out, the overhead is manageable.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20131111/0bd065c8/attachment.sig>


More information about the petsc-dev mailing list