On Sat, Aug 27, 2011 at 13:04, Milan Mitrovic <milan.v.mitrovic at gmail.com>wrote:
> well... I added matrix elements by row (~150 nonzero elements) but I > have 7.5k rows per processor... I know the exact nonzero pattern and I > preallocated the storage so it is not that... and its all done > locally... I couldn't insert blocks because there is no common > structure to the nonzero pattern of different rows... > > so to me it seems that creating the matrix like this should be fast... > computing the values took <3 seconds but the setvalues routine took > more than a minute! > Preallocation must have been wrong. Perhaps it was destroyed/ignored by calling the function too early (the matrix type has to be set _before_ preallocation). Try MatSetOption(A,MAT_NEW_NONZERO_ALLOCATION_ERR,PETSC_TRUE) and run in a debugger to see where new entries are being allocated. With petsc-dev, you can just run with -mat_new_nonzero_allocation_err. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110827/3d756e0b/attachment.htm>
