MATLAB 和使用多核运行计算
嘿大家。我正在尝试找出如何让 MATLAB 尽可能最佳地运行。我有一台相当不错的新机器。
12GB内存 酷睿 i7 3.2Ghz 中央处理器 和大量的可用空间。 和强大的显卡。
然而,当我运行 MATLAB(命令台)的基准测试时,它将计算机列为接近最差的计算机,大约是 Windows XP 单核 1.7Ghz 计算机。
有什么想法为什么以及如何改进这个吗?
非常感谢
Hey all. Im trying to sort out how to get MATLAB running as best as possible. I have a pretty decent new machine.
12GB RAM
Core i7 3.2Ghz Cpu
and lots of free space.
and a strong graphics card.
However when I run the benchmark test of MATLAB (command bench) it lists the computer as being near the worst, around a Windows XP single core 1.7Ghz machine.
Any ideas why and how I can improve this??
Thanks very much
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
首先,我建议重新运行 bench 命令几次,以确保 MATLAB 已完全加载它需要的所有库等。 MATLAB 的大部分内容都是按需加载的,因此最好为第二次或第三次运行计时。
MATLAB 在执行某些多线程操作时会自动利用多个内核。例如,许多元素操作,例如
+
、.*
等以及 BLAS 支持的操作(可能还有其他操作)。 此页面列出了那些是多线程的。当 MATLAB 的内在多线程无法提供帮助时,并行计算工具箱非常有用(如果可以,那么它通常是最快的处理方式)。这通过 PARFOR 为您提供了明确的并行性,SPMD 和 分布式数组。
Firstly, I would recommend re-running the bench command a few times to make sure MATLAB has fully loaded all the libraries etc. it needs. Much of MATLAB is loaded on demand, so it's always best to time the second or third run.
MATLAB automatically takes advantage of multiple cores when executing certain operations which are multithreaded. For example lots of elementwise operations such as
+
,.*
and so on as well as BLAS-backed operations (and probably others). This page lists those things which are multithreaded.Parallel Computing Toolbox is useful when MATLAB's intrinsic multithreading can't help (if it can, then it's usually the fastest way to do things). This gives you explicit parallelism via PARFOR, SPMD and distributed arrays.
您需要并行处理工具箱。许多 MATLAB 函数都是多线程的,但要并行化您自己的代码,您将需要它。一个愚蠢的技巧是打开命令行 MATLAB 的多个实例。您还可以编写多线程 MEX 文件,但正确的方法是解决方法是购买并使用上述工具箱。
You need the Parallel Processing Toolbox. A lot of MATLAB functions are multithreaded but to parallelize your own code, you'll need it. A dumb hack is to open several instances of command-line MATLAB. You could also write multithreaded MEX files but the right way to go about it would be the purchase and use the aforementioned toolbox.
这可能是显而易见的,但请确保您已在首选项中启用多线程计算(文件 > 首选项 > 常规 > 多线程)。在某些版本的 MATLAB 中,默认情况下未启用它。
This may be obvious, but make sure that you have enabled multithreaded computation in the preferences (File > Preferences > General > Multithreading). In some versions of MATLAB, it's not enabled by default.