[petsc-users] Quick question about ISCreateGeneral

Smith, Barry F. bsmith at mcs.anl.gov
Wed May 1 13:20:23 CDT 2019



> On May 1, 2019, at 12:02 PM, Sajid Ali <sajidsyed2021 at u.northwestern.edu> wrote:
> 
> Hi Barry, 
> 
> I've written a simple program that does a scatter and reverses the order of data between two vectors with locally generate index sets and it works. While I'd have expected that I would need to concatenate the index sets before calling vecscatter, the program works without doing so (hopefully making it more efficient).

    I am not sure what you mean by concatenating the index sets. When using a parallel vector associated with the IS the values are "virtually" concatenated in the sense that they are treated as just one huge array of indices but they need not be physically concatenated. Each process just keeps its part.

> Does calling vecscatter on each rank with the local index set take care of the necessary communication behind the scenes then? 

  Yes, that is what the VecScatter does, it figures out based on what each process provides what communication needs to take place.

   Barry

> 
> Thank You,
> Sajid Ali
> Applied Physics
> Northwestern University
> <ex_modify.c>



More information about the petsc-users mailing list