MATLAB: Simulink throws error when using multi-rate blocks for concurrent execution

Embedded Codermultithreadingsimulinksimulink coder

I am trying to increase the performance of my model by using the multi-threading capabilities.
My model has a Signal Generation block which generates different types of signals like QPSK, Sine, FM for testing purpose. And this block is converted to a referenced model. When trying to execute the model with "Allow tasks to execute concurrently on target" = ON, Simulink throws the below error,
The block 'Cluster1_SigSources/Subsystem/Enabled Subsystem/SIG0001/Upsample' of type 'S-Function' is a multi-rate block. Currently Simulink supports only single-rate blocks of this type when the model is configured for concurrent execution.
I have attached the reference model. How do I overcome this issue? Any suggestions would help?
Matlab Version: 2017b

Best Answer

The signal feeding the Upsample block is running at a slower rate that the output of the Upsample block. When you set "Allow tasks to execute concurrently on target" = ON, Simulink attempts to put the code to compute input to Upsample block on another core which means it would run asynchronously to the code processing the output of the Upsample block. THis would require additional semaphore/buffering logic to ensure correct processing on the 2 cores. You will have to rework your algorithm to remove the Upsample block