ampl / mp

An open-source library for mathematical programming
https://mp.ampl.com
Other
229 stars 42 forks source link

Scary Gurobi MP error messages for invalid options #210

Closed 4er4er4er closed 1 year ago

4er4er4er commented 1 year ago

Sending an invalid option to the Gurobi MP interface provokes a long error message:

ampl: option solver gurobi;
ampl: option gurobi_options 'presolve -2';
ampl: solve;
Gurobi 10.0.1: Error: Call failed: 'GRBsetintparam(model_or_global_env(), key, value)' with code 10008, Gurobi message: Unable to set parameter Presolve to value -2 (minimum is -1)
exit value 18446744073709551615
<BREAK>
ampl:

If the user is working in a window like GitHub's -- without text wrapping -- then the helpful part of the message is not even visible. Also the exit value should be something less scary than 2^64-1, if indeed there should be any exit value at all. Gurobi ASL only displayed a short informative message:

ampl: option solver gurobiasl;
ampl: solve;
Gurobi 10.0.1: presolve must be >= -1 and <= 2.
ampl: