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
