[petsc-users] question about VecScatter from one global vector to another

Randall Mackie rlmackie862 at gmail.com
Fri Feb 19 18:33:50 CST 2016


I am trying to do a VecScatter of a subset of elements from a global vector on one DMDA to a global vector on a different DMDA (different sized DMDAs).

I thought what made sense was to create a parallel IS using the local to global mapping obtained from the two DMDAs so that the local portion of each IS contained only the values on that processor.

This works fine as long as the local size of the two IS’s are the same.

But, say I have a situation like this:

DMDA 1:
  proc 1: 1 value to scatter
  proc 2: 7 values to scatter


DMDA 2:
  proc 1: 4 values to get
  proc 2: 4 values to get

This doesn’t work because VecScatterCreate says the local size of the IS’s must be the same.

Is the only way to set up this VecScatter to create a sequential IS on each processor of length 8 and duplicate the values?

Thanks,

Randy M.



More information about the petsc-users mailing list