[petsc-users] Most efficient way to transfer a vector to a single processor

Andrew Spott andrew.spott at gmail.com
Wed Apr 4 16:47:28 CDT 2012


I'm interested in moving a vector to a single processor (so I can output it in some custom way), but I can't find a simple way to do that.

Is the easiest way to output the parallel vector to a file and then read it in to a single processor vector?

Also, an unrelated question:  If I have a vector that I'm using as the result of a matrix vector product, but it is initially empty, do I need to initialize it in any way?  or can I just create it and run with it:

… create x and A ...
VecCreate(world, &b);
MatGetVecs(A,&x,&b);

… do stuff with x and A ...

MatMult(A,x,b);

Thanks for the help,

-Andrew


More information about the petsc-users mailing list