<div dir="ltr">On Fri, Aug 9, 2013 at 8:49 AM, John Mousel <span dir="ltr"><<a href="mailto:john.mousel@gmail.com" target="_blank">john.mousel@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I'm getting the following invalid read when I use GAMG. I've included the output of KSPView at the bottom. </div>
</div></blockquote><div><br></div><div>This seems to be a more basic problem in MatGetSubmatrix(). Could you give us the matrix? It could be output</div><div>using -ksp_view_binary.</div><div><br></div><div>  Thanks,</div>
<div><br></div><div>      Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>==18312== Memcheck, a memory error detector</div><div>
==18312== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.</div>
<div>==18312== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info</div><div>==18312== Command: ../src/CYLINDER_EXE -ELAFINT_case_name cylinder -lspaint_ksp_type bcgsl -lspaint_pc_type gamg -lspaint_pc_gamg_type agg -lspaint_pc_gamg_agg_nsmooths 1 -lspaint_pc_gamg_sym_graph true -lspaint_ksp_monitor -pres_ksp_type preonly -pres_pc_type redistribute -pres_redistribute_ksp_type bcgsl -pres_redistribute_pc_type gamg -pres_redistribute_pc_gamg_threshold 0.05 -pres_redistribute_mg_levels_ksp_type richardson -pres_redistribute_mg_levels_pc_type sor -pres_redistribute_mg_coarse_ksp_type richardson -pres_redistribute_mg_coarse_pc_type sor -pres_redistribute_mg_coarse_pc_sor_its 5 -pres_redistribute_pc_gamg_type agg -pres_redistribute_pc_gamg_agg_nsmooths 2 -pres_redistribute_pc_gamg_sym_graph true -pres_redistribute_ksp_initial_guess_nonzero 0 -vel_ksp_monitor -pres_redistribute_ksp_monitor</div>

<div>==18312== Parent PID: 18308</div><div>==18312==</div><div>==18311== Invalid read of size 8</div><div>==18311==    at 0x4DF2BDC: PetscCheckPointer (checkptr.c:52)</div><div>==18311==    by 0x54370DE: MatSetValues_MPIAIJ (mpiaij.c:506)</div>

<div>==18311==    by 0x5462AA8: MatGetSubMatrix_MPIAIJ_Private (mpiaij.c:3860)</div><div>==18311==    by 0x5461799: MatGetSubMatrix_MPIAIJ (mpiaij.c:3733)</div><div>==18311==    by 0x551B5E8: MatGetSubMatrix (matrix.c:7322)</div>

<div>==18311==    by 0x5817535: createLevel (gamg.c:404)</div><div>==18311==    by 0x5819420: PCSetUp_GAMG (gamg.c:630)</div><div>==18311==    by 0x5764D93: PCSetUp (precon.c:890)</div><div>==18311==    by 0x589B211: KSPSetUp (itfunc.c:278)</div>

<div>==18311==    by 0x589C39A: KSPSolve (itfunc.c:399)</div><div>==18311==    by 0x57555E1: kspsolve_ (itfuncf.c:219)</div><div>==18311==    by 0x61B7A6: axbsolve_ (Axb.F90:139)</div><div>==18311==  Address 0x83d9c20 is 9,376 bytes inside a block of size 9,380 alloc'd</div>

