[petsc-users] error in petsc-dev
Mohammad Mirzadeh
mirzadeh at gmail.com
Wed Apr 25 18:04:24 CDT 2012
Thanks Hong; that fixed the problem.
On Wed, Apr 25, 2012 at 11:31 AM, Hong Zhang <hzhang at mcs.anl.gov> wrote:
> Mohammad:
>
>>
>> MatCreate(comm, &A);
>> MatSetSizes(A, localRowSize, localColumnSize, globalRowSize,
>> globalColumnSize);
>> MatSetType(A, MATMPIAIJ);
>> MatMPIAIJSetPreallocation(A, 0, d_nnz, 0, o_nnz);
>> MatSetFromOptions(A);
>> MatGetOwnershipRange(A, &rStart, &rEnd);
>>
>>
>> This (even without MatSetType(A, MATMPIAIJ);) works with 3.2-p6 but not
>> dev. The only difference I can see is 1) the order of MatSetFromOptions and
>> 2) I do not call MatSeqAIJSetPreallocation which I think I do not need
>> anyway. Is there something I'm doing wrong?
>>
>
> MatSetFromOptions() must be called before MatMPIAIJSetPreallocation().
> If user set mattype at runtime, MatSetFromOptions() picks it and set the
> type accordingly. SetPreallocation()
> will be called after the type is set.
>
> Hong
>
>>
>> Mohammd
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120425/d8747353/attachment.htm>
More information about the petsc-users
mailing list