Parallelize synchronous `apply_rule`
Description
Application of rules can be demanding when many entities have to be treated. It may be desirable to parallelize execution of a simulation step, by parallelizing rule application. Since execution policies are not yet available in the compilers, we have to enable this ourselves. Using std::thread and Threadpool snippets, parallelization can be pushed to the OS System handling multi-core Threading.
Proposal
- Use
std::thread
and with the threadpool snippet provided in https://ts-gitlab.iup.uni-heidelberg.de/snippets/22 - Add documentation for the parallel versions
- Add a remark in the docs that the user is responsible for making rules thread safe.
- Do not make parallel execution the default. It has to be an actively taken choice by the user.
How to test the implementation?
Implement a test for testing, if parallelization is working. Perhaps provide performance checks which for a simple and complicated update rule check the effect of parallelization.
Related issues
Meta-task: models#287
Edited by Utopia Developers