[petsc-users] MatSetValues problem
Matthew Knepley
knepley at gmail.com
Tue Mar 12 07:11:27 CDT 2013
On Tue, Mar 12, 2013 at 1:14 AM, Sanjay Govindjee <s_g at berkeley.edu> wrote:
> I am having a problem with MatSetValues. I have a two processor run that
> spits the following error:
>
> [0]PETSC ERROR: MatSetValues_MPIAIJ() line 564 in
> /Users/sg/petsc-3.3-p5/src/**mat/impls/aij/mpi/mpiaij.c New nonzero at
> (1,1) caused a malloc
> [1]PETSC ERROR: MatSetValues_MPIAIJ() line 564 in
> /Users/sg/petsc-3.3-p5/src/**mat/impls/aij/mpi/mpiaij.c New nonzero at
> (18,-1) caused a malloc
>
It is giving you local indices. This error occurs down inside the macro in
aij.h for setting a value
in a serial AIJ matrix. We have not found an easy way to do index
translation on the way up.
Thanks,
Matt
> I did a run with -on_error_attach_debugger. Going up the stack I find:
>
> #9 0x000000010eec135d in matsetvalue_ (mat=0x1111151b8, i=0x7fff6dabdd04,
> j=0x7fff6dabdd0c, va=0x7fff6dabdd88, mode=0x11076215c,
> ierr=0x7fff6dabdd10)
> at /Users/sg/petsc-3.3-p5/src/**mat/ftn-custom/zmat.c:19
> 19 *ierr = MatSetValues(*mat,1,i,1,j,va,***mode);
> (gdb) print *i
> $1 = 1
> (gdb) print *j
> $2 = 42
>
> on one processor and
>
> #9 0x000000010c43235d in matsetvalue_ (mat=0x10e6861b8, i=0x7fff6b02ed04,
> j=0x7fff6b02ed0c, va=0x7fff6b02ed88, mode=0x10dcd315c,
> ierr=0x7fff6b02ed10)
> at /Users/sg/petsc-3.3-p5/src/**mat/ftn-custom/zmat.c:19
> 19 *ierr = MatSetValues(*mat,1,i,1,j,va,***mode);
> (gdb) print j
> $1 = (PetscInt *) 0x7fff6b02ed0c
> (gdb) print *i
> $2 = 42
> (gdb) print *j
> $3 = 1
>
> on the other. If I pop the stack one more time to my application (which
> is in Fortran) I see 1,42 and 42,1 -- i.e. consistent with zmat.c.
>
> Thus I find it hard to understand the error message I am getting. I was
> expecting to find
> that (i,j) match (1,1) and (18,-1) which would allow me to track my error.
> Note I am using petsc-3.3-p5.
>
> -sanjay
>
--
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/20130312/965c2637/attachment.html>
More information about the petsc-users
mailing list