Clear Filters
Clear Filters

How is the Simulink total block I/O size calculated exactly? It would help me prevent the I/O buffer size error

47 views (last 30 days)
I have a wind farm simulation model which computes among others wind speeds at millions of grid nodes in a three-dimensional volume. The model mainly consists of c s-functions.
When increasing the number of nodes in a uniform grid - basically a three-dimensional matrix - further and further, at some point I get this message:
Simulink supports total block I/O buffer size up to 2147483647 number of bytes. The total block I/O size is calculated based on data type size, number of elements, and signal type (real/complex) of all signals in the model. Consider reducing signal sizes before compiling or simulating the model.
How is the "total block I/O buffer size" exactly determined? I'd love to see a more precise definiton of "The total block I/O size is calculated based on data type size, number of elements, and signal type (real/complex) of all signals in the model."
Let's assume there are two c s-functions (mex). Will all these things contribute to the "total block I/O buffer size":
  • number of inputs and outputs
  • dimensions and size of inputs and outputs
  • dialog parameters
  • internal DWork
  • internal variables (int_T, real_T, real32T, vectors, pointers, ...)
  • function step size (I have a multi rate model)
  • number of computations/functions per time step
As it says "total block I/O buffer size", I would assume only and exclusively dimensions and size of block inputs/outputs within the simulink model are considered. Applying this logic to a simple Simulink model configuration as shown here:
I would guess the "total block I/O buffer size" is the sum of:
  • 1000 (from C1)
  • 1000 (to c s-function input)
  • 200x50x20 (from C2)
  • 200x50x20 (to gain)
  • 200x50x20 (from gain)
  • 200x50x20 (to c s-function)
  • 3 times 700x50x20 (from c s-function)
  • 3 times 700x50x20 (to "To Workspace" block)
ist that correct? Or is there some redundancy/duplication in this approach? Or did I miss something?

Accepted Answer

Sumukh
Sumukh on 5 Aug 2024 at 7:36
Hi v k.
MATLAB documentation does not provide details regarding how exactly the total block I/O size in Simulink is calculated. The limit on the total block I/O size is the maximum size of 32-bit signed integer (2^31-1=2147483647) for 64-bit systems, up to MATLAB R2019a, as given by below documentation:
However, the total block I/O size limit has been increased to that of a 64-bit integer size (2^64-1) on 64-bit systems, from MATLAB R2019b, as provided in the release notes below:
I would suggest you upgrade to MATLAB R2019b to increase the total block I/O size limit, as well as try to reduce the no. of Simulink blocks in the model.
I do hope this helps with your issue.
  1 Comment
v k
v k on 6 Aug 2024 at 10:43
Thanks for this interesting and helpful hint. I ran a few tests in R2023a and the issues did not appear. I was not aware of the change of this limitation between R2019a and R2019b, as this table still shows the 2^31-1 limitation in R2024a:
So it seems this information was not updated?
Anyway, my model is running now even without changing its structure or number of Simulink blocks. Thanks again!

Sign in to comment.

More Answers (0)

Categories

Find more on Event Functions in Help Center and File Exchange

Products


Release

R2017b

Community Treasure Hunt

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

Start Hunting!