I have a parallel (MPI) c/c++ program that from time to time leads to an error under certain conditions. Once the error occurs, a message is printed and the program exits; I'd like to set a break point to see the stack and more detail regarding what caused the error. I'm using TotalView to debug things, and I'd like it to stop at a break point in my error routine. I'd like it to always, automatically setup this break point. Is there a way to do this?
I'm looking into using signal.h and raise, but it's not clear yet how TotalView responds.
Looking at this question, How do you stop in TotalView after an MPI Error?, it appears that C++ exception handling, i.e. throw(), will automatically cause TotalView to stop. What's the right way to do this in C?