[petsc-dev] Shifting in ICC, changes?

Hong Zhang hzhang at mcs.anl.gov
Fri Dec 3 12:21:13 CST 2010


Jed,
I recall that I fixed bug in Kernel_A_gets_inverse_A_x(), e.g.
petsc-release-3.1:
Kernel_A_gets_inverse_A_4()
...
shift = .25*shift*(PetscAbsScalar(a[0]) + PetscAbsScalar(a[5]) +
PetscAbsScalar(a[10]) + PetscAbsScalar(a[15]));

petsc-dev:
shift = .25*shift*(1.e-12 + PetscAbsScalar(a[0]) +
PetscAbsScalar(a[5]) + PetscAbsScalar(a[10]) + PetscAbsScalar(a[15]));
                          ^^^^^^
Previously, when input shift>0 (i.e., user wants to apply a shift) and
diag=0, but shift is not applied.
Adding 1.e-12, shift is applied. However, 'hg log
src/mat/impls/baij/seq/degfa4.c' does not reveal when this change was
pushed.

I also recall that the shift for sbaij was buggy when 3.1 was
released, in which shift was applied or not applied incorrectly.
We (with Shri) spent sometime fixed whatever we found. For icc,
default MAT_SHIFT_POSITIVE_DEFINITE
is set (see PCCreate_ICC()) unless user does not want to.
'-pc_factor_shift_type none' should turn-off shift.
What do you get when running your code with '-info |grep -i shift'?
If nothing is displayed, then shift is not applied.

Hong




On Fri, Dec 3, 2010 at 11:29 AM, Jed Brown <jed at 59a2.org> wrote:
> On Fri, Dec 3, 2010 at 18:00, Hong Zhang <hzhang at mcs.anl.gov> wrote:
>>
>> We replaced old numerical factorization and MatSolve with faster data
>> structure,
>> then cleaned up MatPivotCheck() (still using previous algorithm).
>> Changes, such as
>> changeset:   15909:fbc1ba94d8d9
>> user:        hong at hong-zhangs-macbook-air.local
>> date:        Wed May 12 22:17:30 2010 -0500
>> files:       src/mat/impls/aij/seq/aijfact.c
>> description:
>> replace macros with inline function MatPivotCheck() for inplace lu (aij
>> format)
>>
>> could accelerate performance.
>
> I know the data structures changed, but I see significantly different
> results (number of iterations, presence of negative pivots) for ICC(0) with
> SBAIJ(2).  The new results are better, but I had an explanation for poor
> convergence that involved negative pivots needing to be shifted.  This was
> the case at that time, but now I don't see negative pivots, and unless I'm
> misunderstanding what I'm seeing, no shift is being applied now.  If that is
> really the case, then I'm seeing more than a data structure change.  If a
> shift is still being applied, I should be able to find where that happens.
> I currently see only positive determinants at sbaijfact.c:1122 (current
> petsc-dev).
>     ierr = Kernel_A_gets_inverse_A_2(diag,shift);CHKERRQ(ierr);
> If I hg update -d 2010-02-01 (changeset aef32a8bffe7), then on the
> corresponding line (sbaijfact.c:964), I see some determinants on the order
> of -1.e-9 (only when the problem starts to get hard).
> I'm trying to understand what changed.
> Jed



More information about the petsc-dev mailing list