[petsc-users] dynamic matrix type & dense matrix.

Mark Adams mfadams at lbl.gov
Mon Aug 25 09:49:35 CDT 2014


I have a matrix that is logically dense and I create it like this:

           call MatCreate(solver%comm,solver%schur,ierr);
           call
MatSetSizes(solver%schur,nloc,nloc,PETSC_DECIDE,PETSC_DECIDE,ierr)
           call MatSetType(solver%schur,MATAIJ,ierr)
           call
MatSeqAIJSetPreallocation(solver%schur,nloc,PETSC_NULL_INTEGER,ierr)
           call
MatMPIAIJSetPreallocation(solver%schur,nloc,PETSC_NULL_INTEGER,i,PETSC_NULL_INTEGER,ierr)
           !call MatSetFromOptions(solver%schur,ierr)

This works but if I uncomment MatSetFromOptions, and comment out the AIJ
lines, and have '-mat_type dense' I get an error that the row is too large.
 I can see from the trace that this happens in MatSetValues_MPIDense.  If I
don't comment out the AIJ calls then I get a segv in MatSetValues, that is
called from MatSetValues_MPIDense.  It segvs on the first line that uses
the 'mat' so it looks like it is being called with garbage.

Any ideas?
Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140825/2aaa198b/attachment.html>


More information about the petsc-users mailing list