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