How can I use speed up Matlab?

조회 수: 11 (최근 30일)
Ayob
Ayob 2013년 4월 26일
I have a large program with a plenty of data and whenever I run Matlab on my program it takes a lot to do it. I checked my CPU usage in windows task bar manager. It never gets over 50 percent and stays something around 50%, sometimes 51 or 49% . I think I can speed up Matlab calculating by let it have 90 or 95 percent of my CPU usage. I don't know how can I set this property on Matlab and my PC.
Note: I'm using windows vista on LG laptop.
  댓글 수: 2
Walter Roberson
Walter Roberson 2013년 4월 26일
Do you happen to have a dual core processor?
What kind of processing are you doing? Are you using vectorization a lot on large matrices? Which MATLAB release are you using?
Ayob
Ayob 2013년 4월 26일
편집: Ayob 2013년 4월 26일
Yes,I have a Intel dual core processor. I'm making a big matrix from smaller ones what is called matrix assembling but I think it's not important what I'm doing. I just want to have much CPU usage.

댓글을 달려면 로그인하십시오.

답변 (2개)

Jason Ross
Jason Ross 2013년 4월 26일
If your CPU uses hyper-threading, the OS is reporting the number of virtual cores, which are typically twice the number of execution cores. Math operations will require the execution cores and will therefore look as if the system is only half busy.
If you turn off hyper-threading in the BIOS, I bet your CPU utilization climbs to the percentage you want, although the execution time of your code will likely stay the same.

Walter Roberson
Walter Roberson 2013년 4월 26일
Your CPU percentage might reflect that only one of your two cores is engaged in the work. In certain cases, MATLAB will automatically use multiple cores even if the user does not have the Parallel Computing Toolkit, but those cases are based upon doing mathematical operations on large vectors or arrays (usually around 9000 or more elements.)
I cannot determine at the moment whether your task would be suitable for parallel processing even if you had the Parallel Computing Toolkit, but it might be.
You should profile your code to determine where the bottlenecks are. You should ensure that you pre-allocate your matrices when computationally practical. These are unlikely not engage the second core automatically, but they have the potential for improving the efficiency of your single-core computation.

카테고리

Help CenterFile Exchange에서 Multicore Processor Targets에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by