<div dir="ltr"><div>It was pointed out to me that valgrind memcheck reports inconsistent heap usage information when running PETSc examples. All blocks are reported freed, yet the number of allocations and frees are different. My guess as to what's going on is that this is an MPICH issue, as I can reproduce the behavior with a minimal MPI program.<br></div><div><br></div><div>From the PETSc perspective, is this a known issue? I'm wondering if this inconsistency was
always there, whether it's worth looking into more, etc.<br></div><div><br></div><div>Here's a 1-liner to reproduce, using a PETSc master build with --download-mpich (though note that this doesn't use anything from PETSc except the MPICH it builds for you).</div><div><br></div><div> printf "#include<mpi.h>\nint main(int a,char **b){MPI_Init(&a,&b);MPI_Finalize();}" > t.c && $PETSC_DIR/$PETSC_ARCH/bin/mpicc t.c && valgrind ./a.out</div><div><br></div><div>==14242== Memcheck, a memory error detector<br>==14242== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.<br>==14242== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info<br>==14242== Command: ./a.out<br>==14242== <br>==14242== <br>==14242== HEAP SUMMARY:<br>==14242== in use at exit: 0 bytes in 0 blocks<br>==14242== total heap usage: <b>1,979 allocs, 1,974 frees</b>, 4,720,483 bytes allocated<br>==14242== <br>==14242== All heap blocks were freed -- no leaks are possible<br>==14242== <br>==14242== For counts of detected and suppressed errors, rerun with: -v<br>==14242== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)<br></div></div>