<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 26/2/2016 9:21 PM, Barry Smith
wrote:<br>
</div>
<blockquote
cite="mid:256DA688-D052-4F80-AD4F-06B8295FED32@mcs.anl.gov"
type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap="">On Feb 26, 2016, at 1:14 AM, TAY wee-beng <a class="moz-txt-link-rfc2396E" href="mailto:zonexo@gmail.com"><zonexo@gmail.com></a> wrote:
On 26/2/2016 1:56 AM, Barry Smith wrote:
</pre>
<blockquote type="cite">
<pre wrap=""> Run a much smaller problem for a few time steps, making sure you free all the objects at the end, with the option -malloc_dump this will print all the memory that was not freed and hopefully help you track down which objects you forgot to free.
Barry
</pre>
</blockquote>
<pre wrap="">Hi,
I run a smaller problem and lots of things are shown in the log. How can I know which exactly are not freed from the memory?
</pre>
</blockquote>
<pre wrap="">
Everything in in the log represents unfreed memory. You need to hunt through all the objects you create and make sure you destroy all of them.
Barry</pre>
</blockquote>
Hi,<br>
<br>
I have some questions.<br>
<br>
[0]Total space allocated 2274656 bytes<br>
[ 0]16 bytes PetscStrallocpy() line 188 in
/home/wtay/Codes/petsc-3.6.3/src/sys/utils/str.c<br>
[ 0]624 bytes ISLocalToGlobalMappingCreate() line 270 in
/home/wtay/Codes/petsc-3.6.3/src/vec/is/utils/isltog.c<br>
[ 0]16 bytes VecScatterCreateCommon_PtoS() line 2655 in
/home/wtay/Codes/petsc-3.6.3/src/vec/vec/utils/vpscat.c<br>
[ 0]16 bytes VecScatterCreateCommon_PtoS() line 2654 in
/home/wtay/Codes/petsc-3.6.3/src/vec/vec/utils/vpscat.c<br>
[ 0]1440 bytes VecScatterCreate_PtoS() line 2463 in
/home/wtay/Codes/petsc-3.6.3/src/vec/vec/utils/vpscat.c<br>
[ 0]1440 bytes VecScatterCreate_PtoS() line 2462 in
/home/wtay/Codes/<br>
<br>
1. What does the [0] means? I get from [0] to [23]?<br>
<br>
2. I defined a variable globally:<br>
<br>
DM da_cu_types<br>
<br>
Then I use at each time step:<br>
<br>
<i>call
DMDACreate3d(MPI_COMM_WORLD,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DMDA_STENCIL_STAR,(IIB_I_end_domain(1)
- IIB_I_sta_domain(1) + 1),(IIB_I_end_domain(2) -
IIB_I_sta_domain(2) + 1),&</i><i><br>
</i><i><br>
</i><i>(IIB_I_end_domain(3) - IIB_I_sta_domain(3) +
1),PETSC_DECIDE,PETSC_DECIDE,PETSC_DECIDE,1,stencil_width_IIB,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,da_cu_types,ierr)</i><i><br>
</i><i><br>
</i><i>call
DMDAGetInfo(da_cu_types,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,num_procs_xyz_IIB(1),num_procs_xyz_IIB(2),num_procs_xyz_IIB(3),&</i><i><br>
</i><i><br>
</i><i>PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,ierr)</i><i><br>
</i><i><br>
</i><i>call
DMDAGetCorners(da_cu_types,start_ijk_IIB(1),start_ijk_IIB(2),start_ijk_IIB(3),width_ijk_IIB(1),width_ijk_IIB(2),width_ijk_IIB(3),ierr)</i><i><br>
</i><i><br>
</i><i>call
DMDAGetGhostCorners(da_cu_types,start_ijk_ghost_IIB(1),start_ijk_ghost_IIB(2),start_ijk_ghost_IIB(3),width_ijk_ghost_IIB(1),width_ijk_ghost_IIB(2),width_ijk_ghost_IIB(3),ierr)</i><br>
<br>
The purpose is just to get the starting and ending inidices for each
cpu partition. This is done every time step for a moving body case
since the <i>IIB_I_sta_domain</i> and <i>IIB_I_end_domain</i>
changes<br>
<br>
After getting all the info, must I call DMDestroy(da_cu_types,ierr)?<br>
<br>
Is it possible to update and use the new <i>IIB_I_sta_domain</i>
and <i>IIB_I_end_domain </i>without the need to create and destroy
the DM? I thought that may save some time since it's done at every
time step.<br>
<br>
Thanks<br>
<br>
<blockquote
cite="mid:256DA688-D052-4F80-AD4F-06B8295FED32@mcs.anl.gov"
type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap="">
Is this info helpful? Or should I run in a single core?
Thanks
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">On Feb 25, 2016, at 12:33 AM, TAY wee-beng <a class="moz-txt-link-rfc2396E" href="mailto:zonexo@gmail.com"><zonexo@gmail.com></a> wrote:
Hi,
I ran the code and it hangs again. However, adding -malloc_test doesn't seem to do any thing. The output (attached) is the same w/o it.
Wonder if there's anything else I can do.
Thank you
Yours sincerely,
TAY wee-beng
On 24/2/2016 11:33 PM, Matthew Knepley wrote:
</pre>
<blockquote type="cite">
<pre wrap="">On Wed, Feb 24, 2016 at 9:28 AM, TAY wee-beng <a class="moz-txt-link-rfc2396E" href="mailto:zonexo@gmail.com"><zonexo@gmail.com></a> wrote:
On 24/2/2016 11:18 PM, Matthew Knepley wrote:
</pre>
<blockquote type="cite">
<pre wrap="">On Wed, Feb 24, 2016 at 9:16 AM, TAY wee-beng <a class="moz-txt-link-rfc2396E" href="mailto:zonexo@gmail.com"><zonexo@gmail.com></a> wrote:
On 24/2/2016 9:12 PM, Matthew Knepley wrote:
</pre>
<blockquote type="cite">
<pre wrap="">On Wed, Feb 24, 2016 at 1:54 AM, TAY wee-beng <a class="moz-txt-link-rfc2396E" href="mailto:zonexo@gmail.com"><zonexo@gmail.com></a> wrote:
On 24/2/2016 10:28 AM, Matthew Knepley wrote:
</pre>
<blockquote type="cite">
<pre wrap="">On Tue, Feb 23, 2016 at 7:50 PM, TAY wee-beng <a class="moz-txt-link-rfc2396E" href="mailto:zonexo@gmail.com"><zonexo@gmail.com></a> wrote:
Hi,
I got this error (also attached, full) when running my code. It happens after a few thousand time steps.
The strange thing is that for 2 different clusters, it stops at 2 different time steps.
I wonder if it's related to DM since this happens after I added DM into my code.
In this case, how can I find out the error? I'm thinking valgrind may take very long and gives too many false errors.
It is very easy to find leaks. You just run a few steps with -malloc_dump and see what is left over.
Matt
</pre>
</blockquote>
<pre wrap="">Hi Matt,
Do you mean running my a.out with the -malloc_dump and stop after a few time steps?
What and how should I "see" then?
-malloc_dump outputs all unfreed memory to the screen after PetscFinalize(), so you should see the leak.
I guess it might be possible to keep creating things that you freed all at once at the end, but that is less likely.
Matt
</pre>
</blockquote>
<pre wrap="">Hi,
I got the output. I have zipped it since it's rather big. So it seems to be from DM routines but can you help me where the error is from?
Its really hard to tell by looking at it. What I do is remove things until there is no leak, then progressively
put thing back in until I have the culprit. Then you can think about what is not destroyed.
Matt
</pre>
</blockquote>
<pre wrap="">Ok so let me get this clear. When it shows:
[21]Total space allocated 1728961264 bytes
[21]1861664 bytes MatCheckCompressedRow() line 60 in /home/wtay/Codes/petsc-3.6.3/src/mat/utils/compressedrow.c
[21]16 bytes PetscStrallocpy() line 188 in /home/wtay/Codes/petsc-3.6.3/src/sys/utils/str.c
[21]624 bytes ISLocalToGlobalMappingCreate() line 270 in /home/wtay/Codes
....
Does it mean that it's simply allocating space ie normal? Or does it show that there's memory leak ie error?
I gave the wrong option. That dumps everything. Lets just look at the leaks with -malloc_test.
Sorry about that,
Matt
If it's error, should I zoom in and debug around this time at this region?
Thanks
</pre>
<blockquote type="cite">
<pre wrap=""> Thanks.
</pre>
<blockquote type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap="">--
Thank you
Yours sincerely,
TAY wee-beng
--
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
</pre>
</blockquote>
<pre wrap="">
--
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
</pre>
</blockquote>
<pre wrap="">
--
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
</pre>
</blockquote>
<pre wrap="">
--
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
</pre>
</blockquote>
<pre wrap=""><ibm2d.err>
</pre>
</blockquote>
</blockquote>
<pre wrap="">
<log.7z>
</pre>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
<br>
</body>
</html>