[petsc-users] Slow speed to SetValues for matrix created by PETSC by mat_initial_matrix

Yang Juntao Y.Juntao at hotmail.com
Thu Jun 4 04:01:33 CDT 2020


Hello, 

I computed a preconditioned matrix by MatMatMulti(), and I generated the new matrix with option MAT_INITIAL_MATRIX. 

However I need to change the generated matrix by insert value 1 to half of the diagonal. MatSetValue() is used but the speed a much slower than MatSetValue with matrix setup by MatCreate() and MatSeqAIJPreallocation(). 
I would like to ask is it due to the preallocation setting of MAT_INITIAL_MATRIX generated matrix and how I can change it?

Thanks in advance
JT


More information about the petsc-users mailing list