[petsc-users] Uninitialized values within mesh generation
Barry Smith
bsmith at mcs.anl.gov
Sun Apr 19 18:08:58 CDT 2015
You can use valgrind in conjunction with the debugger to tray to track down the problem. Or simply look at the ctetgen code at those source lines to see why values would be uninitialized.
> On Apr 19, 2015, at 5:20 PM, Justin Chang <jchang27 at uh.edu> wrote:
>
> Hi all,
>
> I have the following lines for mesh generation:
>
> DM boundary;
> ierr = DMCreate(comm,&boundary);CHKERRQ(ierr);
> ierr = DMSetType(boundary, DMPLEX);CHKERRQ(ierr);
> ierr = DMSetDimension(boundary, spatialDim-1);CHKERRQ(ierr);
> switch (spatialDim) {
> case 2:
> {
> ierr = DMPlexCreateSquareBoundary(boundary,lower,upper,edges);CHKERRQ(ierr);
> break;
> }
> case 3:
> {
> ierr = DMPlexCreateCubeBoundary(boundary,lower,upper,edges);CHKERRQ(ierr);
> break;
> }
> default:
> SETERRQ1(comm,PETSC_ERR_SUP,"Dimension not supported: %d",spatialDim);
> }
> ierr = DMPlexGenerate(boundary,NULL,PETSC_TRUE,dm);CHKERRQ(ierr);
> ierr = DMDestroy(&boundary);CHKERRQ(ierr);
>
> where lower and upper are global PetscScalars * and edges is a global PetscInt *. These values are PetscCalloc'ed and initialized via commandline options (PetscOptionsGetScalar/IntArray). When I run my code with valgrind, I get the following messages:
>
> ==12706== Conditional jump or move depends on uninitialised value(s)
> ==12706== at 0x65E778C: TetGenMeshPointTraverse(TetGenMesh*, double**) (ctetgen.c:4107)
> ==12706== by 0x661C8F8: TetGenMeshDelaunizeVertices(TetGenMesh*) (ctetgen.c:12091)
> ==12706== by 0x6661A8E: TetGenTetrahedralize(TetGenOpts*, PLC*, PLC*) (ctetgen.c:21483)
> ==12706== by 0x5B655EB: DMPlexGenerate_CTetgen(_p_DM*, PetscBool, _p_DM**) (plexgenerate.c:834)
> ==12706== by 0x5B685F4: DMPlexGenerate (plexgenerate.c:1080)
> ==12706== by 0x409B6D: CreateMesh(int, AppCtx*, _p_DM**) (main.c:657)
> ==12706== by 0x40DBA8: main (main.c:1005)
> ==12706==
> ==12706== Conditional jump or move depends on uninitialised value(s)
> ==12706== at 0x661BF6C: TetGenMeshDelaunayIncrFlip(TetGenMesh*, triface*, double**, long, PetscBool, PetscBool, double, Queue*) (ctetgen.c:12011)
> ==12706== by 0x661CD0B: TetGenMeshDelaunizeVertices(TetGenMesh*) (ctetgen.c:12113)
> ==12706== by 0x6661A8E: TetGenTetrahedralize(TetGenOpts*, PLC*, PLC*) (ctetgen.c:21483)
> ==12706== by 0x5B655EB: DMPlexGenerate_CTetgen(_p_DM*, PetscBool, _p_DM**) (plexgenerate.c:834)
> ==12706== by 0x5B685F4: DMPlexGenerate (plexgenerate.c:1080)
> ==12706== by 0x409B6D: CreateMesh(int, AppCtx*, _p_DM**) (main.c:657)
> ==12706== by 0x40DBA8: main (main.c:1005)
> ==12706==
> ==12706== Conditional jump or move depends on uninitialised value(s)
> ==12706== at 0x661BFB6: TetGenMeshDelaunayIncrFlip(TetGenMesh*, triface*, double**, long, PetscBool, PetscBool, double, Queue*) (ctetgen.c:12014)
> ==12706== by 0x661CD0B: TetGenMeshDelaunizeVertices(TetGenMesh*) (ctetgen.c:12113)
> ==12706== by 0x6661A8E: TetGenTetrahedralize(TetGenOpts*, PLC*, PLC*) (ctetgen.c:21483)
> ==12706== by 0x5B655EB: DMPlexGenerate_CTetgen(_p_DM*, PetscBool, _p_DM**) (plexgenerate.c:834)
> ==12706== by 0x5B685F4: DMPlexGenerate (plexgenerate.c:1080)
> ==12706== by 0x409B6D: CreateMesh(int, AppCtx*, _p_DM**) (main.c:657)
> ==12706== by 0x40DBA8: main (main.c:1005)
> ==12706==
> ==12706== Conditional jump or move depends on uninitialised value(s)
> ==12706== at 0x661C004: TetGenMeshDelaunayIncrFlip(TetGenMesh*, triface*, double**, long, PetscBool, PetscBool, double, Queue*) (ctetgen.c:12017)
> ==12706== by 0x661CD0B: TetGenMeshDelaunizeVertices(TetGenMesh*) (ctetgen.c:12113)
> ==12706== by 0x6661A8E: TetGenTetrahedralize(TetGenOpts*, PLC*, PLC*) (ctetgen.c:21483)
> ==12706== by 0x5B655EB: DMPlexGenerate_CTetgen(_p_DM*, PetscBool, _p_DM**) (plexgenerate.c:834)
> ==12706== by 0x5B685F4: DMPlexGenerate (plexgenerate.c:1080)
> ==12706== by 0x409B6D: CreateMesh(int, AppCtx*, _p_DM**) (main.c:657)
> ==12706== by 0x40DBA8: main (main.c:1005)
> ==12706==
> ==12706== Conditional jump or move depends on uninitialised value(s)
> ==12706== at 0x661C048: TetGenMeshDelaunayIncrFlip(TetGenMesh*, triface*, double**, long, PetscBool, PetscBool, double, Queue*) (ctetgen.c:12020)
> ==12706== by 0x661CD0B: TetGenMeshDelaunizeVertices(TetGenMesh*) (ctetgen.c:12113)
> ==12706== by 0x6661A8E: TetGenTetrahedralize(TetGenOpts*, PLC*, PLC*) (ctetgen.c:21483)
> ==12706== by 0x5B655EB: DMPlexGenerate_CTetgen(_p_DM*, PetscBool, _p_DM**) (plexgenerate.c:834)
> ==12706== by 0x5B685F4: DMPlexGenerate (plexgenerate.c:1080)
> ==12706== by 0x409B6D: CreateMesh(int, AppCtx*, _p_DM**) (main.c:657)
> ==12706== by 0x40DBA8: main (main.c:1005)
> ==12706==
> ==12706== Conditional jump or move depends on uninitialised value(s)
> ==12706== at 0x661B232: TetGenMeshInsertVertexBW(TetGenMesh*, double*, triface*, PetscBool, PetscBool, PetscBool, PetscBool, locateresult*) (ctetgen.c:11905)
> ==12706== by 0x661C2AF: TetGenMeshDelaunayIncrFlip(TetGenMesh*, triface*, double**, long, PetscBool, PetscBool, double, Queue*) (ctetgen.c:12046)
> ==12706== by 0x661CD0B: TetGenMeshDelaunizeVertices(TetGenMesh*) (ctetgen.c:12113)
> ==12706== by 0x6661A8E: TetGenTetrahedralize(TetGenOpts*, PLC*, PLC*) (ctetgen.c:21483)
> ==12706== by 0x5B655EB: DMPlexGenerate_CTetgen(_p_DM*, PetscBool, _p_DM**) (plexgenerate.c:834)
> ==12706== by 0x5B685F4: DMPlexGenerate (plexgenerate.c:1080)
> ==12706== by 0x409B6D: CreateMesh(int, AppCtx*, _p_DM**) (main.c:657)
> ==12706== by 0x40DBA8: main (main.c:1005)
> ==12706==
>
> What does this mean? Is there something wrong/missing with the current implementation of the mesh generation?
>
> Thanks,
> Justin
>
>
>
> --
> Justin Chang
> PhD Candidate, Civil Engineering - Computational Sciences
> University of Houston, Department of Civil and Environmental Engineering
> Houston, TX 77004
> (512) 963-3262
More information about the petsc-users
mailing list