如何从控制台设置parpool/matlabpool中的最大工人数? [英] How to set the max number of workers in parpool/matlabpool from console?

查看:696
本文介绍了如何从控制台设置parpool/matlabpool中的最大工人数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何使用Matlab中的并行"首选项窗口来更改最大数量的工作程序,但是我找不到任何有关如何从控制台/代码更改首选项的文档,尤其是关于如何更改最大数量的工作人员的文档.我可以在forloop中使用的工人.任何帮助将不胜感激.

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.

推荐答案

您需要parpool函数.不带参数的情况下,它将创建默认数量的工作程序;带整数参数的情况下,它将创建那么多工作程序.如果仅使用parfor循环而不调用它,则会获得配置文件的默认编号,但是我不确定该设置在何处. mathworks网站上有更多文档: http://www.mathworks.com/help/distcomp /parpool.html

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 a parfor 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.html

最大数量的工作人员应该有效地达到所需的最大数量,但是如果创建的工作人员多于处理器数量,您将停止获得任何效率.让我知道您是否在选择大量工人方面需要任何建议.

The 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.

这篇关于如何从控制台设置parpool/matlabpool中的最大工人数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