How do I specify the number of workers to be used in my Simulink batch job?
7 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2024 年 3 月 6 日
回答済み: MathWorks Support Team
2024 年 3 月 18 日
I am trying to pass in a cluster object to the "batchsim" command and I see that the number of workers used by my simulation job object and the cluster object do not match.
myCluster =
Local Cluster
Properties:
Profile: local
Modified: false
Host: localhost
NumWorkers: 16
NumThreads: 1
simJob =Job
ID: 23
Type: independent
NumWorkers: 1
Username: user
State: running
SubmitDateTime: 27-Feb-2024 16:12:40
StartDateTime:
Running Duration: 0 days 0h 0m 0s
Why does this mismatch exist? Does "batchsim" not use all the workers available in the cluster it occurs on?
採用された回答
MathWorks Support Team
2024 年 3 月 18 日
"Batchsim" will have to be instructed specifically to use a certain number of workers from its cluster. In order to do this, please use the "Pool" name-value argument shown in the documentation page of "batchsim".
The "Pool" name-value argument specifies the number of workers you want your simulation job object created by "batchsim" to use.
Please note that if you specify N workers in the "Pool" name-value argument, your cluster will need to have N+1 workers available since the 1 extra worker required will be the one running the batch.
The following line of code should solve this issue:
simJob = batchsim(myCluster, simInputs, "Pool", 15);
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Run Multiple Simulations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!