Hi all,
I have tried to set different threads for CPLEX solver to facilitate my computation, but weirdly, different threads gave different final results. Based on my knowledge, setting threads will only influence the speed because it is for parallel computing, but will not have any impact on the execution results. I state my program as follows:
Each iteration runs a MIQCP problem (obtain UB) and a MILP problem (obtain LB). The maximum iteration limit is 10. I also set a convergence criterion (UB-LB)/UB<1e-2 at 16th iteration. The following are the three reports of results based on different thread settings.
First: option threads = 8;
---- 809 PARAMETER LB
1 5965.400, 2 49104.258, 3 53720.551, 4 58302.189, 5 58786.475
---- 809 PARAMETER UB
1 589447.897, 2 589447.897, 3 444602.048, 4 134614.155
At iteration 5, it terminated with an error (UB=0) when calculating the convergence criterion (UB-LB)/UB<1e-2.
elapsed time: 2min42sec
Second: option threads = 4;
---- 809 PARAMETER LB
1 5965.400, 2 50115.912, 3 53957.301, 4 56612.179, 5 58400.315
6 59126.019, 7 59962.922, 8 59261.724, 9 59705.817, 10 59691.876
---- 809 PARAMETER UB
1 589447.897, 2 589447.897, 3 418927.137, 4 418927.137
5 134227.995, 6 108560.247, 7 108560.247, 8 107887.845
9 60539.785, 10 60539.785
elapsed time:
Third: option threads = 1;
---- 809 PARAMETER LB
1 5965.400, 2 52546.437, 3 55356.249, 4 59074.509, 5 58976.462
6 59126.019, 7 59323.676, 8 59126.019, 9 59705.414, 10 59261.724
---- 809 PARAMETER UB
1 589447.897, 2 589447.897, 3 461349.575, 4 61684.534, 5 61684.534
6 61684.534, 7 61684.534, 8 61684.534, 9 61684.534
elapsed time: 6min37sec
I did not use GUSS or other advanced tools, just regular coding. Any idea about the treads issue? Which one should I trust as the true results? Thanks in advance!
Gabriel