Originally posted by: SystemAdmin
Hi all, I have a question about using cplex parallel mode, may I have some help?
Since I am running a network design MIP problem in a large instance, I want to try to turn on the cplex parallel mode to let it run faster. I read the manual and wrote the following code to let cplex can use maximum number of threads (opportunistic). (My computer has 4 cores) But from the output, it shows that cplex still use only one threads. Can anyone give me some help about this? Thank you very much!
model.add(IloMinimize(env, obj));
IloCplex cplex(env);
cplex.extract(model);
cout<<"The original parallel mode parameter is: "<<cplex.getParam(IloCplex::ParallelMode)<<endl;
cout<<"The original thread parameter is: "<<cplex.getParam(IloCplex::Threads)<<endl;
cplex.setParam(IloCplex::ParallelMode, -1);
cplex.setParam(IloCplex::Threads, 0);
cout<<"The updated parallel mode parameter is: "<<cplex.getParam(IloCplex::ParallelMode)<<endl;
cout<<"The updated thread parameter is: "<<cplex.getParam(IloCplex::Threads)<<endl;
The output is:
The original parallel mode parameter is: 0
The original thread parameter is: 0
The updated parallel mode parameter is: -1
The updated thread parameter is: 0
Tried aggregator 3 times.
MIP Presolve eliminated 47810 rows and 20159 columns.
MIP Presolve modified 1810 coefficients.
Aggregator did 1929 substitutions.
Reduced MIP has 77949 rows, 42984 columns, and 282597 nonzeros.
Presolve time = 2.03 sec.
Clique table members: 67524.
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: none, using 1 thread.
Root relaxation solution time = 6.74 sec.
From the last second line of output, we can see that cplex still use one threads.
#CPLEXOptimizers#DecisionOptimization