<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">On 24/2/2016 11:33 PM, Matthew Knepley
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAMYG4GmFzs68OsbR4LPNeoHmNjEkMnC2LFWsCuM3fmrZ=7XpGQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">On Wed, Feb 24, 2016 at 9:28 AM, TAY
            wee-beng <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:zonexo@gmail.com" target="_blank">zonexo@gmail.com</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div bgcolor="#FFFFFF" text="#000000"> <br>
                <div>On 24/2/2016 11:18 PM, Matthew Knepley wrote:<br>
                </div>
                <blockquote type="cite">
                  <div dir="ltr">
                    <div class="gmail_extra">
                      <div class="gmail_quote">On Wed, Feb 24, 2016 at
                        9:16 AM, TAY wee-beng <span dir="ltr"><<a
                            moz-do-not-send="true"
                            href="mailto:zonexo@gmail.com"
                            target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:zonexo@gmail.com">zonexo@gmail.com</a></a>></span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">
                          <div bgcolor="#FFFFFF" text="#000000"> <br>
                            <div>On 24/2/2016 9:12 PM, Matthew Knepley
                              wrote:<br>
                            </div>
                            <blockquote type="cite">
                              <div dir="ltr">
                                <div class="gmail_extra">
                                  <div class="gmail_quote">On Wed, Feb
                                    24, 2016 at 1:54 AM, TAY wee-beng <span
                                      dir="ltr"><<a
                                        moz-do-not-send="true"
                                        href="mailto:zonexo@gmail.com"
                                        target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:zonexo@gmail.com">zonexo@gmail.com</a></a>></span>
                                    wrote:<br>
                                    <blockquote class="gmail_quote"
                                      style="margin:0 0 0
                                      .8ex;border-left:1px #ccc
                                      solid;padding-left:1ex">
                                      <div bgcolor="#FFFFFF"
                                        text="#000000"> <br>
                                        <div>On 24/2/2016 10:28 AM,
                                          Matthew Knepley wrote:<br>
                                        </div>
                                        <blockquote type="cite">
                                          <div dir="ltr">
                                            <div class="gmail_extra">
                                              <div class="gmail_quote">On
                                                Tue, Feb 23, 2016 at
                                                7:50 PM, TAY wee-beng <span
                                                  dir="ltr"><<a
                                                    moz-do-not-send="true"
href="mailto:zonexo@gmail.com" target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:zonexo@gmail.com">zonexo@gmail.com</a></a>></span>
                                                wrote:<br>
                                                <blockquote
                                                  class="gmail_quote"
                                                  style="margin:0 0 0
                                                  .8ex;border-left:1px
                                                  #ccc
                                                  solid;padding-left:1ex">Hi,<br>
                                                  <br>
                                                  I got this error (also
                                                  attached, full) when
                                                  running my code. It
                                                  happens after a few
                                                  thousand time steps.<br>
                                                  <br>
                                                  The strange thing is
                                                  that for 2 different
                                                  clusters, it stops at
                                                  2 different time
                                                  steps.<br>
                                                  <br>
                                                  I wonder if it's
                                                  related to DM since
                                                  this happens after I
                                                  added DM into my code.<br>
                                                  <br>
                                                  In this case, how can
                                                  I find out the error?
                                                  I'm thinking valgrind
                                                  may take very long and
                                                  gives too many false
                                                  errors.</blockquote>
                                                <div><br>
                                                </div>
                                                <div>It is very easy to
                                                  find leaks. You just
                                                  run a few steps with
                                                  -malloc_dump and see
                                                  what is left over.</div>
                                                <div><br>
                                                </div>
                                                <div>   Matt</div>
                                              </div>
                                            </div>
                                          </div>
                                        </blockquote>
                                        Hi Matt, <br>
                                        <br>
                                        Do you mean running my a.out
                                        with the -malloc_dump and stop
                                        after a few time steps?<br>
                                        <br>
                                        What and how should I "see"
                                        then?</div>
                                    </blockquote>
                                    <div><br>
                                    </div>
                                    <div>-malloc_dump outputs all
                                      unfreed memory to the screen after
                                      PetscFinalize(), so you should see
                                      the leak.</div>
                                    <div>I guess it might be possible to
                                      keep creating things that you
                                      freed all at once at the end, but
                                      that is less likely.</div>
                                    <div><br>
                                    </div>
                                    <div>   Matt</div>
                                    <div> </div>
                                  </div>
                                </div>
                              </div>
                            </blockquote>
                            Hi,<br>
                            <br>
                            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?<br>
                          </div>
                        </blockquote>
                        <div><br>
                        </div>
                        <div>Its really hard to tell by looking at it.
                          What I do is remove things until there is no
                          leak, then progressively</div>
                        <div>put thing back in until I have the culprit.
                          Then you can think about what is not
                          destroyed.</div>
                        <div><br>
                        </div>
                        <div>  Matt</div>
                      </div>
                    </div>
                  </div>
                </blockquote>
                Ok so let me get this clear. When it shows:<br>
                <br>
                [21]Total space allocated 1728961264 bytes<br>
                [21]1861664 bytes MatCheckCompressedRow() line 60 in
                /home/wtay/Codes/petsc-3.6.3/src/mat/utils/compressedrow.c<br>
                [21]16 bytes PetscStrallocpy() line 188 in
                /home/wtay/Codes/petsc-3.6.3/src/sys/utils/str.c<br>
                [21]624 bytes ISLocalToGlobalMappingCreate() line 270 in
                /home/wtay/Codes<br>
                <br>
                ....<br>
                <br>
                Does it mean that it's simply allocating space ie
                normal? Or does it show that there's memory leak ie
                error? <br>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>I gave the wrong option. That dumps everything. Lets
              just look at the leaks with -malloc_test.</div>
            <div><br>
            </div>
            <div> Sorry about that,</div>
            <div><br>
            </div>
            <div>    Matt</div>
          </div>
        </div>
      </div>
    </blockquote>
    Oh ic .. no prob. I'll try again then.<br>
    <blockquote
