-
Notifications
You must be signed in to change notification settings - Fork 152
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
CPU count is not configurable in mproc/umproc implementations #120
Comments
So far, there is no recommended way to do this. |
I would recommend to leave the spot_setup instance out of it, because the number of cores is definetly a property of the sampler and not of the setup. How about an attribute of _algorithm, that can be set? |
A setting of the cpu-cores via |
I personally feel that setting a global variable as a setting parameter can get confusing. I like the thought of putting it into In order to avoid confusion with the mpi setting, we could always put it in the docs saying the setting is only used if mproc or umproc is being used, and ignored otherwise. I've seen this style in multiple libraries (sklearn being one of them), so I'm pretty sure it's idiomatic. |
This should be taken into account when fixing #266 |
In
mproc.py
andumproc.py
, the code uses the maximum CPU count by default for computation.This isn't always the best idea. For instance, in my particular use case, I am running spotpy on a shared 64-core machine and would like to specify the maximum amount of CPU's to use so I don't hog the resource (and I don't wish to use mpi).
This shouldn't be a large change in my estimate. We can pick up the maximum CPU count from the spot_setup instance if it exists, and otherwise just default to max CPU count.
Not sure if there is another recommended way of doing this in spotpy, or if I should go ahead and make a PR.
The text was updated successfully, but these errors were encountered: