[petsc-users] RE : PETSc : how to get back d_nnz and o_nnz ?

HOUSSEN Franck Franck.Houssen at cea.fr
Wed Jul 3 01:18:47 CDT 2013


Is this working also for MPI matrices ? (the code create Seq matrice with 1 proc, and, MPI matrice with n procs)
Seems that MatGetRow don't work neither. So I still have to try to use MatGetValues

FH
________________________________________
De : Jed Brown [five9a2 at gmail.com] de la part de Jed Brown [jedbrown at mcs.anl.gov]
Date d'envoi : mardi 2 juillet 2013 15:53
À : HOUSSEN Franck; petsc-users at mcs.anl.gov
Objet : Re: [petsc-users] PETSc : how to get back d_nnz and o_nnz ?

HOUSSEN Franck <Franck.Houssen at cea.fr> writes:

> Hello,
>
> From a Mat object (already preallocated with
> MatMPIAIJSetPreallocation), can I get back the d_nnz and o_nnz arrays?

MatMPIAIJGetSeqAIJ(), then MatGetRowIJ().  This returns the offsets
array, so

  nnz[i] = ai[i+1] - ai[i];


Why do you want this low-level information?


More information about the petsc-users mailing list