[petsc-users] Parallel matrix-vector multiplication

Gianluca Meneghello gianmail at gmail.com
Wed Nov 11 22:05:49 CST 2015


Hi,

I am trying to do something apparently really simple but with no success.

I need to perform a matrix-vector multiplication x = B f , where the length
of x is bigger than the length of f (or viceversa). Thus, B cannot be
created using DMCreateMatrix.

Both x and f are obtained from different DMs, the smaller covering only a
subdomain of the larger. The application is to apply a control f to a
system, e.g. \dot{x} = A x + B f.

The problem is, when running on more than one core, the vector x is not
organized as I would expect (everything works fine on a single core).

I attach a short example where B is intended to map f to the interior of x.

mpirun -n 1 ./test -draw_pause -1     works fine while
mpirun -n 2 ./test -draw_pause -1     shows the problem

I have not found any example with non square matrices in the src folder,
any help is very welcome.

Thanks for your time,

Gianluca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20151111/991c0f96/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.cpp
Type: text/x-c++src
Size: 2227 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20151111/991c0f96/attachment.cpp>


More information about the petsc-users mailing list