<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Thanks. I am using a very old version,
      the petsc-3.6.1. I will try to update my code to the latest
      version.<br>
      <br>
      Best,<br>
      Rongliang <br>
      <br>
      On 08/26/2016 07:47 PM, Matthew Knepley wrote:<br>
    </div>
    <blockquote
cite="mid:CAMYG4Gm2-yBoe8Qq_knULUT3PVg05vyMcPFKpWtsMirqvSbfcQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">On Fri, Aug 26, 2016 at 5:52 AM,
            Rongliang Chen <span dir="ltr"><<a
                moz-do-not-send="true"
                href="mailto:rongliang.chan@gmail.com" target="_blank">rongliang.chan@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">
                <div>Hi Matt,<br>
                  <br>
                  I think there is a typo in the following code (line
                  633 and 636 in plexpreallocate.c).<br>
                </div>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>Those are fixed in the current 'master'. Which branch
              are you using?</div>
            <div><br>
            </div>
            <div>  Thanks,</div>
            <div><br>
            </div>
            <div>     Matt</div>
            <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">
                <div> ==================<br>
                    } else {<br>
                      /* Only loop over blocks of rows */<br>
                      for (r = rStart/bs; r < rEnd/bs; ++r) {<br>
                        const PetscInt row = r*bs;<br>
                        PetscInt       numCols, cStart, c;<br>
                  <br>
                        ierr = PetscSectionGetDof(sectionAdj, row,
                  &numCols);CHKERRQ(ierr);<br>
                        ierr = PetscSectionGetOffset(<wbr>sectionAdj,
                  row, &cStart);CHKERRQ(ierr);<br>
                        for (c = cStart; c < cStart+numCols; ++c) {<br>
                          if ((cols[c] >= rStart*bs) &&
                  (cols[c] < rEnd*bs)) {<br>
                            ++dnz[r-rStart];<br>
                            if (cols[c] >= row) ++dnzu[r-rStart]; //
                  I think "dnzu[r-rStart]" should be
                  "dnzu[r-rStart/bs]", right?<br>
                          } else {<br>
                            ++onz[r-rStart];<br>
                            if (cols[c] >= row) ++onzu[r-rStart]; //
                  I think "onzu[r-rStart]" should be "onzu[r-rStart/bs]"
                  , right?<br>
                          }<br>
                        }<br>
                      }<br>
                      for (r = 0; r < (rEnd - rStart)/bs; ++r) {<br>
                        dnz[r]  /= bs;<br>
                        onz[r]  /= bs;<br>
                        dnzu[r] /= bs;<br>
                        onzu[r] /= bs;<br>
                      }<br>
                    }<br>
                  ==================<br>
                  <br>
                  Best,<br>
                  Rongliang<br>
                  <br>
                  On 08/18/2016 06:08 PM, Matthew Knepley wrote:<br>
                </div>
                <blockquote type="cite">
                  <div dir="ltr">
                    <div class="gmail_extra">
                      <div class="gmail_quote">On Thu, Aug 18, 2016 at
                        5:05 AM, Rongliang Chen <span dir="ltr"><<a
                            moz-do-not-send="true"
                            href="mailto:rongliang.chan@gmail.com"
                            target="_blank">rongliang.chan@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">
                            <div>Hi Matt,<br>
                              <br>
                              The log of the valgrind is attached. When
                              I run with valgrind, the following error
                              message comes up.<br>
                            </div>
                          </div>
                        </blockquote>
                        <div><br>
                        </div>
                        <div>The valgrind log says your code is writing
                          over memory. Fix that first.</div>
                        <div><br>
                        </div>
                        <div>   Matt</div>
                        <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">
                            <div> -------------------------<br>
                              [1]PETSC ERROR: ---------------------
                              Error Message
                              ------------------------------<wbr>------------------------------<wbr>--<br>
                              [1]PETSC ERROR: Arguments are incompatible<br>
                              [1]PETSC ERROR: Cannot change block size
                              3670016 to 7<br>
                              [1]PETSC ERROR: See <a
                                moz-do-not-send="true"
                                href="http://www.mcs.anl.gov/petsc/documentation/faq.html"
                                target="_blank">http://www.mcs.anl.gov/petsc/d<wbr>ocumentation/faq.html</a>
                              for trouble shooting.<br>
                              [1]PETSC ERROR: Petsc Release Version
                              3.6.3, Dec, 03, 2015 <br>
                              [1]PETSC ERROR: ./fsi on a 64bit-debug
                              named rlchen by rlchen Thu Aug 18 17:59:43
                              2016<br>
                              [1]PETSC ERROR: Configure options
                              --download-blacs --download-scalapack
                              --download-metis --download-parmetis
                              --download-exodusii --download-netcdf
                              --download-hdf5
                              --with-mpi-dir=/home/rlchen/so<wbr>ft/Program/mpich2-shared


                              --with-debugging=1 --download-fblaslapack
                              --with-64-bit-indices<br>
                              [1]PETSC ERROR: #1
                              PetscLayoutSetBlockSize() line 424 in
                              /home/rlchen/soft/petsc-3.6.3/<wbr>src/vec/is/utils/pmap.c<br>
                              [1]PETSC ERROR: #2 MatSetBlockSize() line
                              6920 in /home/rlchen/soft/petsc-3.6.3/<wbr>src/mat/interface/matrix.c<br>
                              [1]PETSC ERROR: #3
                              MatXAIJSetPreallocation() line 282 in
                              /home/rlchen/soft/3D_fluid/FSI<wbr>/Spmcs-v1.5/Fluid-petsc-3.6/<wbr>src/application/Fluid/gcreate.<wbr>c<br>
                              ----------------------<br>
                              <br>
                              Best regards,<br>
                              Rongliang<br>
                              <br>
                              On 08/18/2016 05:52 PM, Matthew Knepley
                              wrote:<br>
                            </div>
                            <blockquote type="cite">
                              <div dir="ltr">Run with valgrind and send
                                the log.
                                <div><br>
                                </div>
                                <div>  Thanks,</div>
                                <div><br>
                                </div>
                                <div>     Matt</div>
                              </div>
                              <div class="gmail_extra"><br>
                                <div class="gmail_quote">On Thu, Aug 18,
                                  2016 at 3:59 AM, Rongliang Chen <span
                                    dir="ltr"><<a
                                      moz-do-not-send="true"
                                      href="mailto:rongliang.chan@gmail.com"
                                      target="_blank">rongliang.chan@gmail.com</a>></span>
                                  wrote:<br>
                                  <blockquote class="gmail_quote"
                                    style="margin:0 0 0
                                    .8ex;border-left:1px #ccc
                                    solid;padding-left:1ex">Dear All,<br>
                                    <br>
                                    I try to use the block matrix (BAIJ)
                                    for the dmplex data structure with
                                    the option "-dm_mat_type baij" (the
                                    block size is 7). The code works
                                    fine when np = 1 but the following
                                    error comes up when np>1. And the
                                    code also works fine for np>1 if
                                    I set the block size to be 1. Any
                                    suggestions are highly appreciated.<br>
                                    <br>
                                    ------------------------------<wbr>----------------------<br>
                                    [1]PETSC ERROR: PetscMallocValidate:
                                    error detected at VecAXPY_Seq() line
                                    89 in /home/rlchen/soft/petsc-3.6.3/<wbr>src/vec/vec/impls/seq/bvec1.c<br>
                                    [1]PETSC ERROR: Memory at address
                                    0x1332571 is corrupted<br>
                                    [1]PETSC ERROR: Probably write past
                                    beginning or end of array<br>
                                    [1]PETSC ERROR: Last intact block
                                    allocated in PetscStrallocpy() line
                                    188 in
                                    /home/rlchen/soft/petsc-3.6.3/<wbr>src/sys/utils/str.c<br>
                                    [1]PETSC ERROR:
                                    --------------------- Error Message
                                    ------------------------------<wbr>------------------------------<wbr>--<br>
                                    [1]PETSC ERROR: Memory corruption: <a
                                      moz-do-not-send="true"
