I want to export large-scale models from Openmodelica to FMU for model exchange.
As first step, I'm using this model for testing purposes:
model BigModel "Tank-Pipe-Tank cloned n times"
//
constant Real g=9.8;
//
parameter Integer n = 1;
parameter Real A_a = 1;
parameter Real A_b = 1;
parameter Real c = 0.2 "Kinematic viscosity";
parameter Real rho = 1000.0;
//
Real P_a[n];
Real P_b[n];
Real H_a[n] (start=fill(2,n),each fixed=true);
Real H_b[n] (start=fill(1,n),each fixed=true);
Real F[n] "Flow";
equation
for i in 1:n loop
P_a[i] = rho * g * H_a[i];
P_b[i] = rho * g * H_b[i];
F[i] = c * (H_a[i] - H_b[i]);
A_a * der(H_a[i]) = -F[i];
A_b * der(H_b[i]) = F[i];
end for;
end BigModel;
Changing "n" we can generate big models.
Depending on the OpenModelica version and the OS, the maximum number of equations changes a lot:
- Windows 10 64 bits - OM 32 bits - 16 GB RAM - 4 CPU - i7) => n = 2600; Equations = 13000.
- Windows 10 64 bits - OM 64 bits - 8 GB RAM - i5 => n = 100; Equations = 500.
- Windows 10 64 bits - OM 64 bits - 16 GB RAM - 4 CPU - i7) => n = Similar to the previous one.
- Ubuntu 17.10.1 64 bits - OM 64 bits - Virtual Machine - 8GB RAM - 1 CPU=> n = 22500; Equations = 112500
Does this have any sense for you?
Is it possible to reach n = 22500 in Windows?
Thanks!!!
The problem is not OMC, is GCC here. In Windows 64bit OMC consumes 4.1G max with n=22500 and generates the files. Then GCC runs on the files and goes out of memory. Also use -n=1 to not run GCC in parallel as that will consume even more memory.
I ran this script: fmu.mos
using command line:
With this result:
In Linux we use CLANG and in Windows we use GCC and it seems that GCC is way more memory hungry.
Is should be possible to reach n=22500 but maybe with a newer GCC because the one we have in OMC seems to be crashing: