Solver (cplex) returned non-zero return code (-1)

25 views
Skip to first unread message

Pancho

unread,
Apr 7, 2013, 7:46:39 PM4/7/13
to coopr...@googlegroups.com
I'm getting the following error after trying to solve a model using pyomo:

ERROR: Solver (cplex) returned non-zero return code (-1)
ERROR: See the solver log above for diagnostic information.
ERROR: Unexpected exception while running model Subproblem.py:
    Solver (cplex) did not exit normally

However, I can solve the model without any problems from the cplex command line if I only use pyomo to build the lp file.

I couldn't find the meaning the return code online.

Pancho

Watson, Jean-paul

unread,
Apr 8, 2013, 6:09:43 PM4/8/13
to coopr...@googlegroups.com
Assuming you are scripting, can you solve with "tee=True" added as a keyword argument to the solve() command (and post the output)? 

I don't know what precisely is going on, but I do know that return codes are sketchy for both CPLEX and Python. 

jpw

--
You received this message because you are subscribed to the Google Groups "coopr forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coopr-forum...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Pancho

unread,
Apr 8, 2013, 6:18:46 PM4/8/13
to coopr...@googlegroups.com
I got that output from the pyomo command line (i.e. pyomo model.py data.dat --stream-solver --report-timing)

Pancho

Gabriel Hackebeil

unread,
Apr 8, 2013, 6:22:07 PM4/8/13
to coopr...@googlegroups.com
Is what you posted the full output? We're hoping to see what the CPLEX output tells us about the solution status.

Gabe

Watson, Jean-paul

unread,
Apr 8, 2013, 6:23:32 PM4/8/13
to coopr...@googlegroups.com
This almost seems like the subprocess launch failed. Is this under Windows?

jpw

Pancho

unread,
Apr 8, 2013, 10:44:55 PM4/8/13
to coopr...@googlegroups.com
No, it is under Linux.

[  187.20] Applying solver
[  215.76] Processing results
    Number of solutions: 0
    Solver results file: results.json
Problem loading solver results

ERROR: Unexpected exception while running model Subproblem.py
    Cannot load a SolverResults object with bad status: error

{
    "Problem": [
        {
            "Lower bound": -Infinity,
            "Number of constraints": 0,
            "Number of nonzeros": null,
            "Number of objectives": 1,
            "Number of variables": null,
            "Sense": "unknown",
            "Upper bound": Infinity
        }
    ],
    "Solver": [
        {
            "Error rc": -1,
            "Status": "error",
            "Termination condition": "unknown"
        }
    ]

Siirola, John D

unread,
Apr 15, 2013, 9:42:58 AM4/15/13
to coopr...@googlegroups.com

FWIW, what you just pasted does not match your original snippet: you original snipped indicated that there was a CPLEX problem and that the CPLEX subprocess returned a non-zero return code.  What you just posted appears to have no CPLEX problems (and also appears to have not been run with the --stream-solver option).

 

One additional thought: have you tried running CPLEX through the direct python bindings (that is, “--solver cplex --solver-io python”)?

Pancho

unread,
Apr 16, 2013, 3:08:01 PM4/16/13
to coopr...@googlegroups.com
Now the model works well if I solve it from the pyomo command line using the VOTD, but it returns the following when executed from a script (Benders decomposition):

.
.
.
 161   8.5343932e+02   8.5343930e+02  9.25e-03  8.79e-07  2.75e-09  9.33e+10
 162   8.5343932e+02   8.5343930e+02  1.37e-02  9.74e-07  2.70e-09  9.53e+10
 163   8.5343932e+02   8.5343931e+02  1.35e-02  7.97e-07  2.18e-09  1.20e+11
 164   8.5343932e+02   8.5343931e+02  1.33e-02  1.01e-06  2.16e-09  1.21e+11

Total time on 4 threads =   24.43 sec.

Barrier - Optimal:  Objective =  8.5343931712e+02
Solution time =   24.43 sec.  Iterations = 164
Deterministic time = 17777.64 ticks  (727.67 ticks/sec)

CPLEX> Solution written to file '/tmp/tmpUxzn5E.cplex.sol'.
CPLEX> Killed

It seems that cplex is solving it, but for some reason the process is being killed at the end.

Pancho

Watson, Jean-paul

unread,
Apr 16, 2013, 3:11:30 PM4/16/13
to coopr...@googlegroups.com
Grumble. Can you send the script off-line? I'm doing the exact same thing in various places, w/o issue.

jpw

From: Pancho <elpanc...@gmail.com>
Reply-To: "coopr...@googlegroups.com" <coopr...@googlegroups.com>
Date: Tuesday, April 16, 2013 1:08 PM
To: "coopr...@googlegroups.com" <coopr...@googlegroups.com>

Pancho

unread,
Apr 17, 2013, 10:18:52 AM4/17/13
to coopr...@googlegroups.com
sent
Reply all
Reply to author
Forward
0 new messages