Hello, In matrix preallocation procedure, I tried 2 options to preallocate global matrix. The first is ‘MatSeqAIJSetPreallocation’ and the second is ‘MatSetPreallocationCOO’.
When I adopt the first option “MatSeqAIJSetPreallocation(Mat, nz, nnz)”, I just put overestimated nz for getting enough memory space and also getting nice performance. However, It couldn’t run without “MatSetOption(Mat, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE);” And also, there are no speed up compare with no preallocation case. When in the second option “MatSetPreallocationCOO(Mat,ncoo,coo_i,coo_j)”, I put correct size parameters(ncoo, coo_i, coo_j). However, It couldn’t run without “MatSetOption(Mat, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE);” Regarding this problem, I suspect that it is a problem caused by mapping a small-sized local matrix with a different order from the order of coo_i and coo_j to the global matrix by using “matsetvalue”. And also, there are no speed up compare with no preallocation case. 1. How can I do proper preallocation procedure? 2. Why in my cases there are no speed up? Thanks, Hyung Kim
