<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi Ashwin,<br>
      <br>
      I've been working on this issue the last couple of days and wanted
      to give you an update. First off, thanks for the test case. This
      has helped a lot in tracking down the issues. I've created a
      couple of unit tests based on your test case.<br>
      <br>
      There were several independent bugs that prevented the VecView to
      work with -dm_vec_type cusp. I've fixed some of them in this
      branch:<br>
      <br>
      <a class="moz-txt-link-freetext" href="https://bitbucket.org/dmeiser/petsc/branch/fix-cusp-dmda">https://bitbucket.org/dmeiser/petsc/branch/fix-cusp-dmda</a><br>
      <br>
      Viewing a vector created from a DM should now be possible. For
      instance the test case you provided should work with this branch.<br>
      <br>
      There are still some issues remaining. DMGlobalToLocalBegin/End
      and DMLocalToGlobalBegin/End are not working. I haven't been able
      to track these down yet. I'll return to this next week.<br>
      <br>
      Cheers,<br>
      Dominic<br>
      <br>
      <br>
      On 06/24/2014 08:15 PM, Ashwin Srinath wrote:<br>
    </div>
    <blockquote
cite="mid:CAAxipY8Z-EF4Y38L6JmkWSiKmk4KJJnQXUtBuY2dUUxWJ1v4+g@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Hello, petsc-users<br>
          <br>
          I'm having trouble <i>viewing</i> an mpicusp vector. Here's
          the simplest case that reproduces the problem:<br>
          <br>
          <span style="font-family:courier new,monospace">int main(int
            argc, char** argv) {<br>
            <br>
                    PetscInitialize(&argc, &argv, NULL, NULL);<br>
            <br>
                    DM da;<br>
                    Vec V;<br>
            <br>
                    DMDACreate2d(   PETSC_COMM_WORLD,<br>
                                    DM_BOUNDARY_NONE, DM_BOUNDARY_NONE,<br>
                                    DMDA_STENCIL_BOX,<br>
                                    5, 5,<br>
                                    PETSC_DECIDE, PETSC_DECIDE,<br>
                                    1,<br>
                                    1,<br>
                                    NULL, NULL,<br>
                                    &da);<br>
            <br>
                    DMCreateGlobalVector(da, &V);<br>
            <br>
                    VecSet(V, 1);<br>
          </span></div>
        <div><span style="font-family:courier new,monospace">       
            VecView(V, PETSC_VIEWER_STDOUT_WORLD);<br>
            <br>
                    PetscFinalize();<br>
                    return 0;<br>
            }<br>
          </span><br>
        </div>
        <div>I get the error<span style="font-family:courier
            new,monospace">:<br>
            [1]PETSC ERROR: Null argument, when expecting valid pointer<br>
            [0]PETSC ERROR: Trying to copy from a null pointer</span><br>
          <br>
          I executed with the following command:<br>
        </div>
        <div>
          <div>
            <div><span style="font-family:courier new,monospace">mpiexec
                -n 2 ./main -dm_vec_type cusp -vec_type cusp</span><br>
            </div>
            <div>Both GPUs are attached to two different processes. <br>
            </div>
            <div><br>
              This program works fine for vecmpi vectors, i.e.,
              -dm_vec_type mpi and -vec_type mpi. Also, I don't get an
              error unless I try to <i>view</i> the vector. Can someone
              please point out what I'm doing wrong?<br>
              <br>
              Thanks for your time,<br>
            </div>
            <div>Ashwin Srinath<br>
            </div>
            <div><br>
            </div>
            <div><br>
              <br>
              <br>
              <br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Dominic Meiser
Tech-X Corporation
5621 Arapahoe Avenue
Boulder, CO 80303
USA
Telephone: 303-996-2036
Fax: 303-448-7756
<a class="moz-txt-link-abbreviated" href="http://www.txcorp.com">www.txcorp.com</a></pre>
  </body>
</html>