[shlug][OT]MATLAB与计算机硬件

70 views
Skip to first unread message

Giant Y

unread,
Jun 14, 2012, 8:14:09 AM6/14/12
to shlug
这里有经常使用MATLAB的朋友吗?想请教一下,如何让MATLAB使用全部的计算机资源进行运算。
我在测试一个算法程序,每跑一次要等十多分钟才出结果,煞是煎熬。CPU是i5 450M,程序运行时频率飙到最高(2.66GHz),可是,看CPU的使用情况,只占用四分之一(四个核心中只有一个100%工作,其他三个占用率极低)。这是否说明CPU的性能还没有完全发挥出来?要怎样设定才能将全部的CPU资源分配给MATLAB,使得速度更快,时间更少?

-> posted by  Giant Y

John Zhang

unread,
Jun 14, 2012, 8:32:42 AM6/14/12
to sh...@googlegroups.com
Check this:
http://www.mathworks.com/matlabcentral/answers/3153-matlab-with-dual-core-uses-only-50-cpu-r2010b-intel-core-2-duo-t9300

2012/6/14 Giant Y <y560...@gmail.com>:

> -- You received this message because you are subscribed to the Google Groups
> Shanghai Linux User Group group. To post to this group, send email to
> sh...@googlegroups.com. To unsubscribe from this group, send email to
> shlug+un...@googlegroups.com. For more options, visit this group at
> https://groups.google.com/d/forum/shlug?hl=zh-CN

Zhenbo Li

unread,
Jun 14, 2012, 8:35:47 AM6/14/12
to sh...@googlegroups.com
MATLAB支持多线程吗?

-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN



--
本人空间 http://bit.ly/mrcotton
欢迎大家没事去转转

Tolbkni Kao

unread,
Jun 14, 2012, 8:37:08 AM6/14/12
to sh...@googlegroups.com
自行 Google : MATLAB 并行计算


2012/6/14 Giant Y <y560...@gmail.com>
这里有经常使用MATLAB的朋友吗?想请教一下,如何让MATLAB使用全部的计算机资源进行运算。
我在测试一个算法程序,每跑一次要等十多分钟才出结果,煞是煎熬。CPU是i5 450M,程序运行时频率飙到最高(2.66GHz),可是,看CPU的使用情况,只占用四分之一(四个核心中只有一个100%工作,其他三个占用率极低)。这是否说明CPU的性能还没有完全发挥出来?要怎样设定才能将全部的CPU资源分配给MATLAB,使得速度更快,时间更少?

-> posted by  Giant Y

姚 飞

unread,
Jun 14, 2012, 8:38:22 AM6/14/12
to sh...@googlegroups.com
你最好看一下matlab进程占用的虚拟内存大小。

你的cpu现在算是垃圾级别了,估计内存也小的可怜,matlab估计还是32位的,然后开了很大的数组,所以CPU绝大部分时间是在等待内存swap。

把你的题目打包给哥发过来,哥拿运行在Mac OS X Mountain Lion上的64位 Matlab 2012a 给你算算。

某人给俺的一个测试程序,在32位Matlab下根本无法运行,占用CPU也很少,但是内存占用峰值达到12.5G,结果在装备16G内存的Mac Mini上运行仅需18秒。

建议你在Linux下运行64位Matlab 2012a



Ning Zhou

unread,
Jun 14, 2012, 8:40:41 AM6/14/12
to sh...@googlegroups.com

matlab可以并行计算的。可以让你的电脑4个100%,还可以让你用两台电脑跑一个任务。

姚 飞

unread,
Jun 14, 2012, 8:43:14 AM6/14/12
to sh...@googlegroups.com
另外,也可能你的算法串行化太严重,无法使用到Matlab内部的并行处理能力,所以出现单个CPU核心忙得要死的局面。


Aaron Zhou

unread,
Jun 14, 2012, 8:54:11 AM6/14/12
to sh...@googlegroups.com
搭车问一下飞哥 @姚飞
您机器什么配置 
--
Thx & Regards

Zhou Quan, Aaron
Linux & Programming enthusiast
----------------------------------------------
----------------------------------------------
>> Coding the Perfect World :D

330.gif

Giant Y

unread,
Jun 14, 2012, 8:58:41 AM6/14/12
to sh...@googlegroups.com
cpu还好啦,win 7 64 bit,4GB内存,MATLAB也是64位的。
算法程序这就给您发来!

-> posted by  Giant Y



2012/6/14 姚 飞 <yaof...@gmail.com>

姚 飞

unread,
Jun 14, 2012, 9:30:59 AM6/14/12
to sh...@googlegroups.com
Mac Mini 2011年款,中配 MC816CH/A,  自己升级了16G内存,三星830 128GSSD


在 2012-6-14,下午8:54,Aaron Zhou <dail...@gmail.com> 写道:

搭车问一下飞哥 @姚飞
您机器什么配置 <330.gif>

Lu Yiguang

unread,
Jun 14, 2012, 9:34:48 AM6/14/12
to sh...@googlegroups.com
眼花看成2001,然后吓醒。。

-- 
Lu Yiguang
Sent with Sparrow

Ashi

unread,
Jun 14, 2012, 9:44:51 AM6/14/12
to sh...@googlegroups.com
在 2012年6月14日 下午8:14,Giant Y <y560...@gmail.com>写道:
这里有经常使用MATLAB的朋友吗?想请教一下,如何让MATLAB使用全部的计算机资源进行运算。
我在测试一个算法程序,每跑一次要等十多分钟才出结果,煞是煎熬。CPU是i5 450M,程序运行时频率飙到最高(2.66GHz),可是,看CPU的使用情况,只占用四分之一(四个核心中只有一个100%工作,其他三个占用率极低)。这是否说明CPU的性能还没有完全发挥出来?要怎样设定才能将全部的CPU资源分配给MATLAB,使得速度更快,时间更少?
我之前有一次在Fedora下跑Octave,运行一个程序挺慢的,cpu也只有25%。开了两个进程之后发现cpu50%了。。。哈哈。
另外使用Matlab(或者Octave),代码本身要做好向量化,充分利用Matlab本身数学库的加速功能,尽量不要使用循环。
 

Aaron Zhou

unread,
Jun 14, 2012, 10:12:18 AM6/14/12
to sh...@googlegroups.com
谢谢了 :D
Reply all
Reply to author
Forward
0 new messages