Borrar filtros
Borrar filtros

fmincon does not use every cores of AMD Ryzen CPU

8 visualizaciones (últimos 30 días)
Ádám Domina
Ádám Domina el 22 de Feb. de 2023
Respondida: Animesh el 7 de Mzo. de 2023
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!

Respuestas (1)

Animesh
Animesh el 7 de Mzo. de 2023
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.

Categorías

Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by