[petsc-dev] Dealing with off-processor aij-matrices not having preallocation information

Karl Rupp rupp at mcs.anl.gov
Thu Mar 21 10:25:07 CDT 2013


Hi guys,

 >     I vote a). No new function, gets rid of a stupid optimization that
 >     does no one any good, and is the simplest.
 >
 >
 > I also think (b) is becoming over-complicated. If someone knows their
 > stencil and cares about memory usage, they can just pass the correct
 > values. The defaults are terribly for anything but a 5-point stencil 
anyway.


for completeness, here's how b) would look like:

https://bitbucket.org/petsc/petsc/commits/814b6bb1ec0ea67e05a42f7f07cab1169a9be913

This has the additional freedom of being able to deal with different 
defaults for on- and off-processor blocks correctly at the expense of a 
separate function MatSeqAIJSetPreallocation_SeqAIJAlloc()

I can confirm that this fixes the issues with GPUs. If, on the other 
hand, we pick a), then code gets substantially simpler even than it is 
now. As noted, the only drawback is that the default preallocation for 
on- and off-processor values is the same. I can live with that.

Best regards,
Karli






More information about the petsc-dev mailing list