The current mesh architecture requires the submeshes to provide their contributions to the stiffness and load vector. For multithreaded assembly, the element contributions are passed by value incurring an allocation and deallocation for each invocation. Move will not help us here as the moved to object will need to be deleted when it reaches the end of the scope.
With C++11 a thread_local specifier can be used and returned as a reference. Using this approach eliminates repeated heap allocations but in practice results in a bug likely to do with returning a pair of references. A small structural change would be required to pull these apart and simply request both of these separately.
[ ] Split dof_indices from element matrix / vector computations
The current mesh architecture requires the submeshes to provide their contributions to the stiffness and load vector. For multithreaded assembly, the element contributions are passed by value incurring an allocation and deallocation for each invocation. Move will not help us here as the moved to object will need to be deleted when it reaches the end of the scope.
With C++11 a
thread_local
specifier can be used and returned as a reference. Using this approach eliminates repeated heap allocations but in practice results in a bug likely to do with returning a pair of references. A small structural change would be required to pull these apart and simply request both of these separately.dof_indices
from element matrix / vector computationsthread_local
storage