Why is 'TransferB​aseWorkspa​ceVariable​s' not recommended for parsim and batchsim?

35 次查看(过去 30 天)
I notice a warning in the MATLAB editor that says that the 'TransferBaseWorkspaceVariables' option is not recommended for parsim and batchsim. Why is that and what is an alternative approach I can use?

采纳的回答

MathWorks Support Team
编辑:MathWorks Support Team 2024-2-13
'TransferBaseWorkspaceVariables' is an effective way to get simple simulations running in parallel quickly, when at a small scale. However, as you scale up your number of simulations and workers, it is recommended to not use 'TransferBaseWorkspaceVariables'. The reason being that 'TransferBaseWorkspaceVariables' does not try to filter which Base Workspace variables are related to simulation and which are not. This design favors flexibility for users, however, a risk is that it can be easy to accidentally send large variables to workers that aren't needed for simulation. A common example is big data from a previous run of parsim/batchsim that is lingering in the Base Workspace. These large, unneeded variables will be copied to each worker. This multiplying effect can quickly exhaust computer resources and reduce performance. 
Moving to a different data management strategy can resolve this issue, by more explicitly defining which data in required for simulation and which is not. Consider using a Simulink Data Dictionary or the Model Workspace instead of the Base Workspace. This avoids the need for the "TransferBaseWorkspaceVariables" option. If using Base Workspace variables is required, consider some of the approaches outlined in the blog post below:

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Run Multiple Simulations 的更多信息

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by