MATLAB Answers

Issue with building reference models with xPC target

3 views (last 30 days)
I have a model that requires concurrent execution (multiple processors) to run effectively. This means that the top-level model consists of several sub-blocks that are all model references (each referenced block can be assigned to a processor).
I am experiencing strange behavior during the build process. For one of these referenced models, I can compile it on its own and compilation will take < 3 minutes. However, if I build the top-level model, it always recompiles the referenced model, and this compilation can take upwards of 20 minutes.
I find it strange that the compilation on the referenced model (the sub-block) is being triggered even though I haven't modified the block at all. E.g. if the sub-block is 'B' and the top-level model is 'A', then I do
rtwbuild('B') rtwbuild('A')
The first build of B goes quickly. Even though the build of A is happening immediately afterwards, a recompile of B is triggered, and this process takes ~20 minutes. I see no reason why any of the model's dependencies should be modified in between the two commands...?
When the build of A gets to model B, the message I get is
### Checking the status of model reference RTW target for model 'B' used in 'A' ### Model reference RTW target (B.c) for model B is out of date because B.c does not exist.
Any thoughts on why this might be happening?
Best, Chethan


Sign in to comment.

Accepted Answer

Chethan Pandarinath
Chethan Pandarinath on 7 Mar 2014
Just for everyone's future reference, the solution to this problem was achieved in the following way:
In Model Configuration Parameters, under Code Generation, I ran "Check model..."
This made a couple specific recommendations, which I followed: Under "Check model configuration", it was recommended to turn on Signal storage reuse, and other sub-options. This was done. Under "Check for optimal bus virtuality", it recommended converting a couple buses to output as non-virtual. This was also followed.
After these adjustments, compile times dropped down from ~25 minutes to ~2.


Sign in to comment.

More Answers (1)

Rajiv Ghosh-Roy
Rajiv Ghosh-Roy on 5 Dec 2013
Just building model B is a different build format from building A (which in turn builds B). In the first case, you are building B for use as a standalone model. In the second case, A needs B to run, and this builds it differently. Hence the dependency build.


Chethan Pandarinath
Chethan Pandarinath on 5 Dec 2013
I see. Any thoughts on why a model that compiles in 3 minutes standalone would take ~20 minutes to compile as part of the larger build? (I.e. 20 minutes just for the specific compile of sub-block B, not the full model A)
Rajiv Ghosh-Roy
Rajiv Ghosh-Roy on 6 Dec 2013
I'm not sure why this is happening; your best bet would probably be to contact Support since you will be able to share your model. The builds "should" take roughly the same time. A wild guess would be that you are getting close to maxing out memory during the concurrent build.
Chethan Pandarinath
Chethan Pandarinath on 13 Dec 2013
Thanks Rajiv. Yeah, unfortunately it's not a memory issues (several gigs of memory free; the compile only takes <100MB). The CPU usage stays at 100% (on a single processor) throughout the compile.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!