[petsc-users] converting matrices between petsc and scalapack/blacs format?
Matthew Knepley
knepley at gmail.com
Fri Aug 31 06:41:54 CDT 2018
On Fri, Aug 31, 2018 at 7:34 AM Giacomo Mulas <giacomo.mulas at inaf.it> wrote:
> Hello.
>
> I have a relatively silly problem: in a software I developed, which
> originally always used SLEPC, I now introduced support for using also
> scalapack and elpa as eigensolvers, in cases in which this is convenient.
> Is there a simple way to have PETSC create a matrix in blacs compatible
> format?
>
> Alternatively, I am thinking to use MatView to write the PETSC matrix to a
> file and then read it back. This would also have the nice side-effect to
> enable me to separate the part of the code the sets up and creates the
> matrix from the part the calls the appropriate eigensolver. The best thing
> would be to use MatView to write a binary file and then create a simple
> function to reread it, create a blacs matrix and populate it
> appropriately.
> In the docs for MatLoad() the format of binary files created by MatView is
> given in terms of int and PetscScalar values. Now, since in some cases (on
> some machines) I compiled PETSC to use 64 bit indices, I need to be extra
> careful on what "int" means! Is it just "int", or PetscInt, or
> PetscBLASInt, or...? From a quick look at MatView_MPIAIJ_Binary() I would
> guess they are PetscInt and are written by calls to PetscBinaryWrite(),
> meaning I should use calls to PetscBinaryRead() to get them back. Is this
> correct?
>
Yes, that is all correct. I wonder if you could convince a) SLEPc to
support Elpa,
or better convince Elpa to support Elemental. BLACS is icky inside :)
Thanks,
Matt
> Thanks in advance
> Giacomo
>
> --
> _________________________________________________________________
>
> Giacomo Mulas <giacomo.mulas at inaf.it>
> _________________________________________________________________
>
> INAF - Osservatorio Astronomico di Cagliari
> via della scienza 5 - 09047 Selargius (CA)
>
> tel. +39 070 71180255
> mob. : +39 329 6603810
> _________________________________________________________________
>
> "When the storms are raging around you, stay right where you are"
> (Freddy Mercury)
> _________________________________________________________________
>
--
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-users/attachments/20180831/7520d771/attachment-0001.html>
More information about the petsc-users
mailing list