[petsc-dev] Petsc Parallel Matrix Vector Multiplication for Skew-Symmetric Matrix

Barry Smith bsmith at petsc.dev
Wed Jun 2 17:35:44 CDT 2021


 The easiest way to find implementations on the web is to type the function name MatMult() in google and look at the bottom of the page where it has links to all the implementations. Of course you have to guess which implementation you need based on the shortened names. Here is the one you want

https://petsc.org/release/src/mat/impls/sbaij/mpi/mpisbaij.c.html#MatMult_MPISBAIJ <https://petsc.org/release/src/mat/impls/sbaij/mpi/mpisbaij.c.html#MatMult_MPISBAIJ>

All you need to do is flip the sign of the transpose multiple.

The creation of the needed VecScatter and work vectors is done here https://petsc.org/release/src/mat/impls/sbaij/mpi/mmsbaij.c <https://petsc.org/release/src/mat/impls/sbaij/mpi/mmsbaij.c> it concatenates the two needed parallel communications into a singe VecScatter. 





> On Jun 2, 2021, at 3:00 PM, Mark Adams <mfadams at lbl.gov> wrote:
> 
> I guess we still have a MATSBAIJ. 
> In theory you could modify the MatVec to do skew-symmetric, easily, but this is such a niche operation (never seen it requested in 20+ years) that I would not want to put it in the repo.
> This would save <2x memory and <2x time. If you have a blocked system then it would be close to 2x.
> You could do this in a branch and just rebase over main to update PETSc. Forever, or until you can convince us to merge it.
> 
> On Wed, Jun 2, 2021 at 3:26 PM Matthew Knepley <knepley at gmail.com <mailto:knepley at gmail.com>> wrote:
> On Wed, Jun 2, 2021 at 3:23 PM Yağmur Aksan <yagmuraksan at gmail.com <mailto:yagmuraksan at gmail.com>> wrote:
> Hello,
> 
> I need a function that parallelly multiplies skew-symmetric matrix and vector. Is there any function that Petsc provides? 
> To do so, I think of using matMult function in Petsc and changing it to work with skew-symmetric matrices. But, I haven't found the implementation of MatMult function. If there isn't any other better option that you can recommend me, could you please tell me the link for the implementation of MatMult function?
> 
> Do you want to save memory by using the special format? It will not save computing, and the speed improvement can be very small.
> 
>   Thanks,
> 
>      Matt
>  
> Thank you.
> -- 
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener
> 
> https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>

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


More information about the petsc-dev mailing list