フィルターのクリア

parrallel computation,4-core machine

1 回表示 (過去 30 日間)
ahmad
ahmad 2012 年 5 月 22 日
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.
Thomas
Thomas 2012 年 7 月 20 日
Accepted by Binish..

サインインしてコメントする。

その他の回答 (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 Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by