Azzera filtri
Azzera filtri

Parallel building of Referenced Models ignores Path

3 visualizzazioni (ultimi 30 giorni)
Mahdi il 4 Apr 2024
Risposto: Sarthak il 17 Apr 2024
I have a .prj file which sources the paths for my project. In the project, there's main model with several reference models inside it. Each one of the referenced models loads variables into its model workspace using Data source: Matlab File, and the file name is a relative path (has to remain relative) to a script which loads the variables. When I build my Top model using serial building of referenced models, it builds with no issues. If I set it to build the referenced models in parallel, I get an error that says it can't load the scripts for loading model workspaces. If I change the path to model workspaces to absolute paths, it works, which means that parallel workers are not mirroring the path from the client.
There's a similar problem here, although this one concerns parallel simulation rather than building
Am I correct in thinking this a bug or is there something I can do differently.

Risposte (1)

Sarthak il 17 Apr 2024
Hello Mahdi,
I think when you build models in parallel, each worker in the parallel pool operates in its own separate workspace and does not inherently share the same current folder or path settings as the client (the main MATLAB session where you initiated the build). This is why relative paths work when building serially (because the single MATLAB session retains the path context) but fail when building in parallel (because the workers start with their default paths, which likely don't include the directories your project relies on).
Initializing workers for build might help you achieving this. Please refer to the following documentation for the same:
However if the issue persists, please create a technical support ticket below:


Scopri di più su Cluster Configuration in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by