Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
  • 1.  Issue with CPLEX 12.7.1 annotations in Benders decomposition

    Posted Tue June 06, 2017 05:52 PM

    Originally posted by: amulya_yadav


    Hi,

     

    I am building a model in CPLEX 12.7.1 and my model has constraints of the form z=x*y where z,x,y are all binary variables.

     

    I tried to use Benders decomposition to decompose my problem into a master problem and sub-problem. I want to keep my x and y variables in the master problem, and the z variable in the sub-problem. Now, I can set my z variable to be a float variable if both x and y are integral.

     

    This is the code that I wrote to annotate my model:

    IloCplex.LongAnnotation benders =

                          cplex.newLongAnnotation("cpxBendersPartition");

    cplex.setAnnotation(benders, x, 0);

    cplex.setAnnotation(benders, y, 0);

    cplex.setAnnotation(benders, z, 1);

     

    However, when I run this piece of code (after specifying my model), I get this error:

    # A fatal error has been detected by the Java Runtime Environment:

    #

    #  SIGSEGV (0xb) at pc=0x000000011e0e22ca, pid=1324, tid=0x0000000000001c03

    #

    # JRE version: Java(TM) SE Runtime Environment (8.0_112-b16) (build 1.8.0_112-b16)

    # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.112-b16 mixed mode bsd-amd64 compressed oops)

    # Problematic frame:

    # C  [libcplex1271remotejni.jnilib+0xf62ca]  _38538ad882a4e3819e56642938452df9+0x43a

    #

    # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

    #

    # An error report file with more information is saved as:

    # /Users/amulyayadav/Documents/gurobi/MIO-Interpretable/hs_err_pid1324.log

     

     

    Surprisingly, this error goes away after I put z in the master problem. Does anyone have any idea of how to fix this?

     

    I have attached the error report file.


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Issue with CPLEX 12.7.1 annotations in Benders decomposition

    Posted Wed June 07, 2017 01:24 AM

    I cannot reproduce this crash here. The following Java program works without any problem for me

    import ilog.cplex.*;
    import ilog.concert.*;
    
    public final class AnnoFail {
       public static void main(String[] args) throws IloException {
          final IloCplex cplex = new IloCplex();
          try {
             IloNumVar x = cplex.numVar(0, 1, "x");
             IloNumVar y = cplex.numVar(0, 1, "y");
             IloNumVar z = cplex.numVar(0, 1, "z");
    
             cplex.addEq(z, cplex.prod(x, y));
    
             IloCplex.LongAnnotation benders = cplex.newLongAnnotation("cpxBendersPartition");
             cplex.setAnnotation(benders, x, 0);
             cplex.setAnnotation(benders, y, 0);
             cplex.setAnnotation(benders, z, 1);
             cplex.writeAnnotations("AnnoFail.ann");
          }
          finally {
             cplex.end();
          }
       }
    }
    

    Can you try whether this works for you as well? If it does, can you provide a (small) test program that (reliably) triggers the crash on your machine?

    Please also note the following two things

    1. A constraint like z=x*y (with x, y, z being variables) is a quadratic equality constraint. This is not positive semi-definite, so unless presolve can eliminate this constraint, this will raise an error.
    2. As stated here CPLEX automatic Benders decomposition only applies to MILP (not MIQCP).

    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Issue with CPLEX 12.7.1 annotations in Benders decomposition

    Posted Wed June 07, 2017 07:06 PM

    Originally posted by: amulya_yadav


    Hi, Your code snippet worked on my machine. I have attached a test program (I tried to reduce it in size as much as possible) which fails most times on multiple machines.

     

    The z=x.y constraint is linearized (in the code that I have attached...the variable names are lin = z*x) . I also figured out that the error is thrown not when annotations are being set. Rather, the error is thrown when I try to writeAnnotations to a file. Also, it has to do something with the size of the problem as well. For e.g., if the IloNumVar matrices in my code are made smaller in size, then the error goes away. And the error is thrown up more frequently as I increase the size of these matrices.

    The error that I get is the following:

    #

    # A fatal error has been detected by the Java Runtime Environment:

    #

    #  SIGSEGV (0xb) at pc=0x00000001214de2ca, pid=5111, tid=0x0000000000001c03

    #

    # JRE version: Java(TM) SE Runtime Environment (8.0_112-b16) (build 1.8.0_112-b16)

    # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.112-b16 mixed mode bsd-amd64 compressed oops)

    # Problematic frame:

    # C  [libcplex1271remotejni.jnilib+0xf62ca]  _38538ad882a4e3819e56642938452df9+0x43a

    #

    # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

    #

    # An error report file with more information is saved as:

    # /Users/amulyayadav/Documents/gurobi/MIO-Interpretable/hs_err_pid5111.log

    #

    # If you would like to submit a bug report, please visit:

    #   http://bugreport.java.com/bugreport/crash.jsp

    # The crash happened outside the Java Virtual Machine in native code.

    # See problematic frame for where to report the bug.

     

     

    I have attached both the source code, and the error log that is generated. I would greatly appreciate any help!

     

    Thanks,
    Amulya


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Issue with CPLEX 12.7.1 annotations in Benders decomposition

    Posted Thu June 08, 2017 04:40 AM

    Thanks a lot! I reproduced the problem here. This is indeed a bug in CPLEX.

    Can you please try adding this line before calling cplex.writeAnnotations():

    try { cplex.exportModel("/no/such/file"); } catch (IloException ignored) {}

    That should fix the issue.


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Issue with CPLEX 12.7.1 annotations in Benders decomposition

    Posted Thu June 08, 2017 02:52 PM

    Originally posted by: amulya_yadav


    Thanks a lot. This worked!

    However, the .ann file only contains the annotations that I explicitly set. Is there a method using which I can get the annotations which tell me how CPLEX decomposed my sub problems (when I run Benders in the Workers mode). 

    Right now, either I get just my annotations (using writeAnnotations) OR I get the annotations which tell me CPLEX's decomposition of the problem in AUTO mode.

     

    Basically, I want to use Workers mode of Benders and ensure that CPLEX is not decomposing my sub-problems in an unexpected manner.

     

    Thanks,

    Amulya


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Issue with CPLEX 12.7.1 annotations in Benders decomposition

    Posted Mon June 12, 2017 09:14 AM

    Just to clarify: You are setting the Benders strategy parameter to USER (1) and want to know which decomposition CPLEX ended up using?


    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Issue with CPLEX 12.7.1 annotations in Benders decomposition

    Posted Mon June 12, 2017 02:59 PM

    Originally posted by: amulya_yadav


    No. I am setting the Benders strategy parameter to WORKER (2) and want to know which decomposition CPLEX ended up using.

     

    I think with USER (1), CPLEX uses only my annotations which i can get using writeAnnotations(). Is that correct?


    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Issue with CPLEX 12.7.1 annotations in Benders decomposition

    Posted Tue June 13, 2017 12:46 PM

    Sorry, I meant to say WORKER (2). You are right, with USER (1) you will get the annotations you specified.

    Unfortunately, there is currently no way to get the decomposition that CPLEX actually used with strategy WORKER (2). You may want to file a request for enhancement here.


    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: Issue with CPLEX 12.7.1 annotations in Benders decomposition

    Posted Tue June 13, 2017 03:09 PM

    Originally posted by: amulya_yadav


    Thanks!


    #CPLEXOptimizers
    #DecisionOptimization


  • 10.  Re: Issue with CPLEX 12.7.1 annotations in Benders decomposition

    Posted Mon January 22, 2018 03:22 AM

    The crash (segmentation fault) report in the initial post is fixed in CPLEX version 12.8.


    #CPLEXOptimizers
    #DecisionOptimization