[petsc-users] MatSetValues problem

Sanjay Govindjee s_g at berkeley.edu
Tue Mar 12 00:14:08 CDT 2013


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

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


More information about the petsc-users mailing list