# [Trilinos-Users] Complex sparse matrix vector product focusing on load balancing

Zifan Liu zif.liu at gmail.com
Wed Dec 11 07:38:06 MST 2013

```Hi Mike,

Thanks for your suggestions. I think your approach will solve my problem
and I will try it in my application.
Thanks again for the help,

Zifan

On Wed, Dec 11, 2013 at 3:26 PM, Heroux, Mike <MHeroux at csbsju.edu> wrote:

> Zifan,
>
> One approach to consider with Epetra is to split the complex vectors into
> real and imaginary parts.  Essentially you would have an Epetra multivector
> with two columns, the first being the real coefficients and the second
> being the imaginary coefficients.
>
> Since your matrix is real-valued, there is no mixing of real and imaginary
> parts of x  when computing y, so computing y = Ax is just a sparse matrix
> multiply with two right-hand-sides.
>
> Epetra does support this operation.
>
> I think this approach would be more effective than trying to use complex
> arithmetic, because your matrix has no imaginary component.
>
> Does this help?
>
> Mike
>
> On Dec 11, 2013, at 6:47 AM, "Zifan Liu" <zif.liu at gmail.com<mailto:
> zif.liu at gmail.com>> wrote:
>
> Hello,
>
> I want to write a sparse matrix vector product kernel using trilinos.
>
> y=A*x
> where A is a large sparse real valued matrix.
> Vector x is a complex valued vector.
> Vector y is the result.
>
> The main steps and my solutions are the following:
>
> - Read the real-valued sparse matrix from a matlab file.---> Use
> "EpetraExt::MatlabFileToCrsMatrix()" function.
>
> - Perform load balancing and redistribute the data ---> Use
> "Isorropia::Epetra::createBalancedCopy" function.
>
> - Generate my complex vector x ---> ?
>
> - Perform the MVP y=A*x ---> ?
>
> Here, since the vector x is a complex valued vector, does Epetra support
> complex valued vector and complex valued MVP ?
>
> If not, can we perform load balancing and redistribute the matrix data
> using Tpetra ? Is there an example about this ?
>
> Thanks for your help,
>
> Z. L.
> --
> Mr. LIU Zifan
>
> Lab. PRiSM, University of Versailles, 45 avenue des Etats-Unis, 78035
> Versailles cedex FRANCE
>
> Maison de la simulation, Digiteo Labs-Bâtiment 565-PC 190, CEA/Saclay,
> 91191 Gif-sur-Yvette cedex FRANCE
>
> Tel (+33) 1 39 25 43 43
> Cell (+33) 6 42 03 25 96
> zifan.liu at prism.uvsq.fr<mailto:zifan.liu at prism.uvsq.fr>
> zif.liu at gmail.com<mailto:zif.liu at gmail.com>
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov<mailto:
> Trilinos-Users at software.sandia.gov>
> http://software.sandia.gov/mailman/listinfo/trilinos-users
>

--
Mr. LIU Zifan

Lab. PRiSM, University of Versailles, 45 avenue des Etats-Unis, 78035
Versailles cedex FRANCE

Maison de la simulation, Digiteo Labs-Bâtiment 565-PC 190, CEA/Saclay, 91191
Gif-sur-Yvette cedex FRANCE

Tel (+33) 1 39 25 43 43
Cell (+33) 6 42 03 25 96
zifan.liu at prism.uvsq.fr
zif.liu at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20131211/bccfe44f/attachment.html
```