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