[petsc-users] The default nonzero pattern for SuperLU_dist.

Xuefei (Rebecca) Yuan xyuan at lbl.gov
Thu Sep 1 11:53:49 CDT 2011


Dear Hong,

Yes, I am using this SAME_NONZERO_PATTERN to optimize the code,hehe!

Thanks very much!

Best,

Rebecca



On Sep 1, 2011, at 7:35 AM, Hong Zhang wrote:

> Rebecca:
> 
>> Thanks for your kind reply. So if I set up the following:
>> 
>>        ierr = DAGetMatrix(DMMGGetDA(dmmg), MATAIJ, &jacobian);CHKERRQ(ierr);
>>        KSP     ksp;
>>        ierr = SNESGetKSP(DMMGGetSNES(dmmg),&ksp);CHKERRQ(ierr);
>>        ierr = KSPSetOperators(ksp,jacobian,jacobian,SAME_NONZERO_PATTERN);CHKERRQ(ierr);
>> 
>>        ierr = DMMGSolve(dmmg);CHKERRQ(ierr);
>> 
>> This will specify the nonzero pattern as the same?
> Yes.
> 
>> How could I check if I have set this up right?
> 
> This is a user input. If you know the non-zero pattern will not change, then
> this flag tells petsc library to skip symbolic factorization and reuse previous
> matrix factor structure. I would suggest use DIFFERENT_NONZERO_PATTERN
> first. After the solver works well and you know the matrix structure
> should not change,
> then use SAME_NONZERO_PATTERN for optimization.
> 
> Hong
> 
> 
>> On Aug 31, 2011, at 2:42 PM, Barry Smith wrote:
>> 
>>> 
>>> On Aug 31, 2011, at 4:40 PM, Xuefei (Rebecca) Yuan wrote:
>>> 
>>>> Hello all,
>>>> 
>>>> Is the default nonzero pattern for SuperLU_dist is SAME_NONZERO_PATTERN?
>>> 
>>>   There is no default nonzero pattern. You always must set it when you call KSPSetOperators() or in your SNES FormFunction. The PETSc SUPERLU_dist interface allows either pattern and should work correctly.
>>> 
>>> 
>>>    Barry
>>> 
>>>> 
>>>> Thanks!
>>>> 
>>>> Best,
>>>> 
>>>> Rebecca
>>>> 
>>> 
>> 
>> 



More information about the petsc-users mailing list