<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>