Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Parallel Threads using CPLEX Studio Trial for 90 days

    Posted Thu October 22, 2015 11:15 AM

    Originally posted by: Zoubeir


    I am using the community edition of CPLEX Studio for 90 days. I am calling CPLEX from Python using the PULP tool.

    In my python code, I used a parallel for loop to accelerate the execution. When I increase the number of workers in the for loop I get the error message : CplexSolverError: CPLEX Error  1234: Failed to create parallel thread.

     

    My question is the following: Is there a limitations on the number of parallel threads that CPLEX can run ? If yes, how many I can use to prevent the error ? If no, where this error come from ?

     

    I am thankful to you.

     

    Best Regards.


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Parallel Threads using CPLEX Studio Trial for 90 days

    Posted Thu October 22, 2015 11:30 AM

    I am not very familiar with PuLP, but I can guess what's going on here.  By default, CPLEX will use as many threads as there are cores on your machine (see the documentation for the global thread count parameter).  If you are firing off a bunch of CPLEX runs simultaneously (each using as many threads as there are cores on your machine) this could easily overload things (see the documentation for CPXERR_THREAD_FAILED).

     

    I would either get rid of your "parallel for loop" (i.e., run them sequentially so that each can take advantage of multiple threads), or leave things as they are and set the CPLEX global thread count to 1 (and make sure to not run too many at once).

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Parallel Threads using CPLEX Studio Trial for 90 days

    Posted Thu October 22, 2015 01:41 PM

    Originally posted by: Zoubeir


    Thank you very much. I cannot set the CPLEX global thread count in Python. Do you have any idea?

     

    I did the following:

     

    import cplex
    c = cplex.Cplex()
    c.parameters.threads = 1
    c.parameters.prallel = 1
    

     

    But I still get the same error.


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Parallel Threads using CPLEX Studio Trial for 90 days

    Posted Thu October 22, 2015 03:03 PM

    The code should look like this instead:

    import cplex
    c = cplex.Cplex()
    c.parameters.threads.set(1)
    c.parameters.parallel.set(1)
    

    This is an easy mistake to make (one that I've made myself).


    #CPLEXOptimizers
    #DecisionOptimization