[petsc-users] DMPlex memory problem in scaling test

Matthew Knepley knepley at gmail.com
Fri Oct 11 07:02:59 CDT 2019


On Fri, Oct 11, 2019 at 12:37 AM Danyang Su <danyang.su at gmail.com> wrote:

> Hi Matt,
>
> My previous test is terminated after calling subroutine A as shown below.
>
> >> In Subroutine A
>
>       call DMPlexDistribute(dmda_flow%da,stencil_width,                &
>                             PETSC_NULL_SF,distributedMesh,ierr)
>       CHKERRQ(ierr)
>
>       if (distributedMesh /= PETSC_NULL_DM) then
>
>         call DMDestroy(dmda_flow%da,ierr)
>         CHKERRQ(ierr)
>         !c set the global mesh as distributed mesh
>         dmda_flow%da = distributedMesh
>
>         call DMDestroy(distributedMesh,ierr)
>
>        !If DMDestroy(distributedMesh,ierr) called, then everything is
> destroyed and there is nothing output with -malloc_test. However, I got
> error in the next subroutine [0]PETSC ERROR: DMGetCoordinatesLocal() line
> 5545 in /home/dsu/Soft/PETSc/petsc-dev/src/dm/interface/dm.c Object already
> free: Parameter # 1
>
>         CHKERRQ(ierr)
>
>      end if
>
> >> In Subroutine B
>
>       !c get local mesh DM and set coordinates
>
>       call DMGetCoordinatesLocal(dmda_flow%da,gc,ierr)
>       CHKERRQ(ierr)
>
>       call DMGetCoordinateDM(dmda_flow%da,cda,ierr)
>       CHKERRQ(ierr)
>

Okay, after Distribute() call DMDestroy() on the parallel mesh as well.

  Thanks,

     Matt

> Thanks,
>
> Danyang
>
>
> On 2019-10-10 6:15 p.m., Matthew Knepley wrote:
>
>
> On Thu, Oct 10, 2019 at 9:00 PM Danyang Su <danyang.su at gmail.com> wrote:
>
>> Labels should be destroyed with the DM. Just make a small code that does
>> nothing but distribute the mesh and end. If you
>> run with -malloc_test you should see if everythign is destroyed properly.
>>
>>   Thanks,
>>
>>     Matt
>>
>> Attached is the output run with -malloc_test using 2 processor. It's a
>> big file. How can I quick check if something is not properly destroyed?
>>
> Everything output has not been destroyed. It looks like you did not
> destroy the distributed DM.
>
>   Thanks,
>
>     Matt
>
>> Thanks,
>>
>> Danyang
>>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>
> https://www.cse.buffalo.edu/~knepley/
> <http://www.cse.buffalo.edu/~knepley/>
>
>

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20191011/520323d8/attachment.html>


More information about the petsc-users mailing list