My simple workflow can now take up to 9 GB of RAM every time I run the model (without the driver).
This is because I'm running many cases with one of the components in a vectorized way. This means I've made one component that takes in an N-shaped input, operates on it and outputs an N-shaped vector too.
Is there a way to tell OpenMDAO not to store in its dictionaries some the outputs of certain intermediate components that don't provide the design variables nor the constraints values?
OpenMDAO's memory usage doesn't come from storing I/O values. The problem was that I had declared in an N-input to N-output Component that the partial derivatives were of the form (from=['*'], wrt=['*']).
This defines the Jacobian as completely dense, and in my case it was much sparser than this because the component was doing a vectorized computation. So its Jacobian was diagonal.
As of OpenMDAO 2.0.2, large dense jacobians use a lot of memory, and specifying the sparsity is highly recommended. By defining the partials with the rows
and cols
arguments, memory usage went from 13 GB down to 200 MB. See: http://openmdao.org/twodocs/versions/2.0.2/feature_reference/core_features/working_with_derivatives/sparse_partials.html
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments