[petsc-users] Slepc reading distributed matrix from files

Barry Smith bsmith at mcs.anl.gov
Tue Jul 4 12:08:10 CDT 2017


    We recommend writing a utility program that runs on one process and reads in the files putting the values into a matrix then using MatView() with a binary viewer to save the matrix to a file. 

     Then in your parallel program you simply call MatLoad() and it efficiently loads up the matrix into your program in parallel.

     This means you don't need to write a parallel reader, you only need to write a sequential one which is easier.

   Barry

> On Jul 4, 2017, at 4:22 AM, errabii sohaib <errabiisohaib at gmail.com> wrote:
> 
> Hi, 
> 
> I am trying to use petsc4py and slepc4py to read a matrix that is distributed on several files, In which i save the non zero elements by specifiying three arrays (A, I, J) for Coeffs, rows and columns indices. 
> I am currently using MUMPS and i simply read a file and pass the A,I,J arrays to MUMPS with each process. I am trying to do the same, however i am still confused how matrices are structured in PETSc and if its even possible to read n files and pass the matrix to PETsc to solve with slepc4py using atleast n processes.
> 
> Thank you very much for your time,
> Sohaib.
> 
> 
> 



More information about the petsc-users mailing list