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

Mark Adams mfadams at lbl.gov
Mon Aug 25 11:57:47 CDT 2014


MatSetup was the issues: this seems to work with and w/o -mat_type dense:

           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)
           call MatSetup(solver%schur,ierr)



On Mon, Aug 25, 2014 at 12:34 PM, Matthew Knepley <knepley at gmail.com> wrote:

> On Mon, Aug 25, 2014 at 9:49 AM, Mark Adams <mfadams at lbl.gov> wrote:
>
>> 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)
>>
>
> Send the full error from
>
>            call MatCreate(solver%comm,solver%schur,ierr);
>            call
> MatSetSizes(solver%schur,nloc,nloc,PETSC_DECIDE,PETSC_DECIDE,ierr)
>            call MatSetFromOptions(solver%schur,ierr)
>            call MatSetUp(solver%schur, ierr)
>
>   Thanks,
>
>      Matt
>
>
>> 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
>>
>
>
>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140825/a7efe4ed/attachment.html>


More information about the petsc-users mailing list