<div>==18311==    at 0x4A06548: memalign (vg_replace_malloc.c:727)</div><div>==18311==    by 0x4DF2C7D: PetscMallocAlign (mal.c:==18309==</div><div>==18309== HEAP SUMMARY:</div><div>==18309==     in use at exit: 3,262,243 bytes in 17,854 blocks</div>

<div>==18309==   total heap usage: 329,856 allocs, 312,002 frees, 136,790,072 bytes allocated</div><div>==18309==</div><div>==18309== LEAK SUMMARY:</div><div>==18309==    definitely lost: 0 bytes in 0 blocks</div><div>==18309==    indirectly lost: 0 bytes in 0 blocks</div>

<div>==18309==      possibly lost: 0 bytes in 0 blocks</div><div>==18309==    still reachable: 3,262,243 bytes in 17,854 blocks</div><div>==18309==         suppressed: 0 bytes in 0 blocks</div><div>==18309== Rerun with --leak-check=full to see details of leaked memory</div>

<div>==18309==</div><div>==18309== For counts of detected and suppressed errors, rerun with: -v</div><div>==18309== Use --track-origins=yes to see where uninitialised values come from</div><div>==18309== ERROR SUMMARY: 24 errors from 1 contexts (suppressed: 6 from 6)</div>

<div>,141 frees, 130,288,754 bytes allocated</div><div>==18310======18310== LEAK SUMMARY:</div><div>==18310==    definitely lost: 0 bytes in 0 blocks</div><div>==18310==    indirectly lost: 0 bytes in 0 blocks</div><div>
==18310==      possibly lost: 0 bytes in 0 blocks</div>
<div>==18310==    still reachable: 3,376,159 bytes in 18,772 blocks</div><div>==18310==         suppressed: 0 bytes in 0 blocks</div><div>==18310== Rerun with --leak-check=full to see details of leaked memory</div><div>==18310==</div>

<div>==18310== For counts of detected and suppressed errors, rerun with: -v</div><div>==18310== ERROR SUMMARY: 2 errors from 1 contexts (suppressed: 6 from 6)</div><div><br></div><div><br></div><div><br></div><div><div>KSP Object:(pres_) 4 MPI processes</div>

<div>  type: preonly</div><div>  maximum iterations=20000, initial guess is zero</div><div>  tolerances:  relative=5e-08, absolute=1e-50, divergence=10000</div><div>  left preconditioning</div><div>  using NONE norm type for convergence test</div>

<div>PC Object:(pres_) 4 MPI processes</div><div>  type: redistribute</div><div>      Number rows eliminated 820 Percentage rows eliminated 11.6213</div><div>    Redistribute preconditioner: </div><div>  KSP Object:  (pres_redistribute_)   4 MPI processes</div>

<div>    type: bcgsl</div><div>      BCGSL: Ell = 2</div><div>      BCGSL: Delta = 0</div><div>    maximum iterations=20000, initial guess is zero</div><div>    tolerances:  relative=5e-08, absolute=1e-50, divergence=10000</div>

<div>    left preconditioning</div><div>    has attached null space</div><div>    using PRECONDITIONED norm type for convergence test</div><div>  PC Object:  (pres_redistribute_)   4 MPI processes</div><div>    type: gamg</div>

<div>      MG: type is MULTIPLICATIVE, levels=3 cycles=v</div><div>        Cycles per PCApply=1</div><div>        Using Galerkin computed coarse grid matrices</div><div>    Coarse grid solver -- level -------------------------------</div>

<div>      KSP Object:      (pres_redistribute_mg_coarse_)       4 MPI processes</div><div>        type: preonly</div><div>        maximum iterations=1, initial guess is zero</div><div>        tolerances:  relative=1e-05, absolute=1e-50, divergence=10000</div>

<div>        left preconditioning</div><div>        using NONE norm type for convergence test</div><div>      PC Object:      (pres_redistribute_mg_coarse_)       4 MPI processes</div><div>        type: sor</div><div>          SOR: type = local_symmetric, iterations = 5, local iterations = 1, omega = 1</div>

<div>        linear system matrix = precond matrix:</div><div>        Mat Object:         4 MPI processes</div><div>          type: mpiaij</div><div>          rows=61, cols=61</div><div>          total: nonzeros=1846, allocated nonzeros=1846</div>

<div>          total number of mallocs used during MatSetValues calls =0</div><div>            not using I-node (on process 0) routines</div><div>    Down solver (pre-smoother) on level 1 -------------------------------</div>

<div>      KSP Object:      (pres_redistribute_mg_levels_1_)       4 MPI processes</div><div>        type: richardson</div><div>          Richardson: damping factor=1</div><div>        maximum iterations=2</div><div>        tolerances:  relative=1e-05, absolute=1e-50, divergence=10000</div>

<div>        left preconditioning</div><div>        using nonzero initial guess</div><div>        using NONE norm type for convergence test</div><div>      PC Object:      (pres_redistribute_mg_levels_1_)       4 MPI processes</div>

<div>        type: sor</div><div>          SOR: type = local_symmetric, iterations = 1, local iterations = 1, omega = 1</div><div>        linear system matrix = precond matrix:</div><div>        Mat Object:         4 MPI processes</div>

<div>          type: mpiaij</div><div>          rows=870, cols=870</div><div>          total: nonzeros=16020, allocated nonzeros=16020</div><div>          total number of mallocs used during MatSetValues calls =0</div><div>

            not using I-node (on process 0) routines</div><div>    Up solver (post-smoother) same as down solver (pre-smoother)</div><div>    Down solver (pre-smoother) on level 2 -------------------------------</div><div>

      KSP Object:      (pres_redistribute_mg_levels_2_)       4 MPI processes</div><div>        type: richardson</div><div>          Richardson: damping factor=1</div><div>        maximum iterations=2</div><div>        tolerances:  relative=1e-05, absolute=1e-50, divergence=10000</div>

<div>        left preconditioning</div><div>        using nonzero initial guess</div><div>        using NONE norm type for convergence test</div><div>      PC Object:      (pres_redistribute_mg_levels_2_)       4 MPI processes</div>

<div>        type: sor</div><div>          SOR: type = local_symmetric, iterations = 1, local iterations = 1, omega = 1</div><div>        linear system matrix = precond matrix:</div><div>        Mat Object:         4 MPI processes</div>

<div>          type: mpiaij</div><div>          rows=6236, cols=6236</div><div>          total: nonzeros=31220, allocated nonzeros=31220</div><div>          total number of mallocs used during MatSetValues calls =0</div>
<div>
            not using I-node (on process 0) routines</div><div>    Up solver (post-smoother) same as down solver (pre-smoother)</div><div>    linear system matrix = precond matrix:</div><div>    Mat Object:     4 MPI processes</div>

<div>      type: mpiaij</div><div>      rows=6236, cols=6236</div><div>      total: nonzeros=31220, allocated nonzeros=31220</div><div>      total number of mallocs used during MatSetValues calls =0</div><div>        not using I-node (on process 0) routines</div>

<div>  linear system matrix = precond matrix:</div><div>  Mat Object:   4 MPI processes</div><div>    type: mpiaij</div><div>    rows=7056, cols=7056</div><div>    total: nonzeros=32416, allocated nonzeros=33180</div><div>

    total number of mallocs used during MatSetValues calls =0</div><div>      not using I-node (on process 0) routines</div></div><div><br></div><div><br></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener
</div></div>