cite="mid:CAMYG4GmFzs68OsbR4LPNeoHmNjEkMnC2LFWsCuM3fmrZ=7XpGQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div> </div>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div bgcolor="#FFFFFF" text="#000000"> If it's error,
                should I zoom in and debug around this time at this
                region?<br>
                <br>
                Thanks<br>
                <blockquote type="cite">
                  <div dir="ltr">
                    <div class="gmail_extra">
                      <div class="gmail_quote">
                        <div> </div>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">
                          <div bgcolor="#FFFFFF" text="#000000"> Thanks.<br>
                            <blockquote type="cite">
                              <div dir="ltr">
                                <div class="gmail_extra">
                                  <div class="gmail_quote">
                                    <blockquote class="gmail_quote"
                                      style="margin:0 0 0
                                      .8ex;border-left:1px #ccc
                                      solid;padding-left:1ex">
                                      <div bgcolor="#FFFFFF"
                                        text="#000000"> 
                                        <blockquote type="cite">
                                          <div dir="ltr">
                                            <div class="gmail_extra">
                                              <div class="gmail_quote">
                                                <blockquote
                                                  class="gmail_quote"
                                                  style="margin:0 0 0
                                                  .8ex;border-left:1px
                                                  #ccc
                                                  solid;padding-left:1ex"><span><font
                                                      color="#888888"><br>
                                                      <span><font
                                                          color="#888888">
                                                          -- <br>
                                                          Thank you<br>
                                                          <br>
                                                          Yours
                                                          sincerely,<br>
                                                          <br>
                                                          TAY wee-beng<br>
                                                          <br>
                                                        </font></span></font></span></blockquote>
                                                <span><font
                                                    color="#888888"> </font></span></div>
                                              <span><font
                                                  color="#888888"> <br>
                                                  <br clear="all">
                                                  <span><font
                                                      color="#888888">
                                                      <div><br>
                                                      </div>
                                                      -- <br>
                                                      <div>What most
                                                        experimenters
                                                        take for granted
                                                        before they
                                                        begin their
                                                        experiments is
                                                        infinitely more
                                                        interesting than
                                                        any results to
                                                        which their
                                                        experiments
                                                        lead.<br>
                                                        -- Norbert
                                                        Wiener</div>
                                                    </font></span></font></span></div>
                                            <span><font color="#888888">
                                              </font></span></div>
                                          <span><font color="#888888"> </font></span></blockquote>
                                        <span><font color="#888888"> <br>
                                          </font></span></div>
                                      <span><font color="#888888"> </font></span></blockquote>
                                    <span><font color="#888888"> </font></span></div>
                                  <span><font color="#888888"> <br>
                                      <br clear="all">
                                      <span class="HOEnZb"><font
                                          color="#888888">
                                          <div><br>
                                          </div>
                                          -- <br>
                                          <div>What most experimenters
                                            take for granted before they
                                            begin their experiments is
                                            infinitely more interesting
                                            than any results to which
                                            their experiments lead.<br>
                                            -- Norbert Wiener</div>
                                        </font></span></font></span></div>
                                <span class="HOEnZb"><font
                                    color="#888888"> </font></span></div>
                              <span class="HOEnZb"><font color="#888888">
                                </font></span></blockquote>
                            <span class="HOEnZb"><font color="#888888">
                                <br>
                              </font></span></div>
                          <span class="HOEnZb"><font color="#888888"> </font></span></blockquote>
                        <span class="HOEnZb"><font color="#888888"> </font></span></div>
                      <span class="HOEnZb"><font color="#888888"> <br>
                          <br clear="all">
                          <div><br>
                          </div>
                          -- <br>
                          <div>What most experimenters take for granted
                            before they begin their experiments is
                            infinitely more interesting than any results
                            to which their experiments lead.<br>
                            -- Norbert Wiener</div>
                        </font></span></div>
                  </div>
                </blockquote>
                <br>
              </div>
            </blockquote>
          </div>
          <br>
          <br clear="all">
          <div><br>
          </div>
          -- <br>
          <div class="gmail_signature">What most experimenters take for
            granted before they begin their experiments is infinitely
            more interesting than any results to which their experiments
            lead.<br>
            -- Norbert Wiener</div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>