MatCreateMPIAIJ

Xiaoxu Wang xiwang at dragon.rutgers.edu
Mon Oct 2 22:47:23 CDT 2006


Hi,

      I am a beginner on PETSC. This is my question about 
MatCreateMPIAIJ. I have a sparse matrix and only know the total number 
of nonzeros each row. The number of local rows and the number of local 
columns has been set to PETSC_DECIDE. Therefore I don't know the size of 
each portion and it is hard to tell d_nnz and o_nnz. I use the total 
number of nunzeros as d_nnz and get an allocation error.  How to deal  
with  this problem?  Should  I  explicitly specify the number of local 
rows and the number of local columns and calculate d_nnz and o_nnz? Or 
let PETSC decide the number of local rows and the number of local 
columns, and  then use another function to get these values?  Any other 
better solution?

Thanks a lot,
Xiaoxu




More information about the petsc-users mailing list