Clear Filters
Clear Filters

How to resolve the error of "invalid queue length for message 'xx'. queue length must be a positive scalar integer between 1 and 2^16-1"

37 views (last 30 days)
Here is my situation. I have a model developed in Simulink. It runs as intended on my PC. Now I have to run this model with a lot of different inputs which takes the number of simulation to tens of thousand. Thus I am using the Matlab parallel processing toolbox to run these simulations on a super computer at my university. I get the invlid queue length error for certain constant data type varaibles of a stateflow chart. I would greatly appreciate any help in resolving this error. Also, I don't understand why these constant data type variables are being treated as messages by Simulink.
  4 Comments
Ankur Shiledar
Ankur Shiledar on 3 Nov 2023
I received this workflow from a collegue at my lab. I modified it and the parallel simulations worked perfectly on my personal machine which has quad-core cpu. Now when I am trying to the same on a super computer with nothing chaged in the model, I am suddely getting this error.
I can try to restructure my workflow to use parsim if that would resolve the issue.

Sign in to comment.

Answers (1)

Moksh
Moksh on 12 Dec 2023
Edited: Moksh on 12 Dec 2023
Hi Ankur,
I understand that you are facing an invalid queue error.
The "invalid queue length for message 'xx'. queue length must be a positive scalar integer" error in Simulink when using the parallel processing toolbox can occur for a few reasons:
  • Stateflow Chart Behaviour: Simulink sometimes interprets constant data type variables used within a stateflow chart as messages.
Solution:
  • Move constants outside the stateflow chart: If possible, remove the constant data type variables from the stateflow chart and define them outside as global variables or model parameters. This can help avoid the misinterpretation of the variables as messages.
  • Updating to the latest version of Simulink may resolve the bug.
  • Queue length mismatch: When running simulations in parallel, the queue length for each message needs to be consistent across all workers.
Solution:
  • Ensure that the queue length for the message "xx" is set to the same value in all model instances running on different workers. This can be done through the "Model Explorer".
  • Avoid using dynamic changes to the queue length within the model during the simulation. This can lead to inconsistencies across workers and trigger the error.
  • Model configuration inconsistencies: If you are running multiple variants of the same model with slightly different configurations, there might be inconsistencies in the message definitions or queue length settings across these variants.
Solution:
  • Check all relevant model settings, including message definitions, queue lengths, and parameter values, to ensure they are identical across all model variants used in the parallel simulation.
  • Simulink provides tools like "Model Compare" and "Merge Models" to help identify and resolve differences between model variants.
Please use the following documentation for more information about the above-mentioned tools:
Hope this information helps resolve the query.
Best Regards,
Moksh Aggarwal

Categories

Find more on Simulink Functions in Help Center and File Exchange

Tags

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!