I would like to use ObjectView and MatLoad for saving the PETSc numbering solution (vectors) in binary, possible to dome post-processing in Matlab, etc. However, when I am loading the results back in FreeFem, I get a very stange behavior: the unknown numbering change per process. The following MWE demonstrates this behavior:
PETSc does not store the partitioning. This has the big advantage that you can save with, e.g., 1 process, and then load with, e.g., 4 processes. In plain PETSc, you can force the local dimension before loading a Mat so that the partitioning suits your needs, but this is not implemented in the FreeFEM plugin. I could add that if you want, though, I’m not sure when (probably not before the end of this weekend).
Thanks for the quick reply, this makes complete sense.
I think there is no need for you implement additional features, I think I can just (i) save the vector, (ii) save the numbering accessed via GlobalNumbering (along with the corresponding ranks), (iii) load the vector and and the numbering on rank 0, and (iv) distribute the vector myself among the processes. Please correct me if I am wrong.
I was trying to implement what I described above, however, it did not work. The error can be reproduced in the MWE I posted initially: I would expect it to work with reading only on a single core:
However, at MatLoad the script seems to freeze. Is this behavior intended, or is this a bug?
(Again, I think I can circumvent this, I am just curious and I would like to understand the behavior)