I am using Pyomo
+ Ipopt
as solver to solve a NLP problem. The problem is not extremely complex in terms of dimensionality and number of constraints. However, I am required to solve several thousands of instance of this model with different input parameters. Currently I am using a for loop
to loop over. Solving a single instance takes me ~ 1 second on 32 GB RAM Windows
PC, Python 3.7.3
. That means I have to wait for hours before I am able to retrieve full optimization results.
I profiled into where the time is getting consumed. The model building itself does not takes any time as such but its the model solving via Ipopt
that is performance determining here.
I would like to know if someone has previously run into a similar problem and what are the common ways one can try to achieve some sort of performance gains.
EDIT. From a question asked elsewhere I found out that:
Pyomo default behavior is to write an
*.nl
file, then to call IPOPT to process that file and produce a*.sol
file. Pyomo then parses back in the*.sol
file.
From this, it seems that achieving speed gains might not be that easy with Pyomo. Still looking forward for the community response.