How do I specify the number of workers to be used in my Simulink batch job?
7 views (last 30 days)
Show older comments
MathWorks Support Team
on 6 Mar 2024
Answered: MathWorks Support Team
on 18 Mar 2024
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?
Accepted Answer
MathWorks Support Team
on 18 Mar 2024
"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 Comments
More Answers (0)
See Also
Categories
Find more on Run Multiple Simulations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!