-
Notifications
You must be signed in to change notification settings - Fork 276
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
Can one limit the number of cores or threads to run in parallel? #1600
Comments
I think like so, but please test and report back: import OCP
pool = OCP.OSD.OSD_ThreadPool.DefaultPool_s()
pool.SetNbDefaultThreadsToLaunch(N_THREADS) |
I just tried it, and it is still using all cores despite telling it to use only 3 out of the 10 on my MAC. (lq) rogerfrye@Rogers-Laptop LatticeQuery % python
Building an element of an array...
|
Other ideas: import OCP
pool = OCP.OSD.OSD_ThreadPool.DefaultPool_s()
pool.Init(N_THREADS) or try setting the |
Based on the OCCT code, maybe even like so: import OCP
pool = OCP.OSD.OSD_ThreadPool.DefaultPool_s(N_THREADS) |
The solution turned out to be to set the number of threads before importing cadquery: Thank you! |
I am running cadquery in a LatticeQuery environment which defines the function
eachpointAdaptive
similar to#628 (comment). The script runs quite fast since
shapes.py
setsSetRunParallel
true
, and it recruits all processors.But I am running on a server where it is not polite to hog the whole machine. Is there a way to tell cadquery to limit the maximum number of cores or threads to run in parallel?
The text was updated successfully, but these errors were encountered: