How can I inspect Vec and Mat values when in the debugger?
I will illustrate this with gdb, but it should be similar on other debuggers. You can look at local Vec values directly by obtaining the array. For a Vec v, we can print all local values using (gdb) p ((Vec_Seq*) v->data)->array[0]@v->map.n However, this becomes much more complicated for a matrix. Therefore, it is advisable to use the default viewer to look at the object. For a Vec v and a Mat m, this would be (gdb) call VecView(v, 0) (gdb) call MatView(m, 0) or with a communicator other than MPI_COMM_WORLD, (gdb) call MatView(m, PETSC_VIEWER_STDOUT_(m->comm)) error while loading shared libraries: libimf.so: cannot open shared object file: No such file or directory. The Intel compilers use shared libraries (like libimf) that cannot by default at run time. When using the Intel compilers (and running the resulting code) you must make sure that the proper Intel initialization scripts are run. This is usually done by putting some code into your .cshrc, .bashrc, .profile etc file. Sometimes