Decision Optimization

Decision Optimization

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


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

python API parameters problem

  • 1.  python API parameters problem

    Posted 04/04/18 10:46 PM

    Originally posted by: savant_ning


    I have used  problem.parameters.read.datacheck.values.off

    but the datacheck always display 1

    and I have used the threads.set(20)...

    but the CPU always single CPU process...

     

    why have these problems...I don't understand

    thanks


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: python API parameters problem

    Posted 04/05/18 02:01 AM

    You have to provide more information if you want us to help you. Didn't you notice that your console window hides the code that attempts to set parameters? So we would not be able to tell you, whether your code is correct or not.

    In any case:

    1. This works correctly for me:

    for model in sys.argv[1:]:
      with cplex.Cplex(model) as cpx:
        cpx.parameters.read.datacheck.set(cpx.parameters.read.datacheck.values.off)
        cpx.solve()

       No display of the data check parameter (and if I comment out setting the parameter then I get the display)

    2. About the thread count: are you sure you are in a part were things should actually run in parallel? Maybe you are still building your model or CPLEX is in a section that is inherently sequential. Doesn't the CPLEX log output show a line that says CPLEX will use up to 20 threads? Can you show the log output?


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: python API parameters problem

    Posted 04/05/18 11:12 PM

    Originally posted by: savant_ning


    okay,  thx

    1.sorry for  my picture hides my code, and  the parameters data_check had correctly worked now.

     

    2. u are right,  it still building my model.

     

    3. and I want to know use resolve or aggregators can reduce the run time? or increase the run time?

    because my  model use aggregators had run 24 hours to display:

    Aggregators has done XXXXXX substitutions...

    and I don't know how long it will end the aggreagators...

    thanks


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: python API parameters problem

    Posted 04/06/18 08:07 AM

    Are you saying that the aggregator itself ran 24 hours? I mean, it is not anything before calling solve() that took so long, it is the call to solve() and after 24 hours you still only have that message from the aggregator? If so, could you post your model here?


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: python API parameters problem

    Posted 04/12/18 09:48 PM

    Originally posted by: savant_ning


    HI, this is my model about my problem, but the model size limit for this type of file is 10485760 bytes, I don't know how to give u the model?

     

    and this model display error: no solution exists....and I don't know why~

     

    THX


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: python API parameters problem

    Posted 04/12/18 09:52 PM

    Originally posted by: savant_ning


    oh, I have shared this model with u, thanks for your help


    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: python API parameters problem

    Posted 04/13/18 02:38 AM

    Hm, what do you mean you shared this model with me? If you send it by email then I did not receive it. As of now I don't have your model. Note that the best way to export a model is the ".sav.gz" file format. That will give the smallest file.


    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: python API parameters problem

    Posted 04/13/18 02:55 AM

    Originally posted by: savant_ning


    yeah, I have export the model as ".sav.gz", but the size is over the limit...  and please tell me your email, I can send it to you, very thanks


    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: python API parameters problem

    Posted 04/13/18 03:00 AM

    Please send the model to daniel(dot)junglas(at)de(dot)ibm(dot)com.


    #CPLEXOptimizers
    #DecisionOptimization


  • 10.  Re: python API parameters problem

    Posted 04/13/18 03:11 AM

    Originally posted by: savant_ning


    sorry, I use outlook sent  to u , but the attachment is larger than the size limit for messages.

    So I send attachment to u again.

     

    very thanks


    #CPLEXOptimizers
    #DecisionOptimization


  • 11.  Re: python API parameters problem

    Posted 04/17/18 12:46 AM

    Thank you for the model. I picked it up and analyzed it. Unfortunately, you have hit on a performance bug in CPLEX. The problem is the huge number of indicator constraints (more than 4 million). I have filed a bug report for it. I did not find a good way to work around the problem. The best option I have so far is to rewrite your indicator constraints. All your indicator constraints are of the form

    x = 0  ->  y - z >= 0

    where x is binary and y, z are in [0, M] with M=41.xxx. With an M of this magnitude it should be safe to rewrite these constraints as

    y >= z - M*x

    That should not hurt numerics but improve speed a lot.

    By the way, your model is infeasible. I guess that is not expected?


    #CPLEXOptimizers
    #DecisionOptimization


  • 12.  Re: python API parameters problem

    Posted 04/17/18 03:41 AM

    Originally posted by: savant_ning


    Oh, thanks

     

    my model is combined by two sub-model,  I had write first model and run the result, but they forgot  tell me the important constraint, so I add the constraint with the second model...

    so the model looks strange,  I will check my model again, very thanks.


    #CPLEXOptimizers
    #DecisionOptimization


  • 13.  Re: python API parameters problem

    Posted 04/17/18 04:39 AM

    Originally posted by: savant_ning


    now I use new constraint to run this model, but I met the model  memory over my  servers.

    and How can I reduce the model memory by some function?

    thanks.


    #CPLEXOptimizers
    #DecisionOptimization


  • 14.  Re: python API parameters problem

    Posted 04/17/18 05:44 AM

    Do you hit the memory limit while constructing the model or while solving it?


    #CPLEXOptimizers
    #DecisionOptimization


  • 15.  Re: python API parameters problem

    Posted 04/17/18 06:31 AM

    Originally posted by: savant_ning


     when the model run the probe and aggregator later, print the auto-parameters, like MIP search method and so on,

     

    the memory will increase rapidly,

     

    and when try looking the heuristic, the memory will decrease rapidly and stabilise at small memory range.

     

    And I will refine my model today,  thanks for your reply


    #CPLEXOptimizers
    #DecisionOptimization