Hi everyone,
I recently set up a Cplex sequential model that calls data from a database, does an annual optimization and publishes in the database when it's over. So I have a main.mod that iterates over the years :
main {
var source = new IloOplModelSource("MyModel.mod");
var cplex = new IloCplex();
var def = new IloOplModelDefinition(source);
for(var k=2023;k<=2024;k++)
{
var opl = new IloOplModel(def,cplex);
var dataParam= new IloOplDataElements();
dataParam.ResolutionYear=k;
opl.addDataSource(dataParam);
writeln("ResolutionYear : " + dataParam.ResolutionYear);
var data = new IloOplDataSource("Parameters.dat");
var data2 = new IloOplDataSource("LectureBD.dat");
var data3 = new IloOplDataSource("PublicationBD.dat");
opl.addDataSource(data);
opl.addDataSource(data2);
opl.addDataSource(data3);
opl.generate();
if (cplex.solve()) {
opl.postProcess();
writeln("OBJ = " + cplex.getObjValue());
} else {
writeln("No solution");
}
opl.end();
}
}
Now, in order to reduce the computation time, I would like to run the annual optimization in parallel. I've read this thread (https://community.ibm.com/community/user/ai-datascience/discussion/how-to-call-many-models-in-parallel-thanks-to-ilooplexec) about using the command IloOplExec() but I don't manage to include it to my main.mod. I think that all the problem revolves around the fact that the parameter "ResolutionYear" is used in the "LectureBD.dat" (to read the data from the database") but I didn't manage to make solve that problem.
Does anyone have an idea that could solve my issue ?
Thank you for your help
------------------------------
Grégoire Turzo
------------------------------