[petsc-users] Reading in the full matrix in one process and then trying to solve in parallel with PETSc

Matthew Knepley knepley at gmail.com
Fri Sep 20 07:08:28 CDT 2019


On Fri, Sep 20, 2019 at 7:54 AM Bao Kai via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> Hi,
>
> I understand that PETSc is not designed to be used this way, while I
> am wondering if someone have done something similar to this.
>
> We have the full matrix from a simulation and rhs vector. We would
> like to read in through PETSc in one process, then we use some
> partition functions to partition the matrix.
>
> Based on the partition information, we redistribute the matrix among
> the processes. Then we solve it in parallel.  It is for testing the
> performance of some parallel linear solver and preconditions.
>
> We are not in the position to develop a full parallel implementation
> of the simulator yet.
>

This is not hard to do.

1) Write a simple serial converter that reads in your matrix in whatever
format you have it, and output it in PETSc Binary format
     using MatView() with a binary viewer. Same for the vector, and they
can be in the same file.

2) Run your parallel code and use MatLoad/VecLoad for the system and it
will automatically partition it.

  Thanks,

     Matt


> Thanks.
>
> Cheers,
> Kai Bao
>


-- 
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/20190920/22313915/attachment.html>


More information about the petsc-users mailing list