I know how to change the maximum number of workers using the Parallel preferences window in Matlab, but I cannot find any documentation about how to make changes on the preferences from console/code, and specifically about how to change the maximum number of workers I can use in a forloop. Any help will be greatly appreciated.
相关问题
- Extract matrix elements using a vector of column i
- How do you get R's null and residual deviance
- How to display an image represented by three matri
- OpenCV - Is there an implementation of marker base
- Avoid copying an array when using mexCallMATLAB
相关文章
- How do I append metadata to an image in Matlab?
- How can I write-protect the Matlab language?
- `std::sin` is wrong in the last bit
- Escape sequence to display apostrophe in MATLAB
- Vertical line fit using polyfit
- Reading .mat file using C: how to read cell-struct
- Is it possible to compare 3D images?
- How can I find row to all rows distance matrix bet
You want the
parpool
function. With no arguments it creates a default number of workers, with an integer argument it creates that many workers. If you just use aparfor
loop without calling it, you get the default number for your profile, but I'm not sure where that is set. There's more documentation on the mathworks website: http://www.mathworks.com/help/distcomp/parpool.htmlThe maximum number of workers should be effectively as large as you want, but you will stop gaining any efficiency if you create more workers than you have processors. Let me know if you need any advice on picking a good number of workers.