Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Segmentation fault (core dumped) while using Cplex Python API

    Posted Mon June 02, 2014 04:46 AM

    Originally posted by: varun7rs


    Hello Everyone,

    I am trying to solve a mixed-integer problem using Cplex Python API and I get this error Segmentation fault (core dumped). i am not able to figure out the reason for this. My objective function is minimizing the link utilization
    Traceback

    srva@hades:~$ python RW10.py --output test --logPath log --xml topology.xml
    Start Time: 2014-6-1-20-56-39
    CPLEX Parameter File Version 12.5.0.0
    CPX_PARAM_TILIM 3600
    CPX_PARAM_TRELIM 20000.00
    CPX_PARAM_EPGAP 0.03
    CPX_PARAM_EACHCUTLIM 2100000000
    CPX_PARAM_FLOWCOVERS 0
    CPX_PARAM_FLOWPATHS 0
    CPX_PARAM_CLIQUES 0
    CPX_PARAM_DISJCUTS 0
    CPX_PARAM_COVERS 0
    CPX_PARAM_ZEROHALFCUTS 0
    CPX_PARAM_MIRCUTS 0
    CPX_PARAM_MCFCUTS 0
    CPX_PARAM_IMPLBD 0
    CPX_PARAM_GUBCOVERS 0
    CPX_PARAM_AGGCUTLIM 3

    Completion Time: 972.63
    Num Columns: 1350888
    Num Rows: 25488
    Solving
    Segmentation fault (core dumped)


    A few lines from the log file:

    Completion Time: 972.63
    Num Columns: 1350888
    Num Rows: 25488
    Tried aggregator 1 time.
    MIP Presolve eliminated 12648 rows and 1321088 columns.
    MIP Presolve modified 180 coefficients.
    Reduced MIP has 12840 rows, 29800 columns, and 136000 nonzeros.
    Reduced MIP has 29800 binaries, 0 generals, 0 SOSs, and 0 indicators.
    Presolve time = 0.49 sec. (368.57 ticks)

    I posted this in the ampl google groups and @Bob re-directed meto this forum. So I posted the question over here.I would be grateful if someone can help me fix this.

    Thank You


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Segmentation fault (core dumped) while using Cplex Python API

    Posted Mon June 02, 2014 10:59 AM

    First of all, try setting CPX_PARAM_DATACHECK to a true value to make sure you are not passing bogus data to CPLEX. If that does not show any issues, could you produce a stacktrace for the segmentation fault and post it here? Something like this:

    srva@hades:~$ gdb --args python RW10.py --output test --logPath log --xml topology.xml
    (gdb) run
    ...
    (gdb) backtrace

    I am not clear why you turned to the ampl groups. Are you using AMPL in your code or are you using the CPLEX Python API directly?


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Segmentation fault (core dumped) while using Cplex Python API

    Posted Mon June 02, 2014 06:03 PM

    Originally posted by: varun7rs


    I tried setting the param.datacheck using prob.parameters.read.datacheck.set(1) but the log file showed no change. When I tried the command suggested by you, this is the stacktrace it produced. 

    Completion Time: 1091.48
    Num Columns: 1350800
    Num Rows: 25488
    Solving
    [New Thread 0x7ffff402c700 (LWP 8837)]
    [New Thread 0x7ffff382b700 (LWP 8838)]
    [New Thread 0x7ffff302a700 (LWP 8839)]
    [New Thread 0x7ffff2829700 (LWP 8840)]
    [New Thread 0x7ffff2028700 (LWP 8841)]
    [New Thread 0x7ffff1827700 (LWP 8842)]
    [New Thread 0x7ffff1026700 (LWP 8843)]
    [New Thread 0x7ffff0825700 (LWP 8844)]
    [New Thread 0x7ffff0024700 (LWP 8845)]
    [New Thread 0x7fffef823700 (LWP 8846)]
    [New Thread 0x7fffef022700 (LWP 8847)]

    Program received signal SIGSEGV, Segmentation fault.
    0x00007ffff53cd871 in _84c3c4d55d10ed85d167906892b45d7d ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    (gdb) backtrace
    #0  0x00007ffff53cd871 in _84c3c4d55d10ed85d167906892b45d7d ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #1  0x00007ffff4eae520 in _86ca56ee2db9b66412fe44a38f0981bc ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #2  0x00007ffff4ea7b90 in _fb697b0790ebaa204d9bffad490998af ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #3  0x00007ffff4ea4e27 in _6fec0df6191aca1ec5400ca6a20e946b ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #4  0x00007ffff4e98401 in _de13085d0f2bfdcc7b6b56488e0772ff ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #5  0x00007ffff536b200 in _3404a81202aeb2fe4e04048a6e51aaf2 ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #6  0x00007ffff53658db in _79368b58f19f4ae50c1568c3c495c32e ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #7  0x00007ffff4edc73d in _e2a173dd4f28440013f948f3df03540b ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_inte---Type <return> to continue, or q <return> to quit---
    rnal/py1013_cplex125.so
    #8  0x00007ffff4ed95e9 in _0e75b7b272ad5c835c70d8b6dc930389 ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #9  0x00007ffff4fd075e in _5c35bbe0fa13e9030706c95a3433f74c ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #10 0x00007ffff51689d1 in _cf5e1e4116b65a285ebeb7a3d16b2dab ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #11 0x00007ffff5165074 in _b1ad90de21a32fcc2a1700aba16ace0e ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #12 0x00007ffff516976d in _5e0c96d3338c8e0c6723a205edd9e198 ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #13 0x00007ffff516cc09 in _d285c05928def6cdbb2b67da064c2ea3 ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #14 0x00007ffff50ad97a in _3c7c33e1181e301636b712bd8b86087a ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #15 0x00007ffff50a9741 in _a5ac66bf2a77f76a39d6d39cb35ec3b8 ()
    ---Type <return> to continue, or q <return> to quit---
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #16 0x00007ffff50a807c in _8727296eaaa73edeafa0b13f8264cf6b ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #17 0x00007ffff4fd0f0d in _5ce57952ba3c58d45c4ff1caf38ccdb0 ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #18 0x00007ffff4fd06fe in _2aa011ff11483daf73a86fadae02922d ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #19 0x00007ffff4ff4a4e in _c69cadd8f44da6e42b444e6f0807896a ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #20 0x00007ffff4ff7281 in _6874c3b6b6be3f68ecba8390ec5eef57 ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #21 0x00007ffff4ff61c8 in _0ff8510b91f0240cafe918f6ab601dab ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #22 0x00007ffff4ff4b6b in _cac20a5c347b91b75f3929b6cf82c567 ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    ---Type <return> to continue, or q <return> to quit---
    #23 0x00007ffff4fd0e78 in _5ce57952ba3c58d45c4ff1caf38ccdb0 ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #24 0x00007ffff507d049 in CPXSmipopt ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #25 0x00007ffff4e58da3 in _wrap_CPXXmipopt ()
       from /opt/ibm/ILOG/CPLEX_Studio125/cplex/python/x86-64_sles10_4.1/cplex/_internal/py1013_cplex125.so
    #26 0x000000000054bb14 in PyEval_EvalFrameEx ()
    #27 0x000000000054c272 in PyEval_EvalFrameEx ()
    #28 0x000000000054c272 in PyEval_EvalFrameEx ()
    #29 0x000000000054c272 in PyEval_EvalFrameEx ()
    #30 0x000000000054c272 in PyEval_EvalFrameEx ()
    #31 0x000000000054c272 in PyEval_EvalFrameEx ()
    #32 0x0000000000575d92 in PyEval_EvalCodeEx ()
    #33 0x00000000004c1352 in PyRun_SimpleFileExFlags ()
    #34 0x00000000004c754f in Py_Main ()
    #35 0x00007ffff68cb76d in __libc_start_main ()
       from /lib/x86_64-linux-gnu/libc.so.6
    #36 0x000000000041ba41 in _start ()



    Thank You


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Segmentation fault (core dumped) while using Cplex Python API

    Posted Tue June 03, 2014 01:23 AM

    Hm, this looks like a genuine bug in CPLEX. Could you please try to upgrade to 12.6 and see if the problem persists?

    If you cannot upgrade or if the problem persists, could you execute

    cplex.write("model.sav.gz")

    right before calling cplex.solve() and attach the created model.sav.gz file here?


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Segmentation fault (core dumped) while using Cplex Python API

    Posted Tue June 03, 2014 06:12 AM

    Originally posted by: varun7rs


    I have not yet upgraded it to the latest version but I will make sure I do it. I executed the command and I'm attaching the model with this post.

    Thank You


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Segmentation fault (core dumped) while using Cplex Python API

    Posted Tue June 03, 2014 07:37 AM

    Sorry, this did not work as expected. Can you please try again but this time do

    cplex.write('model.sav')

    (without the '.gz' suffix). From a first glance at your file it looks as if you have several variables with the same name ("f_eN_SGW_2_13_15"). Could you please double check that all variables have different names?


    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Segmentation fault (core dumped) while using Cplex Python API

    Posted Tue June 03, 2014 05:24 PM

    Originally posted by: varun7rs


    Hello,

    I checked my code once again and I had a few changes to make. I have attached the code as well as the model file. I have a bad feeling about one of the constraints. I'm not sure if its the right way to implement it. The same formulation worked in AMPL but when I do it in Python, I have some problem.(Link Mapping Constraints)

    Thank You


    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Segmentation fault (core dumped) while using Cplex Python API

    Posted Wed June 04, 2014 12:15 AM

    Does your modified program still crash? When I run the model.sav file through the interactive here I cannot reproduce the crash. Also, the .zip files you attached in the previous post is missing the topology.xml file, so I cannot run your original Python code here.

    In any case, you have several variables that have the same name. This may cause trouble sooner or later. You can find the duplicate names like this:

    import cplex

    cpx = cplex.Cplex()
    cpx.read('model.sav')
    names = dict()
    for name in cpx.variables.get_names():
        if name in names:
            names[name] += 1
        else:
            names[name] = 1
    for name, count in names.iteritems():
        if count > 1:
            print 'There are', count, 'variables with name', name

    You may want to fix this before continuing investigation, just to make sure that this is not the cause for your problems.


    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: Segmentation fault (core dumped) while using Cplex Python API

    Posted Thu June 05, 2014 05:29 AM

    Originally posted by: varun7rs


    Thanks a lot for that code Daniel. I was able to remove them. Now, the crash doesn't occur. This time around, I'm working on a smaller topology and the program works fine. Thanks a lot for your help and I guess I set off a false alarm regarding the CPLEX bug.


    #CPLEXOptimizers
    #DecisionOptimization