[petsc-dev] Slowness of PetscSortIntWithArrayPair in MatAssembly

Jed Brown jed at jedbrown.org
Tue Jul 2 15:08:26 CDT 2019

John Peterson <jwpeterson at gmail.com> writes:

>> Do you add values many times into the same location?  The array length
>> will be the number of misses to the local part of the matrix.  We could
>> (and maybe should) make the stash use a hash instead of building the
>> array with multiplicity and combining duplicates later.
>  This is a 3D model with a so-called "spider" node that is connected to
> (and constrained in terms of) many other nodes by 1D "beam" elements. So,
> yes, I would imagine the dofs of the spider node would be assembled into
> from many (possibly off-processor) elements.

Makes sense.

> The "legacy" variant sends all that redundant data and inserts one at a
>> time into the local data structures.
> OK, I guess in this case the problem is so small that we don't even notice
> the communication time, even for the legacy algorithm.

Fande said it took a second, which sounds like a long time to me -- it's
enough time to move many GB in memory.

More information about the petsc-dev mailing list