MatLoad/VecLoad with user-specified partitioning

Barry Smith bsmith at
Tue Apr 14 15:50:21 CDT 2009

   We don't currently have support for setting the sizes before loading.

   You can do a default MatLoad() and then call MatGetSubMatrix() with  
desired IS for each process to get the values where you want. The  
runs quickly.


On Apr 14, 2009, at 1:52 PM, SUN Chun wrote:

> Hello PETSc developers,
> I want to use MatLoad to load matrix binary files from external  
> storage.
> Then solve it or do whatever in parallel. However, as soon as I load  
> it
> with MatLoad, I found that PETSc partition it automatically. I need to
> specify the partition myself. However I can't figure out where to
> properly use MatSetSizes: if I do MatSetSizes before MatLoad, it does
> nothing and MatGetSizes still gives me the auto-partitioning result  
> from
> PETSc; if I do MatSetSizes after MatLoad, it simply crashes with error
> message "cannot change/reset row sizes...".
> Neither can I find a proper example...
> Any comments would be great appreciated. Thank you very much.
> Chun

More information about the petsc-users mailing list