Multiple cores per process/thread
See original GitHub issueWe have a use case where we would like to dask.distributed to parallelize a python-bound C++ program that would work best if it could consume 8-32 threads depending on the problem size and will manage threading internally. Normally, a Dask worker is run on a node that has 32 cores with the worker using 2 processes at 1 thread each so that we can give each process 16 cores.
Looking at the code currently, it seems that nthreads = ncores / nprocesses
without exceptions, is there a canonical way to change this so that we can orchestrate our normal Dask worker operation with dask-jobqueue?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:65 (41 by maintainers)
Top Results From Across the Web
CPU Core, Multi-Core, Thread, Core vs Threads, Hyper ...
In parallel execution, the tasks to be performed by a process are broken down into sub-parts, and multiple CPUs (or multiple cores) process ......
Read more >c# - How do I spawn threads on different CPU cores?
There you can find a function to enumerate a process' threads as a collection of ProcessThread objects. This class has methods to set ......
Read more >Multi-core and multi-threading performance ... - Scali's OpenBlog
For the OS, a thread is a unit of workload which can be scheduled to execute on a single core. This scheduling appears...
Read more >Process vs Thread vs Core - YouTube
Learn about a process vs thread vs core including concurrent vs parallel program execution, logical vs physical cores, how threads run in a ......
Read more >If a CPU is a dual core with 4 threads, does that mean it can ...
So, you get one process running per core. That's two processes running on a dual core. One level up, each core has 2...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This thread has moved through several design concepts, let me try to recap:
task
should be handled through theresources
client/worker commands as jobqueue/dask-worker does not have much of an understanding of a task.nthreads = ncores / nprocs
by default.We can approach this in a few ways:
worker_nthreads = None
orworker_threads_per_process = None
which sets workernthreads
and default behavior if None.dask-worker
withnthreads
/nprocs
(would require deprecating the currentprocesses
keyword)one_thread_per_process = False/True
,False
is current behaviour whileTrue
setsnthreads=1
.I would very much vote for the
nthreads
/nprocs
suggestion even if another warning needs to be thrown. This will keep the code logic and user understanding exactly the same as launching adask-worker
.This would indeed be great!