%PARSIM Run multiple simulations in parallel using Parallel Computing
%Toolbox
%
% OUT = parsim(IN, PARAMETER_NAME1, VALUE1, PARAMETER_NAME2, VALUE2, ...) 
% runs parallel simulations using an array of SimulationInput objects IN
% using the Parallel Computing Toolbox and returns an array of
% SimulationOutput objects OUT. If the Parallel Computing Toolbox is not
% available, or a parallel.Pool cannot be created, the simulations are run
% in serial.
%
% The following optional parameters are supported
% 'AttachedFiles'                  : Specify a cell array of additional
%                                    files to attach to the pool
% 'CleanupFcn'                     : Specify a function handle to run once
%                                    per worker after all simulations have
%                                    finished running
% 'ManageDependencies'             : Specify 'on'/'off'. When set to 'on',
%                                    <a href="matlab:doc dependencies.filedependencyanalysis">model dependencies</a> will automatically
%                                    be sent to the parallel workers if
%                                    required. If set to 'off', model 
%                                    dependencies must be explicitly
%                                    attached to the parallel pool. Default
%                                    value is 'on'
% 'RunInBackground'                : Run the simulations asynchronously,
%                                    keeping the MATLAB command prompt
%                                    available. Specify 'on'/'off'. Default
%                                    value is 'off'
% 'SetupFcn'                       : Specify a function handle to run once
%                                    per worker before starting the simulations
% 'ShowProgress'                   : Display progress. Specify 'on'/'off'.
%                                    Default value is 'on'
% 'TransferBaseWorkspaceVariables' : Transfer variables defined in the base
%                                    workspace to the parallel workers. 
%                                    Specify 'on'/'off'. Default value is 
%                                    'off'
% 'UseFastRestart'                 : Run simulations on the workers using
%                                    fast restart. Specify 'on'/'off'.
%                                    Please be aware of the <a href="matlab:helpview(fullfile(docroot, 'simulink','helptargets.map'), 'factors_affecting_fast_restart')">limitations</a>
%                                    when simulating in fast restart.
%                                    Default value is 'off'
% 'ShowSimulationManager'          : Opens a graphical user interface to
%                                    monitor the status of simulations.
%                                    Specify 'on'/'off'. The graphical user
%                                    interface can also be opened using the
%                                    <a href="matlab:help openSimulationManager">openSimulationManager</a> command. Default 
%                                    value is 'off'
% 'StopOnError'                    : Stop remaining simulations if any
%                                    simulation errors out. Specify
%                                    'on'/'off'. Default is 'off'
%
%See also SIMULINK.SIMULATIONINPUT, OPENSIMULATIONMANAGER, PARALLEL.POOL, <a href="matlab:helpview(fullfile(docroot, 'simulink', 'helptargets.map'), 'get_started_fast_restart')">Fast Restart</a>

 
% Copyright 2016-2023 The MathWorks, Inc.

