I am running out of memory when providing the Jacobian matrix of one of my components in my optimization problem (using SNOPT with pyOptSparse in OpenMDAO 0.13). Would it be possible to supply the Jacobian of one or more components in a sparse matrix format?
Thank you Pieter
asked 02 Sep '15, 16:07
Without some modifications this isn't possible, as far as I know. However, there is code in there to zero pad any missing derivatives. You could probably adjust code to not do that. You can see this code here: https://github.com/OpenMDAO/OpenMDAO-Framework/blob/dev/openmdao.main/src/openmdao/main/linearsolver.py#L180 Specifically note lines 183 and 187. This is where the zero padding happens, and where you need to remove it to get more sparsity.
We did implement this sparsity in the alpha version of OpenMDAO though. So the features you need are available there. You could look at that wrapper code for hints as to how to make the older one work. The alpha code is here: https://github.com/OpenMDAO/OpenMDAO/blob/master/openmdao/core/problem.py#L801