Originally posted by: qtbgo
Dear Alex, I tried your method, but get some confusing result.
Here is my "scalableWarehouseParallel.mod":
int n = ...;
int nbthreads = ...;
int Fixed = 400 + n;
int NbWarehouses = 400 ;
int NbStores = 800 + n;
assert( NbStores > NbWarehouses );
range Warehouses = 1..NbWarehouses;
range Stores = 1..NbStores;
int Capacity[w in Warehouses] =
NbStores div NbWarehouses +
w % ( NbStores div NbWarehouses );
int SupplyCost[s in Stores][w in Warehouses] =
1 + ( ( s + 10 * w ) % 100 );
dvar int Open[Warehouses] in 0..1;
dvar float Supply[Stores][Warehouses] in 0..1;
dexpr int TotalFixedCost = sum( w in Warehouses ) Fixed * Open[w];
dexpr float TotalSupplyCost = sum( w in Warehouses, s in Stores ) SupplyCost[s][w] * Supply[s][w];
minimize TotalFixedCost + TotalSupplyCost;
subject to {
forall( s in Stores )
ctStoreHasOneWarehouse:
sum( w in Warehouses )
Supply[s][w] == 1;
forall( w in Warehouses )
ctOpen:
sum( s in Stores )
Supply[s][w] <= Open[w] * Capacity[w];
}
and here is my main flow "parallelMain.mod":
range r=1..4;
main
{
var d=new Date();
writeln(d);
for(var i in thisOplModel.r)
{
writeln(i);
IloOplExec("C:\\IBM\\ILOG\\CPLEX_Studio128\\opl\\bin\\x64_win64\\oplrun.exe "+
" -D n=" + i + " -D nbthreads=1 D:\\1\\warehouse\\scalableWarehouseParallel.mod",false );
}
4
}
when I run parallelMain.mod, there is nothing in engine log, why? my machine has 2 cores.
#DecisionOptimization#OPLusingCPLEXOptimizer