Decision Optimization

Decision Optimization

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


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

Parallel processing

  • 1.  Parallel processing

    Posted 01/10/12 11:21 AM

    Originally posted by: kaveh_azizian


    Hi,
    I noticed it is possible to do parallel computation with cplex. I am interested to use barrier algorithm of CPLEX to solve a large scale LP. I am using cplex in Matlab but I donot know how I can set the lp solver to Barrier method and how to begin to do parallel caculation. Do I need to open Matlab workers when I want to use parallel procesing with barrier method? I mean matlabpool open ..
    so many thanks
    kaveh
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Parallel processing

    Posted 01/10/12 11:28 AM

    Originally posted by: John Cui


    No, you don't need to care about matlab workers.

    You can just set lpmethod to 4 to let CPLEX use barrier to solve your problem, CPLEX will use parallel computing by default.

    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Parallel processing

    Posted 01/10/12 11:39 AM

    Originally posted by: kaveh_azizian


    Thanks for response
    Is this correct?

    cpoptions=cplexoptimset('cplex');
    cpoptions.lpmethod = 4;
    xl,fl,exitflag]=cplexlp(clin,Atot,btot,Atoteq,btoteq,lbn,ubn,[,cpoptions);

    Where can I find a user guide about thiese options and the way of implementation in Matlab?
    regards,
    kaveh
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Parallel processing

    Posted 01/10/12 11:42 AM


  • 5.  Re: Parallel processing

    Posted 01/10/12 12:01 PM

    Originally posted by: kaveh_azizian


    The provided link does not work?!
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Parallel processing

    Posted 01/10/12 12:06 PM

    Originally posted by: John Cui


    No, it really works here.

    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Parallel processing

    Posted 01/10/12 02:11 PM

    Originally posted by: SystemAdmin


    Please try out John's link in IE. Other browsers may not be able to render it at times.
    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Parallel processing

    Posted 01/10/12 02:17 PM

    Originally posted by: kaveh_azizian


    Yes it doesnot work with firefox but with IE it works.
    Also a small question:
    What I understood from your prvious comments, cplex detects the available cores and cpu s automatically when I try its barrier algorithm. Is that right?
    Can I use cplex in a cluster of computers including several nodes and cpus with my current licence?

    so many thanks
    kaveh
    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: Parallel processing

    Posted 01/11/12 12:52 AM

    Originally posted by: John Cui


    Yes, you can.

    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 10.  Re: Parallel processing

    Posted 01/19/12 01:39 PM

    Originally posted by: kaveh_azizian


    John I have another question on parallel optimization.
    What does thread mean for cplex? Is it like core? I mean whenever I set threads=16 then it will use just 16 avaiable cores?
    And I didn't see any difference when I used 16 cores to solve my problem (usin cplex in Matlab) comparing with 8 cores! To clarify I set the lpmethod=4 (Barrier method) and threds=16.

    I blieve if I have two seperated cpus with 16 cores in total,8 for each, the cplex cannot profit the avaiable cores of the second CPU. Am I right or I am doing something wrongly.

    so many thanks
    #CPLEXOptimizers
    #DecisionOptimization


  • 11.  Re: Parallel processing

    Posted 01/23/12 02:20 PM

    Originally posted by: SystemAdmin


    CPLEX can use as many processors as your operating system reports. If your OS reports 16 processors, then CPLEX can use up to that many threads.
    CPLEX will also print in its diagnostic output how many threads it actually uses.
    Note that using more threads does not necessarily result in a speed up of solution time. Depending on the problem, it may not be useful to use more than N threads. In fact, using more than N threads may reduce performance in the worst case. This is a general property of parallel algorithms.
    #CPLEXOptimizers
    #DecisionOptimization


  • 12.  Re: Parallel processing

    Posted 01/27/12 05:45 PM

    Originally posted by: kaveh_azizian


    So many thanks for reply.
    I am usin CPLEX in Matlab and when I set cpoptions.diagnostics = 'on'; I don't see the number of threads (cores) used during the solution process.
    Do you know how I can realize the number of cores (cpus) used during the calculation in Matlab? and
    Do I need a special licence to use CPLEX in Matlab with 64 cores for example or the academic free licence is enough?
    thanks
    #CPLEXOptimizers
    #DecisionOptimization


  • 13.  Re: Parallel processing

    Posted 01/28/12 08:33 PM

    Originally posted by: John Cui


    The threads info is in cplex log, can you see cplex log when you solve your problem?

    like this:

    
    MIP Presolve eliminated 2 redundant SOS constraints. MIP Presolve eliminated 1 redundant SOS constraints. Tried aggregator 2 times. MIP Presolve eliminated 5 rows and 4 columns. MIP Presolve added 5 rows and 5 columns. MIP Presolve modified 26 coefficients. Aggregator did 4 substitutions. Reduced MIP has 16 rows, 30 columns, and 93 nonzeros. Reduced MIP has 21 binaries, 5 generals, 1 SOSs, and 0 indicators. Probing time =    0.02 sec. Tried aggregator 1 time. Presolve time =    0.08 sec. Probing time =    0.00 sec. Clique table members: 1. MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic, using up to 2 threads. Root relaxation solution time =    0.03 sec.   Nodes                                         Cuts/  Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap   0     0     2811.8728     6                   2811.8728       12 0     0     2848.5950     9                     Cuts: 9       18 0     0     2849.8717    13                     Cuts: 4       26 0     0     2849.9109    13                     Cuts: 3       29 0     0     2849.9109    14                     Cuts: 3       31 *     0+    0                         3302.0000     2849.9109       31   13.69% *     0+    0                         3188.0000     2849.9109       31   10.61% 0     2     2849.9109    11     3188.0000     2849.9109       31   10.61% Elapsed real time =   0.23 sec. (tree size =  0.01 MB, solutions = 2) *     3+    3                         3089.0000     2850.2472       40    7.73% Cover cuts applied:  2 Flow cuts applied:  1 Mixed integer rounding cuts applied:  3 Gomory fractional cuts applied:  2   Root node processing (before b&c): Real time             =    0.11 Parallel b&c, 2 threads: Real time             =    0.06 Sync time (average)   =    0.00 Wait time (average)   =    0.00 ------- Total (root+branch&cut) =    0.17 sec.
    


    You can see 2 threads in above log.

    John
    #CPLEXOptimizers
    #DecisionOptimization


  • 14.  Re: Parallel processing

    Posted 01/31/12 10:17 AM

    Originally posted by: kaveh_azizian


    Hi,
    To profit all availabel cores I set cpoptions.parallel=-1 in Matlab and then what I see whn I set diagnose='on' is as following:
    Parallel mode: opportunistic, using up to 8 threads for concurrent optimization.
    Tried aggregator 1 time.
    LP Presolve eliminated 319969 rows and 55809 columns.
    Reduced LP has 132864 rows, 511024 columns, and 3020032 nonzeros.
    Does it mean I am using eight cores?
    thanks
    #CPLEXOptimizers
    #DecisionOptimization


  • 15.  Re: Parallel processing

    Posted 01/31/12 03:07 PM

    Originally posted by: SystemAdmin


    Yes, CPLEX uses 8 cores to solve your problem.
    #CPLEXOptimizers
    #DecisionOptimization


  • 16.  Re: Parallel processing

    Posted 02/02/12 12:55 AM

    Originally posted by: John Cui


    Or, you are using 4 cores, each core can use 2 threads.
    By default, CPLEX use all of your cores in your computer, so if you want to know how many cores CPLEX used, you can also check your computer's core information.

    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 17.  Re: Parallel processing

    Posted 02/07/12 04:39 PM

    Originally posted by: kaveh_azizian


    I am sure cplex uses 8 cores vaialable on one computer. But is it capable of using for example 4 seperated computers with 8 cores for each?
    I mean can it use all of 64 cores avaiable on 8 different computers? Can it do network parallel computing? If yes, wich protocol it uses? Does it use MPI protocol?
    I tried parallel computing with cplex integrated in Matlab in a super computer with 8 seperate processors which each of them has 8 cores
    by setting following options in Matlab:
    cpoptions = cplexoptimset('cplex');
    cpoptions.diagnostics = 'on';
    cpoptions.threads=64;
    cpoptions.parallel=-1;
    but it seems cplex uses only the 8 cores not all of avaiable 64 cores.

    I would be grateful if you address this questions.
    #CPLEXOptimizers
    #DecisionOptimization


  • 18.  Re: Parallel processing

    Posted 02/07/12 04:43 PM

    Originally posted by: SystemAdmin


    CPLEX only implements shared memory parallelism. It does not implement distributed parallelism, so it cannot use multiple computers at the same time.
    #CPLEXOptimizers
    #DecisionOptimization