[petsc-dev] missing fortran stuff?

Jed Brown jedbrown at mcs.anl.gov
Fri Jan 25 14:50:27 CST 2013


On Fri, Jan 25, 2013 at 2:44 PM, Mark F. Adams <mark.adams at columbia.edu>wrote:

> Deep clean worked,
>
> Now I get a segv in dmcreatematrix.  The string length is crazy.  I tried
> calling this with MPIAIJ and PETSC_NULL, both had crazy 'len' (but slightly
> different) and segv at the same place.
>

Never ever ever use PETSC_NULL from Fortran. It is always wrong. You must
use PETSC_NULL_OBJECT, PETSC_NULL_CHARACTER, etc, if you want a NULL value.

MATAIJ should work:

$ git grep DMCreateMatrix -- *.F
src/dm/impls/mesh/examples/tutorials/ex4f90.F:      call
DMCreateMatrix(mesh, MATAIJ, A,ierr)
src/snes/examples/tutorials/ex5f90.F:        call
DMCreateMatrix(da,MATAIJ,J,ierr)
src/snes/examples/tutorials/ex5f90t.F:        call
DMCreateMatrix(user%da,MATAIJ,J,ierr)
src/ts/examples/tutorials/ex22f.F:      call
DMCreateMatrix(da,MATAIJ,J,ierr)


> 0x0000000100b112e4 in dmcreatematrix_ (dm=0x7fff5fbff5b0,
> mat_type=0x101e90f00 "", J=0x7fff5fbff5e0, ierr=0x7fff5fbff59c,
> len=1606415580) at zdmf.c:40
> 40        FIXCHAR(mat_type,len,t);
> (gdb) list
> 35
> 36      EXTERN_C_BEGIN
> 37      void PETSC_STDCALL dmcreatematrix_(DM *dm,CHAR mat_type
> PETSC_MIXED_LEN(len),Mat *J,PetscErrorCode *ierr PETSC_END_LEN(len))
> 38      {
> 39        char *t;
> 40        FIXCHAR(mat_type,len,t);
> 41        *ierr = DMCreateMatrix(*dm,t,J);
> 42        FREECHAR(mat_type,t);
> 43      }
> 44      EXTERN_C_END
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20130125/72362c9a/attachment.html>


More information about the petsc-dev mailing list