[petsc-dev] MatLoad/VecLoad for a file with multiple objects

Vaclav Hapla vaclav.hapla at erdw.ethz.ch
Fri Mar 23 11:39:45 CDT 2018


Hello

I'm quite surprised that there can be multiple objects in a single binary file, and they must be loaded in the exact order they are in the file. This behavior is not documented in MatLoad or VecLoad.

For instance, there can be a matrix A, RHS b and initial guess x0 stored in one file in this order, but you have to call
  MatLoad(A,viewer); VecLoad(b,viewer); VecLoad(x0,viewer);
in the same order.

When you e.g. call VecLoad first, it fails with "Not a vector next in file". This I think is not exactly informative (it says there's no vector but doesn't say that there's something different, actually a matrix).

I can make a PR documenting this, maybe also improving the error message, if you otherwise find this behavior OK.

Vaclav


More information about the petsc-dev mailing list