![]() |
并行计算问题:极其简单的parfor代码,比for运行慢,求解原因!
两段代码及运行结果如下:
至强4核8线程机器 >> matlabpool 8 Starting matlabpool using the 'local' configuration ... connected to 8 labs. >> tic; for i=1:2^30; uu=1*2*3*4*5*6*7*8; end toc Elapsed time is 20.540647 seconds. >> tic; parfor i=1:2^30; uu=1*2*3*4*5*6*7*8; end toc Elapsed time is 34.200219 seconds. 如何理解? |
所有时间均为北京时间。现在的时间是 14:29。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.