Just to clarify:
- You want to optimize using NLopt:
- A function
myfunc_floops
- That calls
f1
which repeatedly callsf2
- Which formulates and solves an optimization model using Mosek.
- That calls
- A function
That’s going to involve a lot of calls to f1
, which creates and destroys a lot of JuMP models. That’s the reason for your GC issue.
As recommended here:
did you try creating a single JuMP model and calling fix
on it?
Have you tried creating a single large JuMP model instead of the loop over z[:,s]
? You could potentially find all solutions for Simul
simultaneously a single large Mosek model.