> 1. Thus this issue would not exist for simple parallel tasks involving
> a reduction operation, such as computing average stresses over the
> domain, using Threads::new_task?
Correct. This is the test that checks this:
https://github.com/dealii/dealii/blob/master/tests/multithreading/task_01_exception.cc
> 2. The ExceptionBase::print_stack_trace() function does not print
> anything if I catch an exception thrown using AssetThrow(cond,
> dealii::ExcMessage()) or even my own MyException class derived from
> ExceptionBase. How do I ensure that the stack trace is "populated". I
> tried using the set_fields() function but it did not help.
Can you illustrate in a small test case what you are trying to do?
> 3. Considering the parallelization of stress averaging, how could I do a
> reduction operation to ensure summation of the thread local stresses
> into a "global" variable once I have distributed the computation using
> the idea described on pg-10 pf Video Lecture-40 slides? Is Workstream
> the only solution, or is there some less involved alternative, since I
> just need to sum the return values of the Compute_stressSumOnCellRange()
> function?
It's difficult because you probably don't want the object you want to
sum into to be thread-local (assuming that it is not just a single
number). WorkStream was invented to work around exactly these sorts of
problems. We wrote a whole paper about WorkStream precisely because it
is not trivial to get right, and any alternative solution I could offer
would also not be trivial.
Best
W.