fmincon does not use every cores of AMD Ryzen CPU

조회 수: 4 (최근 30일)
Ádám Domina
Ádám Domina 2023년 2월 22일
답변: Animesh 2023년 3월 7일
Hi,
I have just switched my from an Intel i5-9600KF (6C, 6T) PC to an AMD Ryzen 3800X (8C, 16T), and fmincon solver does not use the every cores / threads of the processor, the CPU usage is about 20-40%. Previously, on the Intel CPU, all cores were run on 100%. Now, the code run much slower on the new, faster CPU....
Could you please help me? Is this even caused by the new CPU? Of course I use the same Windows and MATLAB versions, with the same software packages, etc. all softwares are the same.
Thank you for your help in advance!

답변 (1개)

Animesh
Animesh 2023년 3월 7일
Hello,
If you are using the “fmincon” function in MATLAB and it does not appear to be using all the cores of your AMD Ryzen CPU, there are a few things you can try to resolve the issue:
  • Check the number of workers: Make sure that MATLAB is using the correct number of workers. You can check this by typing "maxNumCompThreads" in the MATLAB command window. If the output is less than the number of CPU cores you have, you can increase the number of workers by typing "maxNumCompThreads(n)", where "n" is the number of workers you want to use.
  • Check the optimization options: Make sure that you have set the optimization options to use parallel computing. You can do this by setting the "UseParallel" option to "true" in the optimization options structure. For example:
options = optimoptions('fmincon', 'UseParallel', true);
  • Check the optimization problem: If the optimization problem is not well-suited for parallel computing, you may not see a significant speedup by using multiple cores. In some cases, using more cores may even slow down the optimization process. You may want to try different optimization techniques or approaches to see if you can improve the performance.
  • Check the hardware settings: You may want to check your computer's power settings to make sure that the CPU is not being throttled or limited in some way. You can also try updating your computer's drivers or firmware to see if that helps improve performance.
By trying these steps, you should be able to determine the cause of the issue and find a solution that will allow you to use all the cores of your AMD Ryzen CPU for fmincon optimization in MATLAB.

카테고리

Help CenterFile Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by