[petsc-dev] Copy scatter and change block size

Pierre Jolivet pierre.jolivet at enseeiht.fr
Sat Nov 25 14:04:08 CST 2017


> On 25 Nov 2017, at 7:49 PM, Stefano Zampini <stefano.zampini at gmail.com> wrote:
> 
> Pierre,
> 
> If you have access to the indices used to create the "unblocked" vecscatter, you can then call ISCreateBlock and obtain the vecscatter you want.

OK, that’s a better start.

> To obtain the garray,   MatMPIAIJGetSeqAIJ

Ah! I Ctrl+F’d the manual, but forgot to grep the sources.

Thank you very much,
Pierre

>> On Nov 25, 2017, at 9:26 PM, Pierre Jolivet <pierre.jolivet at enseeiht.fr <mailto:pierre.jolivet at enseeiht.fr>> wrote:
>> 
>> OK, so I guess I need to tinker around with VecScatterCreate.
>> As a follow-up question, is there an easy way to get the “garray” from http://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/aij/mpi/mmaij.c.html#line105 <http://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/aij/mpi/mmaij.c.html#line105> to create the IS I need to feed to VecScatterCreate (after resizing by multiplying its size by bs and by shifting/inserting the proper indices)?
>> Basically, I want to create the VecScatter for doing MatMult with a MATSHELL similar to a MATMPIBAIJ, and I want to re-use the information generated by the MatSetUpMultiply_MPIAIJ from a previously set up MATMPIAIJ with the same sparsity pattern.
>> 
>> Thanks,
>> Pierre
>> 
>>> On 25 Nov 2017, at 4:43 PM, Smith, Barry F. <bsmith at mcs.anl.gov <mailto:bsmith at mcs.anl.gov>> wrote:
>>> 
>>> 
>>>  Pierre,
>>> 
>>>    There is not. The block size is baked directly into the scatter data structure so not trivial to change in a copy.
>>> 
>>>  Barry
>>> 
>>> 
>>>> On Nov 25, 2017, at 7:41 AM, Pierre Jolivet <pierre.jolivet at enseeiht.fr <mailto:pierre.jolivet at enseeiht.fr>> wrote:
>>>> 
>>>> Hello,
>>>> Given a VecScatter inctx that operates on vectors x and y, I’d like to create a VecScatter inctx_bs with the same pattern, but that operators on vectors x_bs and y_bs with different block sizes than the original x and y (and that are thus of sizes n * bs).
>>>> Is there an easy way to do this (I’m a VecScatter noob, sorry in advance if this is trivial)?
>>>> 
>>>> Thank you,
>>>> Pierre
>>> 
>> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20171125/7025a5a2/attachment.html>


More information about the petsc-dev mailing list