Thanks Barry, I also found this thread https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2009-February/003954.html also discussing similar issue. Sorry not to have found this earlier.
Thanks again, Chun -----Original Message----- From: petsc-users-bounces at mcs.anl.gov [mailto:[email protected]] On Behalf Of Barry Smith Sent: Tuesday, April 14, 2009 4:50 PM To: PETSc users list Subject: Re: MatLoad/VecLoad with user-specified partitioning We don't currently have support for setting the sizes before loading. You can do a default MatLoad() and then call MatGetSubMatrix() with the desired IS for each process to get the values where you want. The MatGetSubMatrix() runs quickly. Barry 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
