[petsc-users] Viewing DM Vector stored on Multiple GPUs

Ashwin Srinath ashwinsrnth at gmail.com
Tue Jun 24 21:15:49 CDT 2014


Hello, petsc-users

I'm having trouble *viewing* an mpicusp vector. Here's the simplest case
that reproduces the problem:

int main(int argc, char** argv) {

        PetscInitialize(&argc, &argv, NULL, NULL);

        DM da;
        Vec V;

        DMDACreate2d(   PETSC_COMM_WORLD,
                        DM_BOUNDARY_NONE, DM_BOUNDARY_NONE,
                        DMDA_STENCIL_BOX,
                        5, 5,
                        PETSC_DECIDE, PETSC_DECIDE,
                        1,
                        1,
                        NULL, NULL,
                        &da);

        DMCreateGlobalVector(da, &V);

        VecSet(V, 1);
        VecView(V, PETSC_VIEWER_STDOUT_WORLD);

        PetscFinalize();
        return 0;
}

I get the error:
[1]PETSC ERROR: Null argument, when expecting valid pointer
[0]PETSC ERROR: Trying to copy from a null pointer

I executed with the following command:
mpiexec -n 2 ./main -dm_vec_type cusp -vec_type cusp
Both GPUs are attached to two different processes.

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 *view* the
vector. Can someone please point out what I'm doing wrong?

Thanks for your time,
Ashwin Srinath
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140624/685c3dc1/attachment.html>


More information about the petsc-users mailing list