I am trying to speed up a specific part of a large program, the exception handling is done at high level, originally the code looks like
for(....)
{
...
if(...)
{
throw std:: runtime_error("Terminated by user")
}
}
Now I have changed it to something like
#pragma omp parallel for ...
for(....)
{
...
if(...)
{
throw std:: runtime_error("Terminated by user")
}
}
And now if termination is triggered, the program crashes, I am expecting this exception handling here can be done in an elegant way without changing the higher level stuff?