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

6 次查看(过去 30 天)
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?

采纳的回答

Sumukh
Sumukh 2024-8-5
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 个评论
v k
v k 2024-8-6
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!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink Functions 的更多信息

产品


版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by