Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

How to use the cluster to compute the model

  • 1.  How to use the cluster to compute the model

    Posted Tue November 13, 2018 10:06 PM

    Originally posted by: skyskyhuanghuang


    Hi,everyone:

    I met a problem.

    When I use the cp engine,I have four servers, and it takes too long to calculate the model for a single server. How can I use the computing performance of four servers to cluster computing models to shorten the time?

    The following is my model:

    using CP;
    int M=...;
    float P=...;
    float H[1..M][1..M]=...;
    float B0=...;
    float n0=...;
    dvar int Yji[1..M][1..M] in 0..1 ;
     
    execute
    {
    var p=cp.param;
    p.LogPeriod=80000;
    p.TimeLimit=36000;
    p.Workers=40;
    p.searchType="Restart";
    p.OptimalityTolerance=1;
    }
     
    maximize
    B0*sum(i in 1..M)(
         1+P*sum(j in 1..M:j!=i)(
                 H[j][i]*Yji[j][i]/ //molecular
                   (n0+P*sum(n in 1..M:n!=j)
    (sum(q in 1..M)H[n][i]*Yji[n][q])
                   )//Denominator
               )     
       );
       
    subject to
    {
     
    forall(i in 1..M)
    {
     
    sum(j in 1..M)
    Yji[i][j]<=1;   
    }
     
    forall(i in 1..M)
    {
     
    sum(j in 1..M)
    Yji[j][i]<=1;   
    }
     
    forall(i in 1..M)
       forall(j in 1..M)
     
      Yji[i][j]==Yji[j][i];
     
    forall(i in 1..M)
     
      Yji[i][i]==0;
    }
     
    execute
    {
    writeln("Yji=",Yji);
    writeln("Objective= ",cp.getObjValue());
     
    }
     
     
    main
    {
    var nbsol=0;
    thisOplModel.generate();
    cp.startNewSearch();
    while(cp.next())
    {
    nbsol++;
    writeln("solution ",nbsol);
    thisOplModel.postProcess();
    }
    }
     

    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: How to use the cluster to compute the model

    Posted Fri November 16, 2018 03:20 AM


  • 3.  Re: How to use the cluster to compute the model

    Posted Mon November 19, 2018 05:24 AM

    Originally posted by: skyskyhuanghuang


    Thank you.But how do I build a cluster environment locally to calculate the model?I mean to calculate the same model with the cpu resources of the local four servers.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer