New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multicore improvements #69
Commits on Jun 4, 2021
-
feat: allow controll of the maximum number of cpus using BELLMAN_NUM_…
…CPUS (cherry picked from commit 37686f8)
-
-
fix: only spawn threads into a pool, to avoid unlimited thread spawns
(cherry picked from commit dca4c5a) pick: Only the changes to bellman::multicore.
-
feat: limited thread spawning and unroll recursion in multiexp
(cherry picked from commit c55d5e4) Changes during pick: - Excluded GPU-related changes (not upstreamed yet). - Added fix for change to Field::double API. - Fixed no-multicore Worker impl. Co-authored-by: Jack Grigg <thestr4d@gmail.com>
-
chore: log error if waiter is used within a thread pool
If a waiter is used from within a thread pool it might deadlock. Don't do that. (cherry picked from commit dc13606)
-
feat: fix bug in parallelism inherent in the Worker/Waiter model
The Worker/Waiter model creates a Worker that requests that threads be spawned to complete some work. Since there is no bound to the number of requests for work, it's possible to exhaust memory with pending closures waiting to be processed. This was not an issue when 'everything was bounded by a single thread pool', however that setup has race conditions built into it. We have recently spent time splitting that model out, and this should be the final step required. This code places a limit on the number of requests that can be queued in an attempt to lessen the chance of memory exhaustion due to pending requests. It does this by placing a limit that is a simple multiple of the number of cores available (and in testing is far below observed crash criteria). When the number of requests for spawning new threads reaches that limit, instead of adding a new request, we block on execution to help clear the backlog. (cherry picked from commit 74947c0) pick: Also includes log change from b481a34
-
(cherry picked from commit 007487f)
-
-
-
-
-
multicore: Unconditionally panic if Waiter::wait is called from threa…
…dpool This occurring is a programming error. Co-authored-by: Daira Hopwood <daira@jacaranda.org>
-
multicore: Code simplification
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
-
multicore: Documentation tweaks
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Commits on Aug 15, 2021
-
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
-
Use global threadpool unless we exceed
WORKER_SPAWN_MAX_COUNT
. This…… is expected to play more nicely with other uses of rayon in the same process (avoiding excess parallelism). Signed-off-by: Daira Hopwood <daira@jacaranda.org>
-
Rename
multicore::log_num_cpus
tolog_num_threads
.Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Commits on Aug 25, 2021
Commits on Aug 26, 2021
-
Simplify by removing the overflow thread pool
Co-authored-by: str4d <thestr4d@gmail.com>
-
Bugfix:
log_num_cpus
should be renamed also for the dummy (non-mult……icore) implementation. Signed-off-by: Daira Hopwood <daira@jacaranda.org>
-
Merge pull request #71 from daira/daira-multicore
Use global rayon threadpool for multicore