[petsc-users] Issue with -log_view

Jed Brown jed at jedbrown.org
Tue Oct 17 11:55:06 CDT 2017


Thanks for the test case.  Fixed here (now in 'next' and will merge to
'maint' tomorrow).

https://bitbucket.org/petsc/petsc/commits/aa139df67e726a84ab5cd3b5e98c800722a9f20a

Stefano Zampini <stefano.zampini at gmail.com> writes:

> 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
>
> ----------------------------------------------------------------------------------------------
> Instead of reporting a leak, the below code, when run with -log_view,
> triggers an error
>
> #include <petscviewer.h>
>
> int main(int argc,char **args)
> {
>   PetscErrorCode ierr;
>   PetscViewer    view;
>
>   ierr = PetscInitialize(&argc,&args,(char*)0,help);CHKERRQ(ierr);

Maybe you missed the first line of your file because "help" wasn't in
this example.

>   ierr = PetscViewerASCIIGetStdout(PETSC_COMM_WORLD,&view);CHKERRQ(ierr);
>   ierr = PetscViewerCreate(PETSC_COMM_WORLD,&view);CHKERRQ(ierr);
>   ierr = PetscFinalize();
>   return ierr;
> }
>
> 0]PETSC ERROR: --------------------- Error Message
> --------------------------------------------------------------
> [0]PETSC ERROR: Corrupt argument: http://www.mcs.anl.gov/petsc/
> documentation/faq.html#valgrind
> [0]PETSC ERROR: Invalid type of object: Parameter # 1
> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
> trouble shooting.
> [0]PETSC ERROR: Petsc Development GIT revision: v3.7.6-4792-gbbfd41f  GIT
> Date: 2017-07-30 13:35:30 +0300
> [0]PETSC ERROR: ./ex1 on a arch-debug named localhost.localdomain by
> szampini Thu Oct 12 15:24:19 2017
> [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
> [0]PETSC ERROR: #1 PetscObjectReference() line 510 in
> /home/szampini/src/petsc/src/sys/objects/inherit.c
> [0]PETSC ERROR: #2 PetscOptionsGetViewer() line 259 in
> /home/szampini/src/petsc/src/sys/classes/viewer/interface/viewreg.c
> [0]PETSC ERROR: #3 PetscLogViewFromOptions() line 1753 in
> /home/szampini/src/petsc/src/sys/logging/plog.c
> [0]PETSC ERROR: #4 PetscFinalize() line 1227 in
> /home/szampini/src/petsc/src/sys/objects/pinit.c
>
> 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.
>
> What would be a solution for this issue? At least, we should print a nice
> error message in PetscViewerASCIIGetStdout.
>
> 2017-10-14 16:10 GMT+03:00 Barry Smith <bsmith at mcs.anl.gov>:
>
>>
>>    Please cut and paste all the output and send it to
>> petsc-maint at mcs.anl.gov
>>
>>    Barry
>>
>> > On Oct 14, 2017, at 2:31 AM, Tina Patel <tinap89 at yahoo.com> wrote:
>> >
>> > Hi,
>> >
>> > 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.
>> > Am I using it correctly? Or does this hint at another problem? I'm using
>> petsc-master 3.7.6.
>> >
>> > Thanks for your time,
>> > Tina
>>
>>
>
>
> -- 
> Stefano


More information about the petsc-users mailing list