This example shows how to run parallel simulations in batch and list
any attached files. batchsim
offloads simulations to the compute
cluster, enabling you to carry out other tasks while the batch job is processing, or close
the client MATLAB® and access the batch job later.
1. Open the
model.
2. Define a set of values for different temperatures.
3. Using the setPointValues
, initialize an array of
Simulink.SimulationInput
objects.
4. Specify the pool size of the number of workers to use. In addition to the number
of workers used to run simulations in parallel, a head worker is required. In this case,
assume that three workers are available to run a batch job for the parallel simulations.
The job object returns useful metadata as shown. You can use the job
ID
to access the job object later from any machine.
NumWorkers
displays how many workers are running the simulations –
the number of workers specified in the 'Pool'
argument plus an
additional head
worker.
ID: 1
Type: pool
NumWorkers: 4
Username: #####
State: running
SubmitDateTime: ##-###-#### ##:##:##
StartDateTime:
Running Duration: 0 days 0h 0m 0s
If AutoAttachFiles
property of
Simulink.Simulation.Job
is set to true in the cluster profile, then
the job running on the cluster has the necessary code files automatically attached to
it. Use the listAutoAttachedFiles
method to view the attached
files.
Note that the list of attached files is not displayed here because this is an
example model.