<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>For the benefit of anyone else who happens to run into this
      issue...</p>
    <p>Earlier in my code, I had used the function DMDAGetAO(DM da, AO
      *ao), and then destroyed the AO at the end of the function with
      AODestroy.</p>
    <p>I'm guessing that, when I did this, I destroyed the AO for the
      DM, so when it came time to view the matrix, PETSc could not
      convert the numbering for display.</p>
    <p>Does this sound right or make sense?<br>
    </p>
    Thanks,<br>
    Paul<br>
    <br>
    <div class="moz-cite-prefix">On 05/27/2016 06:43 PM, Matthew Knepley
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAMYG4GmtKdLrutbU2wJkRzqKbr7WubNb6qc9QwxM03YctJCNZQ@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">On Fri, May 27, 2016 at 8:38 PM, Paul
            Urbanczyk <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:gomer@stanford.edu" target="_blank">gomer@stanford.edu</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">
                <p>On 05/27/2016 05:44 PM, Matthew Knepley wrote:<br>
                </p>
                <blockquote type="cite">
                  <div dir="ltr">
                    <div class="gmail_extra">
                      <div class="gmail_quote">On Fri, May 27, 2016 at
                        6:34 PM, Paul Urbanczyk <span dir="ltr"><<a
                            moz-do-not-send="true"
                            href="mailto:gomer@stanford.edu"
                            target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:gomer@stanford.edu">gomer@stanford.edu</a></a>></span>
                        wrote:<br>
                        <blockquote class="gmail_quote"
                          style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hello,<br>
                          <br>
                          I'm having trouble with the MatView function
                          drawing the matrix structure(s) when I execute
                          my code on multiple processors.<br>
                          <br>
                          When I run on a single processor, the code
                          runs fine, and the graphics window displays
                          cleanly.<br>
                        </blockquote>
                        <div><br>
                        </div>
                        <div>Lets start with an example. I do this</div>
                        <div><br>
                        </div>
                        <div>  cd $PETSC_DIR/src/snes/examples/tutorials</div>
                        <div>  make ex19</div>
                        <div><br>
                        </div>
                        <div>Make sure it runs</div>
                        <div><br>
                        </div>
                        <div>  ./ex19 -snes_monitor</div>
                        <div><br>
                        </div>
                        <div>Make sure it runs in parallel (maybe you
                          need $PETSC_DIR/$PETSC_ARCH/bin/mpiexec)</div>
                        <div><br>
                        </div>
                        <div>  mpiexec -n 2 ./ex19 -snes_monitor</div>
                        <div><br>
                        </div>
                        <div>Make sure it can draw</div>
                        <div>
                          <div><br>
                              mpiexec -n 2 ./ex19 -snes_monitor
                            -mat_view draw -draw_pause 1</div>
                        </div>
                        <div><br>
                        </div>
                        <div>This runs fine for me. Can you try it?</div>
                        <div><br>
                        </div>
                        <div>  Thanks,</div>
                        <div><br>
                        </div>
                        <div>     Matt</div>
                      </div>
                    </div>
                  </div>
                </blockquote>
                Hello Matt,<br>
                <br>
                Yes, this example seems to run just fine. How should I
                proceed?<br>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>I am not sure what you are doing in your code. Can you
              try and change one of these examples</div>
            <div>to do something like what you do? SNEX ex19 seems like
              it does things mostly the way you</div>
            <div>describe.</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"> <br>
                -Paul<br>
                <blockquote type="cite">
                  <div dir="ltr">
                    <div class="gmail_extra">
                      <div class="gmail_quote">
                        <div><br>
                        </div>
                        <blockquote class="gmail_quote"
                          style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">When
                          I run with multiple processors, I get error
                          messages (see below).<br>
                          <br>
                          The matrices are constructed with
                          DMCreateMatrix(da, &A_matrix).<br>
                          <br>
                          I then set the values with
                          MatSetValuesStencil(A_matrix,1,&row,2,col_A,value_A,INSERT_VALUES).<br>
                          <br>
                          Finally, I call
                          MatAssemblyBegin(A_matrix,MAT_FINAL_ASSEMBLY)
                          and
                          MatAssemblyEnd(A_matrix,MAT_FINAL_ASSEMBLY).<br>
                          <br>
                          I also test that the matrices are assembled
                          with MatAssembled(A_matrix,
                          &is_assembled_bool), and it appears they
                          are successfully assembled.<br>
                          <br>
                          Any help/advice is greatly appreciated.<br>
                          <br>
                          Thanks in advance!<br>
                          <br>
                          -Paul Urbanczyk<br>
                          <br>
                          [0]PETSC ERROR: --------------------- Error
                          Message
                          --------------------------------------------------------------<br>
                          [0]PETSC ERROR: Invalid argument<br>
                          [0]PETSC ERROR: Wrong type of object:
                          Parameter # 1<br>
                          [0]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/documentation/faq.html</a>
                          for trouble shooting.<br>
                          [0]PETSC ERROR: Petsc Release Version 3.7.1,
                          unknown<br>
                          [0]PETSC ERROR: ./urbanSCFD on a
                          arch-linux2-c-debug named prometheus by gomer
                          Fri May 27 16:29:01 2016<br>
                          [0]PETSC ERROR: Configure options
                          --with-cc=mpicc --with-cxx=mpicxx
                          --with-fc=mpif90<br>
                          [0]PETSC ERROR: #1 AOApplicationToPetsc() line
                          267 in
                          /home/gomer/local/petsc/src/vec/is/ao/interface/ao.c<br>
                          [0]PETSC ERROR: #2 MatView_MPI_DA() line 557
                          in
                          /home/gomer/local/petsc/src/dm/impls/da/fdda.c<br>
                          [0]PETSC ERROR: #3 MatView() line 901 in
                          /home/gomer/local/petsc/src/mat/interface/matrix.c<br>
                          [1]PETSC ERROR: --------------------- Error
                          Message
                          --------------------------------------------------------------<br>
                          [1]PETSC ERROR: Invalid argument<br>
                          [1]PETSC ERROR: Wrong type of object:
                          Parameter # 1<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/documentation/faq.html</a>
                          for trouble shooting.<br>
                          [1]PETSC ERROR: Petsc Release Version 3.7.1,
                          unknown<br>
                          [1]PETSC ERROR: ./urbanSCFD on a
                          arch-linux2-c-debug named prometheus by gomer
                          Fri May 27 16:29:01 2016<br>
                          [1]PETSC ERROR: Configure options
                          --with-cc=mpicc --with-cxx=mpicxx
                          --with-fc=mpif90<br>
                          [1]PETSC ERROR: #1 AOApplicationToPetsc() line
                          267 in
                          /home/gomer/local/petsc/src/vec/is/ao/interface/ao.c<br>
                          [1]PETSC ERROR: #2 MatView_MPI_DA() line 557
                          in
                          /home/gomer/local/petsc/src/dm/impls/da/fdda.c<br>
                          [1]PETSC ERROR: #3 MatView() line 901 in
                          /home/gomer/local/petsc/src/mat/interface/matrix.c<br>
                          [0]PETSC ERROR: --------------------- Error
                          Message
                          --------------------------------------------------------------<br>
                          [0]PETSC ERROR: Invalid argument<br>
                          [1]PETSC ERROR: --------------------- Error
                          Message
                          --------------------------------------------------------------<br>
                          [1]PETSC ERROR: Invalid argument<br>
                          [1]PETSC ERROR: Wrong type of object:
                          Parameter # 1<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/documentation/faq.html</a>
                          for trouble shooting.<br>
                          [1]PETSC ERROR: Petsc Release Version 3.7.1,
                          unknown<br>
                          [1]PETSC ERROR: ./urbanSCFD on a
                          arch-linux2-c-debug named prometheus by gomer
                          Fri May 27 16:29:01 2016<br>
                          [1]PETSC ERROR: Configure options
                          --with-cc=mpicc --with-cxx=mpicxx
                          --with-fc=mpif90<br>
                          [1]PETSC ERROR: #4 AOApplicationToPetsc() line
                          267 in
                          /home/gomer/local/petsc/src/vec/is/ao/interface/ao.c<br>
                          [1]PETSC ERROR: #5 MatView_MPI_DA() line 557
                          in
                          /home/gomer/local/petsc/src/dm/impls/da/fdda.c<br>
                          [1]PETSC ERROR: #6 MatView() line 901 in
                          /home/gomer/local/petsc/src/mat/interface/matrix.c<br>
                          [0]PETSC ERROR: Wrong type of object:
                          Parameter # 1<br>
                          [0]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/documentation/faq.html</a>
                          for trouble shooting.<br>
                          [0]PETSC ERROR: Petsc Release Version 3.7.1,
                          unknown<br>
                          [0]PETSC ERROR: ./urbanSCFD on a
                          arch-linux2-c-debug named prometheus by gomer
                          Fri May 27 16:29:01 2016<br>
                          [0]PETSC ERROR: Configure options
                          --with-cc=mpicc --with-cxx=mpicxx
                          --with-fc=mpif90<br>
                          [0]PETSC ERROR: #4 AOApplicationToPetsc() line
                          267 in
                          /home/gomer/local/petsc/src/vec/is/ao/interface/ao.c<br>
                          [0]PETSC ERROR: #5 MatView_MPI_DA() line 557
                          in
                          /home/gomer/local/petsc/src/dm/impls/da/fdda.c<br>
                          [0]PETSC ERROR: #6 MatView() line 901 in
                          /home/gomer/local/petsc/src/mat/interface/matrix.c<br>
                          <br>
                          <br>
                        </blockquote>
                      </div>
                      <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></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>