parrallel computation,4-core machine

1 次查看(过去 30 天)
I have got an Intel-4core machine recently ,R2011a installed on it.but,I still don't believe that I am using all of my machine's computation ability.actually I couldn't find any multi-threading option in preferences and when I run BENCH command I get a fast and reasonable response but when I run my program it gets sort of same time as my laptop.

采纳的回答

Jason Ross
Jason Ross 2012-5-24
Things to know about performance of code:
  1. You need to know how many cores you really have. If you have a machine with "hyper-threading", you can have two actual cores, but they appear to the OS as four. Therefore, it's possible to have something like a Core2Duo in your laptop and a 2-core processor in your desktop, and have the same number of cores. Look up the spec sheet for your processor to find out.
  2. Parallel execution can be implicit or explicit. Some MATLAB functions are multithreaded, and will automatically take advantage. Others are not. Other functions (in combination with the Parallel Computing Toolbox) will take advantage of multiple cores, but you must change your code to use parallel computing constructs (parfor, spmd, etc)
  3. The most valuable thing you can do to search for speedup is to use the profiler to see what's taking up the most time in your code. Otherwise it's just guesswork and pre-optimization. It's possible that you are waiting on something like disk I/O to read a file and parse it, or there is some other bit of code that's written inefficiently, or you aren't preallocating, you could vectorize, etc.
  3 个评论
Jason Ross
Jason Ross 2012-5-29
If you've identified the slow section of code, I'd suggest you start a new question that asks "is there a way to increase the performance of this operation" and post the part that's slow. There have been many such questions asked where meaningful results came out -- but people have to be able to see the code.

请先登录,再进行评论。

更多回答(1 个)

Thomas
Thomas 2012-5-22
I do not think bench command is not parallelized.
To make use of all the cores you need the Parallel computing toolbox and you need to parallelize your code (If it can be parallelized..) to actually see a speed up..
see
  1 个评论
ahmad
ahmad 2012-5-24
I think that even without parallelizing my code I should get a faster response from my machine just because it has a 12GB memory and 6 cores of 3.2GHz processors.since I am using MATLAB R2011a, I don't find any option to see whether my MATLAB sees all of my cores when it is running the code or not?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Performance and Memory 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by