112
112
#include "scip/tree.h"
113
113
#include "scip/var.h"
114
114
#include "scip/visual.h"
115
+ #include "tpi/tpi.h"
115
116
116
117
/** calculates number of nonzeros in problem */
117
118
static
@@ -2861,10 +2862,6 @@ SCIP_RETCODE SCIPsolveConcurrent(
2861
2862
SCIP * scip /**< SCIP data structure */
2862
2863
)
2863
2864
{
2864
- #ifdef TPI_NONE
2865
- SCIPerrorMessage ("SCIP was compiled without task processing interface. Concurrent solve not possible\n" );
2866
- return SCIP_PLUGINNOTFOUND ;
2867
- #else
2868
2865
SCIP_RETCODE retcode ;
2869
2866
int i ;
2870
2867
SCIP_RANDNUMGEN * rndgen ;
@@ -2873,7 +2870,13 @@ SCIP_RETCODE SCIPsolveConcurrent(
2873
2870
2874
2871
SCIP_CALL ( SCIPcheckStage (scip , "SCIPsolveConcurrent" , FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2875
2872
2876
- SCIP_CALL ( SCIPsetIntParam (scip , "timing/clocktype" , SCIP_CLOCKTYPE_WALL ) );
2873
+ if ( !SCIPtpiIsAvailable () )
2874
+ {
2875
+ SCIPerrorMessage ("SCIP was compiled without task processing interface. Concurrent solve not possible\n" );
2876
+ return SCIP_PLUGINNOTFOUND ;
2877
+ }
2878
+
2879
+ SCIP_CALL ( SCIPsetIntParam (scip , "timing/clocktype" , (int )SCIP_CLOCKTYPE_WALL ) );
2877
2880
2878
2881
minnthreads = scip -> set -> parallel_minnthreads ;
2879
2882
maxnthreads = scip -> set -> parallel_maxnthreads ;
@@ -2887,7 +2890,7 @@ SCIP_RETCODE SCIPsolveConcurrent(
2887
2890
{
2888
2891
int nconcsolvertypes ;
2889
2892
SCIP_CONCSOLVERTYPE * * concsolvertypes ;
2890
- SCIP_Longint nthreads ;
2893
+ int nthreads ;
2891
2894
SCIP_Real memorylimit ;
2892
2895
int * solvertypes ;
2893
2896
SCIP_Longint * weights ;
@@ -2933,8 +2936,8 @@ SCIP_RETCODE SCIPsolveConcurrent(
2933
2936
/* estimate maximum number of copies that be created based on memory limit */
2934
2937
if ( !scip -> set -> misc_avoidmemout )
2935
2938
{
2936
- nthreads = MAX (1 , memorylimit / (4.0 * SCIPgetMemExternEstim (scip )/1048576.0 ));
2937
- SCIPverbMessage (scip , SCIP_VERBLEVEL_FULL , NULL , "estimated a maximum of %lli threads based on memory limit\n" , nthreads );
2939
+ nthreads = MAX (1 , memorylimit / (4.0 * SCIPgetMemExternEstim (scip )/1048576.0 )); /*lint !e666 !e524*/
2940
+ SCIPverbMessage (scip , SCIP_VERBLEVEL_FULL , NULL , "estimated a maximum of %d threads based on memory limit\n" , nthreads );
2938
2941
}
2939
2942
else
2940
2943
{
@@ -2962,14 +2965,15 @@ SCIP_RETCODE SCIPsolveConcurrent(
2962
2965
return SCIPsolve (scip );
2963
2966
}
2964
2967
nthreads = MIN (nthreads , maxnthreads );
2965
- SCIPverbMessage (scip , SCIP_VERBLEVEL_FULL , NULL , "using %lli threads for concurrent solve\n" , nthreads );
2968
+ SCIPverbMessage (scip , SCIP_VERBLEVEL_FULL , NULL , "using %d threads for concurrent solve\n" , nthreads );
2966
2969
2967
2970
/* now set up nthreads many concurrent solvers that will be used for the concurrent solve
2968
2971
* using the preferred priorities of each concurrent solver
2969
2972
*/
2970
2973
prefpriosum = 0.0 ;
2971
2974
for ( i = 0 ; i < nconcsolvertypes ; ++ i )
2972
2975
prefpriosum += SCIPconcsolverTypeGetPrefPrio (concsolvertypes [i ]);
2976
+ assert (prefpriosum != 0.0 );
2973
2977
2974
2978
ncandsolvertypes = 0 ;
2975
2979
SCIP_CALL ( SCIPallocBufferArray (scip , & solvertypes , nthreads + nconcsolvertypes ) );
@@ -3005,7 +3009,7 @@ SCIP_RETCODE SCIPsolveConcurrent(
3005
3009
3006
3010
SCIP_CALL ( SCIPconcsolverCreateInstance (scip -> set , concsolvertypes [solvertypes [i ]], & concsolver ) );
3007
3011
if ( scip -> set -> concurrent_changeseeds && SCIPgetNConcurrentSolvers (scip ) > 1 )
3008
- SCIP_CALL ( SCIPconcsolverInitSeeds (concsolver , SCIPrandomGetInt (rndgen , 0 , INT_MAX )) );
3012
+ SCIP_CALL ( SCIPconcsolverInitSeeds (concsolver , ( unsigned int ) SCIPrandomGetInt (rndgen , 0 , INT_MAX )) );
3009
3013
}
3010
3014
SCIPfreeRandom (scip , & rndgen );
3011
3015
SCIPfreeBufferArray (scip , & prios );
@@ -3029,7 +3033,6 @@ SCIP_RETCODE SCIPsolveConcurrent(
3029
3033
SCIP_CALL ( displayRelevantStats (scip ) );
3030
3034
3031
3035
return retcode ;
3032
- #endif
3033
3036
}
3034
3037
3035
3038
/** include specific heuristics and branching rules for reoptimization
0 commit comments