Closed rjhanes closed 2 years ago
In trying to reproduce issues #162 and #163 (code commit 93fcf87, data commit e2de961, 1_cglr.yaml from OneDrive), I ran into this error again at the same point in the simulation. While IPOPT is choking on something, the repeat error would indicate that there's a problem with what's being fed into the solver from the insitu emissions method (see full errror code above).
Debugging process:
I inserted a pd.set_trace()
at line 127 in insitu_emission.py and confirmed that IPOPT is returning the non-zero code the first time this method is being used during a simulation. I explored the contents of model
and the parameters being fed into the method but didn't see anything obviously wrong.
Second attempt: After line 126 in insitu_emission.py, I replaced
results = opt.solve(model)
solution = pyomo_postprocess(None, model, results)
with
try:
results = opt.solve(model)
solution = pyomo_postprocess(None, model, results)
except:
print(f"Solver (ipopt) did not exit normally; skipping LCIA for processes {process}")
solution = pyomo_postprocess()
Solution: Swapping out ipopt for glpk to see if that fixes the issues
Running commit 3f8d59f (
array-uncertainty
code repo branch) on commit 150f92d (national-array-uncertainty
data repo branch), using the scenario.yaml file in the data branch, I ran into a "Solver (ipopt) returned non-zero return code" error that stopped execution. Complete error output is below. I don't think this is a problem with CELAVI or the data but with IPOPT, and although this is a relatively rare occurrence it could nonetheless cause problems with longer HPC uncertainty runs.I suggest implementing try/except statements around IPOPT calls, such that if the solver chokes, the optimization is either attempted again or all zeros are returned with a printed warning message. That way CELAVI can keep running with minimal or no impact on the final results.
On the other hand, if IPOPT fails so rarely that it's not likely to cause complications with HPC uncertainty runs, then I don't think a fix would add much value.
@TJTapajyoti , do you think implementing this fix would be beneficial and worth the time it would take?
@akey7 and @jwalzberg , have you seen this error or a similar error in your own testing, and what are your thoughts on implementing this fix?