Effacer les filtres
Effacer les filtres

How to limit CPU availabilty to Matlab

52 vues (au cours des 30 derniers jours)
Sumesh KS
Sumesh KS le 14 Juin 2022
Modifié(e) : Dhritishman le 15 Juin 2022
When i running Matlab simulation on my Linux PC (20 cores), it consuming all cores, is there any way to limit CPU availability to Matlab (Use only 10 cores).

Réponses (2)

Raymond Norris
Raymond Norris le 14 Juin 2022
Try
maxNumCompThreads(10);

Dhritishman
Dhritishman le 15 Juin 2022
Modifié(e) : Dhritishman le 15 Juin 2022
LASTN = maxNumCompThreads(N)
sets the maximum number of computational threads to N, and returns the previous maximum number of computational threads, LASTN. N in your case is 10.
You can also use
LASTN = maxNumCompThreads('automatic')
which will set the maximum number of computational threads to the most desirable number according to MATLAB.
You can read more about it here:

Catégories

En savoir plus sur Manage Products dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by