WIP Feature Hybrid Parallel and SIMD by pcarruscag · Pull Request #824 · su2code/SU2
The work item from #789 being worked on at the moment is colour-based parallel residual loops (at this point we have hybrid parallel!).
As was done for the FEA solver one numerics instance per thread is required since to use these classes one needs to write data onto them. Similarly we need thread-private copies of the small structures we then write to the residual and Jacobian, these are currently allocated by the solver.
Possible solutions:
- Allocate local temporaries in each edge loop;
- The solver allocates an array of these instead of just one for each thread to use;
- The ownership is transferred into the numerics (as currently done by the FEA classes).
I am going with the third option, the solver will call ComputeResidual as usual but instead of passing in one array and two small matrices, it will get references to the internally (to CNumerics) allocated ones.
As part of this I will restructure the CNumerics family, applying the same cleanups that we have been doing for other classes. No significant code changes are planned.