Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I inspect Vec and Mat values when in the debugger?

debugger inspect MAT values VEC
0
Posted

How can I inspect Vec and Mat values when in the debugger?

0
10

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

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123