Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

Error with using Cplex Class API in CPLEX 12.4 for MATLAB

  • 1.  Error with using Cplex Class API in CPLEX 12.4 for MATLAB

    Posted 02/12/12 03:05 PM

    Originally posted by: YongCheng@TUDarmstadt


    Dear All,

    I try to install and use CPLEX 12.4 (the academic initiative version). I program with Cplex Class API in MATLAB. It works well for some models, such as the examples within the distribution.
    However, when I implement my own model (which is a mixed-integer second order cone program, MISOCP), I always get the error message: "Segmentation Violation Detected". I have tried the MATLAB versions R2008a, R2009b, 2010a, on both Windows and Linux systems. On the other hand, it works well in solving the continuous relaxations of the MISOCP.

    Is there anyone who faces a similar problem?
    Are there special requirements on the MATLAB version for CPLEX 12.4?
    What's the common cause for such a Segmentation Violation problem?
    How can I fix it?
    Thank you in advance!
    Yong Cheng
    yong.cheng@nt.tu-darmstadt.de
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Error with using Cplex Class API in CPLEX 12.4 for MATLAB

    Posted 02/12/12 05:18 PM

    Originally posted by: EdKlotz


    > YongCheng@TUDarmstadt wrote:
    > Dear All,
    >
    > I try to install and use CPLEX 12.4 (the academic initiative version). I program with Cplex Class API in MATLAB. It works well for some models, such as the examples within the distribution.
    > However, when I implement my own model (which is a mixed-integer second order cone program, MISOCP), I always get the error message: "Segmentation Violation Detected".

    And does this error message occur after you see output indicating that CPLEX has started to solve
    the problem, or does it appear to occur before the optimization even starts? In either case,
    just before the Cplex.solve() call, insert a call to Cplex.writeModel to generate a binary SAV file
    of the model. Then read it into interactive CPLEX, turn on the datacheck parameter ('set read
    datacheck yes'), and try to solve it from there. If you can reproduce the crash there but don't
    get any errors indicating invalid data, upload the SAV file to this forum thread so we can have a
    look. If the datacheck parameter indicates some sort of invalid problem data array, hopefully
    you can trace that back to the problem data arrays you specified in MATLAB. In particular, be
    careful to make sure that your MATLAB arrays have the right dimension. For example, if you
    inadvertently initialize the rhs array so it has fewer entries than the number of constraints,
    CPLEX will access uninitialized memory to complete the array values, which can lead to unpredictable
    results, including segmentation faults.

    Ed

    > I have tried the MATLAB versions R2008a, R2009b, 2010a, on both Windows and Linux systems. On the >other hand, it works well in solving the continuous relaxations of the MISOCP.
    >
    > Is there anyone who faces a similar problem?
    > Are there special requirements on the MATLAB version for CPLEX 12.4?
    > What's the common cause for such a Segmentation Violation problem?
    > How can I fix it?
    >
    >
    > Thank you in advance!
    >
    >
    > Yong Cheng
    > yong.cheng@nt.tu-darmstadt.de
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Error with using Cplex Class API in CPLEX 12.4 for MATLAB

    Posted 02/12/12 09:49 PM

    Originally posted by: John Cui


    If you are OK to attach your matlab code to here, It will be better for us to reproduce.

    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Error with using Cplex Class API in CPLEX 12.4 for MATLAB

    Posted 02/13/12 04:07 AM

    Originally posted by: YongCheng@TUDarmstadt


    Thanks.

    The error occurs before the optimization process starts.

    I will try to debug my codes according to your instructions.
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Error with using Cplex Class API in CPLEX 12.4 for MATLAB

    Posted 02/13/12 04:13 AM

    Originally posted by: YongCheng@TUDarmstadt


    By the way, my codes work well with CPLEX 12.3 for MATLAB.
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Error with using Cplex Class API in CPLEX 12.4 for MATLAB

    Posted 02/13/12 05:21 AM

    Originally posted by: SystemAdmin


    Do you have any quadratic constraints in your code that are not pure SOCP constraints (for example rotated cones or more general quadratic constraints)?
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Error with using Cplex Class API in CPLEX 12.4 for MATLAB

    Posted 02/13/12 11:29 AM

    Originally posted by: YongCheng@TUDarmstadt


    Yes, I have many general quadratic (SOCP) constraints, such as: w'*Q*w <= x*x; w'*w <= b*y; where w, x, and y are continuous variables, while b is binary variables.
    The problem scale is large. I may have, e.g., 600 binary varibles.
    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Error with using Cplex Class API in CPLEX 12.4 for MATLAB

    Posted 02/14/12 01:58 AM

    Originally posted by: SystemAdmin


    I think you have run into a known issue with CPLEX 12.4 :-(
    The only ways to work around this problem at the moment are
    • downgrade to CPLEX 12.3 and wait for the 12.4 fixpack or
    • rewrite your quadratic constraints so that all of them are pure SOCP constraints (\sum x_i^2 - x_0^2 <= 0, x_0 >= 0, x_i free).

    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: Error with using Cplex Class API in CPLEX 12.4 for MATLAB

    Posted 02/14/12 03:00 AM

    Originally posted by: YongCheng@TUDarmstadt


    Thank you very much!

    Good to know that it is a known problem.

    I will proceed accrodingly to your suggestions.

    By the way, is there an official annoucement/tech-note about this problem with CPLEX 12.4?
    I'd like to show the official annoucement to my boss and colleagues.

    Thanks.
    Yong Cheng
    yong.cheng@nt.tu-darmstadt.de
    #CPLEXOptimizers
    #DecisionOptimization


  • 10.  Re: Error with using Cplex Class API in CPLEX 12.4 for MATLAB

    Posted 04/11/12 03:01 AM

    Originally posted by: SystemAdmin


    The fixpack for CPLEX 12.4 should now be available here.
    #CPLEXOptimizers
    #DecisionOptimization


  • 11.  Re: Error with using Cplex Class API in CPLEX 12.4 for MATLAB

    Posted 04/12/12 05:45 AM

    Originally posted by: YongCheng@TUDarmstadt


    Thanks, Daniel.

    Unfortunately, I'm a student and I'm using the CPLEX academic research edition.
    It seems that the available fix-packs are not for academic research edition.

    I'm waiting for the fix-packs for the academic research edition ...
    #CPLEXOptimizers
    #DecisionOptimization


  • 12.  Re: Error with using Cplex Class API in CPLEX 12.4 for MATLAB

    Posted 05/07/12 11:21 AM

    Originally posted by: SystemAdmin


    The fixpack for the academic research edition should be available now. See here.
    #CPLEXOptimizers
    #DecisionOptimization