Computer uses only 21% of cpu when running multithreading in simulink

6 ビュー (過去 30 日間)
Fernando Gabriel Gutierrez Marigal
Fernando Gabriel Gutierrez Marigal 2024 年 7 月 5 日
回答済み: Ninad 2024 年 7 月 5 日
I made a simulink spice model for a circuit and it is taking around 30 minutes to compile, I thought it was normal, but checking windows task manager it seems that only one thread of my cpu is at it's maximum capacity, i tried using different configurations of workers and threads per worker, but nothing work it is still using arount 21% of the total of my CPU.
My simulink model has only one .slx
I am using this code for the parallel computing part
bdclose all;
%proj = openProject('.C:\Users\ferna\Downloads\halfBridgeTest.slx');
model = '\Downloads\halfBridgeTest.slx';
open_system(model);
modelN = 'halfBridgeTest';
in = Simulink.SimulationInput(modelN);
parpool('LocalProfile1')
tic; out = parsim(in, 'UseFastRestart','on'); toc
delete(gcp('nocreate'));

回答 (1 件)

Ninad
Ninad 2024 年 7 月 5 日
Hi Fernando,
You can set the model to run in the "Accelerator Mode".To do so please follow these steps:
  1. Go to the "Simulation" tab of your model.
  2. Please click on the drop-down menu right that is placed right under the "Stop time" option.
  3. Select the "Accelerator" option.
  4. Save your model.
You can also perform build optimizations for faster builds.
Please refer the following MathWorks documentation to know more:
Regards,
Ninad

カテゴリ

Help Center および File ExchangeManual Performance Optimization についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by