Originally posted by: 88Simon88
Dear Alex,
I am running the following model:
Parallel_Solving.mod
int n=...;
int nbthreads=...;
int Fixed = 30+n;
int NbWarehouses = 4;
int NbStores = 10+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];
}
execute
{
var o = new IloOplOutputFile("c:\\res"+n+".txt");
date = new Date();
o.writeln(date);
o.writeln(Open);
o.close();
}
and I also have
main.mod
range r = 1..2;
execute
{
d = new Date();
writeln(d);
for(i in r)
{
writeln(i);
IloOplExec("C:\\Program Files\\IBM\\ILOG\\CPLEX_Studio128\\opl\\bin\\x64_win64\\oplrun.exe "+
" -Dn="+i+" -Dnbthreads=1 C:\\Users\\AN84860\\opl\\Parallel_Solving\\Parallel_Solving.mod",false );
}
}
This the result in the scripting log:
04/02/2019 13:42:03 948
1
2
It takes less than a second.
Why? where are the results of the models? Note that there is no text file for the results.
Regards
#DecisionOptimization#OPLusingCPLEXOptimizer