href="http://www.mcs.anl.gov/petsc/documentation/installation.html#valgrind"
                                      rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/d<wbr>ocumentation/installation.html<wbr>#valgrind</a><br>
                                    [1]PETSC ERROR:<br>
                                    [1]PETSC ERROR: See <a
                                      moz-do-not-send="true"
                                      href="http://www.mcs.anl.gov/petsc/documentation/faq.html"
                                      rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/d<wbr>ocumentation/faq.html</a>
                                    for trouble shooting.<br>
                                    [1]PETSC ERROR: Petsc Release
                                    Version 3.6.3, Dec, 03, 2015<br>
                                    [1]PETSC ERROR: ./fsi on a
                                    64bit-debug named rlchen by rlchen
                                    Thu Aug 18 16:42:34 2016<br>
                                    [1]PETSC ERROR: Configure options
                                    --download-blacs
                                    --download-scalapack
                                    --download-metis --download-parmetis
                                    --download-exodusii
                                    --download-netcdf --download-hdf5
                                    --with-mpi-dir=/home/rlchen/so<wbr>ft/Program/mpich2-shared


                                    --with-debugging=1
                                    --download-fblaslapack
                                    --with-64-bit-indices<br>
                                    [1]PETSC ERROR: #1
                                    PetscMallocValidate() line 136 in
                                    /home/rlchen/soft/petsc-3.6.3/<wbr>src/sys/memory/mtr.c<br>
                                    [1]PETSC ERROR: #2 VecAXPY_Seq()
                                    line 89 in
                                    /home/rlchen/soft/petsc-3.6.3/<wbr>src/vec/vec/impls/seq/bvec1.c<br>
                                    [1]PETSC ERROR: #3 VecAXPY() line
                                    640 in
                                    /home/rlchen/soft/petsc-3.6.3/<wbr>src/vec/vec/interface/rvector.<wbr>c<br>
                                    ------------------------------<wbr>---------------------<br>
                                    <br>
                                    Best regards,<br>
                                    Rongliang<br>
                                  </blockquote>
                                </div>
                                <br>
                                <br clear="all">
                                <span class="HOEnZb"><font
                                    color="#888888"> <span><font
                                        color="#888888">
                                        <div><br>
                                        </div>
                                        -- <br>
                                        <div
                                          data-smartmail="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>
                                      </font></span></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 data-smartmail="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>
                        </font></span></div>
                  </div>
                </blockquote>
                <br>
              </div>
            </blockquote>
          </div>
          <br>
          <br clear="all">
          <div><br>
          </div>
          -- <br>
          <div class="gmail_signature" data-smartmail="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>