<html><head></head><body><div style="color:#000; background-color:#fff; font-family:標楷體, dfkai-sb;font-size:16px"><div dir="ltr" id="yui_3_16_0_ym19_1_1508002612901_5596"><span id="yui_3_16_0_ym19_1_1508002612901_5595">Thanks! That's what myy error message looked like too. I took away all PetscViewer calls since I don't need it for timing anyways. That solved it for me. </span></div><div dir="ltr" id="yui_3_16_0_ym19_1_1508002612901_5596"><span><br></span></div><div dir="ltr" id="yui_3_16_0_ym19_1_1508002612901_5596"><span id="yui_3_16_0_ym19_1_1508002612901_5981">Thanks again,</span></div><div dir="ltr" id="yui_3_16_0_ym19_1_1508002612901_5596"><span>Tina</span></div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: 標楷體, dfkai-sb; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"><font size="2" face="Arial"> On Saturday, October 14, 2017 6:36 AM, Stefano Zampini <stefano.zampini@gmail.com> wrote:<br></font></div> <br><br> <div class="y_msg_container"><div id="yiv2671756231"><div><div dir="ltr">cutting and paste a message I sent a couple of days ago on the mailing list. I suspect you have a memory leak on some PetscViewer object. Try running with -malloc -malloc_dump -malloc_debug and without -log_view and see if you PETSc reports a memory leak. You can also try running under valgrind with the --leak-check=full option<div><br clear="none"></div><div>----------------------------------------------------------------------------------------------</div><div><span style="font-size:12.8px;">Instead of reporting a leak, the below code, when run with -log_view, triggers an error</span><div style="font-size:12.8px;"><br clear="none"></div><div style="font-size:12.8px;"><div>#include <petscviewer.h></div><div><br clear="none"></div><div>int main(int argc,char **args)</div><div>{</div><div> PetscErrorCode ierr;</div><div> PetscViewer view;</div><div><br clear="none"></div><div> ierr = PetscInitialize(&argc,&args,( char*)0,help);CHKERRQ(ierr);</div><div> ierr = PetscViewerASCIIGetStdout( PETSC_COMM_WORLD,&view); CHKERRQ(ierr);</div><div> ierr = PetscViewerCreate(PETSC_COMM_ WORLD,&view);CHKERRQ(ierr);</div><div> ierr = PetscFinalize();</div><div> return ierr;</div><div>}</div><div><br clear="none"></div><div><div>0]PETSC ERROR: --------------------- Error Message ------------------------------ ------------------------------ --</div><div>[0]PETSC ERROR: Corrupt argument: <a rel="nofollow" shape="rect" target="_blank" href="http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind">http://www.mcs.anl.gov/petsc/ documentation/faq.html# valgrind</a></div><div>[0]PETSC ERROR: Invalid type of object: Parameter # 1</div><div>[0]PETSC ERROR: See <a rel="nofollow" shape="rect" target="_blank" href="http://www.mcs.anl.gov/petsc/documentation/faq.html">http://www.mcs.anl.gov/petsc/ documentation/faq.html</a> for trouble shooting.</div><div>[0]PETSC ERROR: Petsc Development GIT revision: v3.7.6-4792-gbbfd41f GIT Date: 2017-07-30 13:35:30 +0300</div><div>[0]PETSC ERROR: ./ex1 on a arch-debug named localhost.localdomain by szampini Thu Oct 12 15:24:19 2017</div><div>[0]PETSC ERROR: Configure options --download-chaco --download-ctetgen --download-hypre --download-metis --download-mumps --download-p4est --download-parmetis --download-suitesparse --download-triangle --with-scalapack CFLAGS="-Wall -g -O0" CXXFLAGS="-Wall -g -O0" FCFLAGS="-g -O0" PETSC_ARCH=arch-debug</div><div>[0]PETSC ERROR: #1 PetscObjectReference() line 510 in /home/szampini/src/petsc/src/ sys/objects/inherit.c</div><div>[0]PETSC ERROR: #2 PetscOptionsGetViewer() line 259 in /home/szampini/src/petsc/src/ sys/classes/viewer/interface/ viewreg.c</div><div>[0]PETSC ERROR: #3 PetscLogViewFromOptions() line 1753 in /home/szampini/src/petsc/src/ sys/logging/plog.c</div><div>[0]PETSC ERROR: #4 PetscFinalize() line 1227 in /home/szampini/src/petsc/src/ sys/objects/pinit.c</div></div><div><br clear="none"></div><div>The problem is with the MPIAttribute Petsc_Viewer_Stdout_keyval attached to PETSC_COMM_WORLD. PETSC_VIEWER_STDOUT_WORLD gets destroyed in the first call to PetscObjectRegisterDestroyAll( ); Then PetscLogViewFromOptions() call PetscViewerASCIIGetStdout that checks for the presence of the attribute on the communicator, which is still there, since we never called MPI_Comm_free on that communicator.</div><div><br clear="none"></div><div>What would be a solution for this issue? At least, we should print a nice error message in PetscViewerASCIIGetStdout. </div></div></div></div><div class="yiv2671756231gmail_extra"><br clear="none"><div class="yiv2671756231gmail_quote">2017-10-14 16:10 GMT+03:00 Barry Smith <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:bsmith@mcs.anl.gov" target="_blank" href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></span>:<br clear="none"><div class="yiv2671756231yqt0059181185" id="yiv2671756231yqt66231"><blockquote class="yiv2671756231gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br clear="none">
Please cut and paste all the output and send it to <a rel="nofollow" shape="rect" ymailto="mailto:petsc-maint@mcs.anl.gov" target="_blank" href="mailto:petsc-maint@mcs.anl.gov">petsc-maint@mcs.anl.gov</a><br clear="none">
<br clear="none">
Barry<br clear="none">
<br clear="none">
> On Oct 14, 2017, at 2:31 AM, Tina Patel <<a rel="nofollow" shape="rect" ymailto="mailto:tinap89@yahoo.com" target="_blank" href="mailto:tinap89@yahoo.com">tinap89@yahoo.com</a>> wrote:<br clear="none">
><br clear="none">
> Hi,<br clear="none">
><br clear="none">
> I'm using -log_view option from the command line, but it gives me "corrupt argument" and "invalid argument". However, PETSc doesn't throw errors when running without -log_view.<br clear="none">
> Am I using it correctly? Or does this hint at another problem? I'm using petsc-master 3.7.6.<br clear="none">
><br clear="none">
> Thanks for your time,<br clear="none">
> Tina<br clear="none">
<br clear="none">
</blockquote></div></div><br clear="none"><br clear="all"><div><br clear="none"></div>-- <br clear="none"><div class="yiv2671756231gmail_signature">Stefano</div>
</div></div></div><br><br></div> </div> </div> </div></div></body></html>