<div dir="ltr">Here's the error message in it's entirety:<br><br>Vec Object: 2 MPI processes<br>  type: mpicusp<br>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>
[0]PETSC ERROR: Null argument, when expecting valid pointer<br>[0]PETSC ERROR: Trying to copy from a null pointer<br>[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<br>
[0]PETSC ERROR: Petsc Development GIT revision: v3.4.4-4683-ga6c8f22  GIT Date: 2014-06-24 11:28:06 -0500<br>[0]PETSC ERROR: /newscratch/atrikut/issue/main on a arch-linux2-cxx-debug named node1774 by atrikut Tue Jun 24 21:59:13 2014<br>
[0]PETSC ERROR: Configure options --with-cuda=1 --with-cusp=1 --with-cusp-dir=/home/atrikut/local/cusplibrary --with-thrust=1 --with-precision=double --with-cuda-arch=sm_21 --with-clanguage=cxx --download-txpetscgpu=1 --with-shared-libraries=1 --with-cuda-dir=/opt/cuda-toolkit/5.5.22 --with-mpi-dir=/opt/mpich2/1.4<br>
[0]PETSC ERROR: [1]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>[1]PETSC ERROR: Null argument, when expecting valid pointer<br>[1]PETSC ERROR: Trying to copy from a null pointer<br>
[1]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<br>[1]PETSC ERROR: Petsc Development GIT revision: v3.4.4-4683-ga6c8f22  GIT Date: 2014-06-24 11:28:06 -0500<br>
[1]PETSC ERROR: /newscratch/atrikut/issue/main on a arch-linux2-cxx-debug named node1774 by atrikut Tue Jun 24 21:59:13 2014<br>[1]PETSC ERROR: Configure options --with-cuda=1 --with-cusp=1 --with-cusp-dir=/home/atrikut/local/cusplibrary --with-thrust=1 --with-precision=double --with-cuda-arch=sm_21 --with-clanguage=cxx --download-txpetscgpu=1 --with-shared-libraries=1 --with-cuda-dir=/opt/cuda-toolkit/5.5.22 --with-mpi-dir=/opt/mpich2/1.4<br>
[1]PETSC ERROR: #1 PetscMemcpy() line 1892 in /home/atrikut/local/petsc-dev/include/petscsys.h<br>[1]PETSC ERROR: #1 PetscMemcpy() line 1892 in /home/atrikut/local/petsc-dev/include/petscsys.h<br>[0]PETSC ERROR: #2 VecScatterBegin_1() line 124 in /home/atrikut/local/petsc-dev/include/../src/vec/vec/utils/vpscat.h<br>
[0]PETSC ERROR: #3 VecScatterBegin() line 1724 in /home/atrikut/local/petsc-dev/src/vec/vec/utils/vscat.c<br>[0]PETSC ERROR: #4 DMDAGlobalToNaturalBegin() line 171 in /home/atrikut/local/petsc-dev/src/dm/impls/da/dagtol.c<br>
#2 VecScatterBegin_1() line 124 in /home/atrikut/local/petsc-dev/include/../src/vec/vec/utils/vpscat.h<br>[1]PETSC ERROR: #3 VecScatterBegin() line 1724 in /home/atrikut/local/petsc-dev/src/vec/vec/utils/vscat.c<br>[0]PETSC ERROR: #5 VecView_MPI_DA() line 721 in /home/atrikut/local/petsc-dev/src/dm/impls/da/gr2.c<br>
[0]PETSC ERROR: [1]PETSC ERROR: #4 DMDAGlobalToNaturalBegin() line 171 in /home/atrikut/local/petsc-dev/src/dm/impls/da/dagtol.c<br>[1]PETSC ERROR: #6 VecView() line 601 in /home/atrikut/local/petsc-dev/src/vec/vec/interface/vector.c<br>
#5 VecView_MPI_DA() line 721 in /home/atrikut/local/petsc-dev/src/dm/impls/da/gr2.c<br>[1]PETSC ERROR: #6 VecView() line 601 in /home/atrikut/local/petsc-dev/src/vec/vec/interface/vector.c<br>WARNING! There are options you set that were not used!<br>
WARNING! could be spelling mistake, etc!<br>Option left: name:-vec_type value: cusp<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 24, 2014 at 10:15 PM, Ashwin Srinath <span dir="ltr"><<a href="mailto:ashwinsrnth@gmail.com" target="_blank">ashwinsrnth@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 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></div><br></div>