[petsc-dev] Problem in VecAXPY

Matthew Knepley knepley at gmail.com
Wed Jun 16 09:38:44 CDT 2010


Barry,

  You inserted a check in VecAXPY:563 (which Jed corrected)

jed at 16195</petsc/petsc-dev/annotate/c5b7ef1f9e2d/src/vec/vec/interface/rvector.c#l563>

   563 <#l563>

  if (x == y) SETERRQ(((PetscObject)x)->comm,PETSC_ERR_ARG_IDN,"x and
y cannot be the same vector");


However, this seems to make no sense in light of mg.c:53

    ierr =
MatInterpolateAdd(mglevels->interpolate,mgc->x,mglevels->x,mglevels->x);CHKERRQ(ierr);

which will eventually call this with y == w, and has stack

0]PETSC ERROR: VecAXPY() line 563 in src/vec/vec/interface/rvector.c
[0]PETSC ERROR: MatMultAdd_ML() line 179 in src/ksp/pc/impls/ml/ml.c
[0]PETSC ERROR: MatMultAdd() line 2041 in src/mat/interface/matrix.c
[0]PETSC ERROR: MatInterpolateAdd() line 6535 in src/mat/interface/matrix.c
[0]PETSC ERROR: PCMGMCycle_Private() line 53 in src/ksp/pc/impls/mg/mg.c
[0]PETSC ERROR: PCMGMCycle_Private() line 50 in src/ksp/pc/impls/mg/mg.c
[0]PETSC ERROR: PCMGMCycle_Private() line 50 in src/ksp/pc/impls/mg/mg.c
[0]PETSC ERROR: PCApply_MG() line 288 in src/ksp/pc/impls/mg/mg.c
[0]PETSC ERROR: PCApply() line 358 in src/ksp/pc/interface/precon.c
[0]PETSC ERROR: KSPSolve_PREONLY() line 27 in
src/ksp/ksp/impls/preonly/preonly.c
[0]PETSC ERROR: KSPSolve() line 427 in src/ksp/ksp/interface/itfunc.c
[0]PETSC ERROR: PCApply_FieldSplit() line 530 in
src/ksp/pc/impls/fieldsplit/fieldsplit.c
[0]PETSC ERROR: PCApply() line 358 in src/ksp/pc/interface/precon.c
[0]PETSC ERROR: KSPInitialResidual() line 65 in
src/ksp/ksp/interface/itres.c
[0]PETSC ERROR: KSPSolve_GMRES() line 236 in src/ksp/ksp/impls/gmres/gmres.c
[0]PETSC ERROR: KSPSolve() line 427 in src/ksp/ksp/interface/itfunc.c

Can I remove this check?

  Thanks,

      Matt

-- 
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-dev/attachments/20100616/72ae18e2/attachment.html>


More information about the petsc-dev mailing list