Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v9-minor'
Browse files Browse the repository at this point in the history
  • Loading branch information
scip-ci committed Sep 24, 2024
2 parents 3d1036b + 831aeb9 commit 9511b02
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ Known bugs
Features
--------

- added check for absolute and relative gap limits at end of synchronization in concurrent solving mode, in order to terminate earlier;
note that if the concurrent solve is stopped due to a gap limit, the "winner" solver will have an interrupted solution status and
its primal and dual bounds may not be the best possible ones (use SCIPgetConcurrentPrimalbound() and SCIPgetConcurrentDualbound() instead)

Performance improvements
------------------------

Expand Down
2 changes: 2 additions & 0 deletions src/scip/struct_syncstore.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ struct SCIP_SyncStore
* by all threads */

SCIP* mainscip; /**< the SCIP instance that was used for initializing the syncstore */
SCIP_Real limit_gap; /**< relative gap limit in main SCIP */
SCIP_Real limit_absgap; /**< absolute gap limit in main SCIP */
SCIP_Bool stopped; /**< flag to indicate if the solving is stopped */
SCIP_LOCK* lock; /**< lock to protect the syncstore data structure from data races */

Expand Down
6 changes: 5 additions & 1 deletion src/scip/syncstore.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ SCIP_RETCODE SCIPsyncstoreInit(
syncstore = SCIPgetSyncstore(scip);
assert(syncstore != NULL);
syncstore->mainscip = scip;
SCIP_CALL( SCIPgetRealParam(scip, "limits/gap", &syncstore->limit_gap) );
SCIP_CALL( SCIPgetRealParam(scip, "limits/absgap", &syncstore->limit_absgap) );
syncstore->lastsync = NULL;
syncstore->nsolvers = SCIPgetNConcurrentSolvers(scip);

Expand Down Expand Up @@ -492,7 +494,9 @@ SCIP_RETCODE SCIPsyncstoreFinishSync(

if( (*syncdata)->syncedcount == syncstore->nsolvers )
{
if( (*syncdata)->status != SCIP_STATUS_UNKNOWN )
if( (*syncdata)->status != SCIP_STATUS_UNKNOWN ||
(SCIPgetConcurrentGap(syncstore->mainscip) <= syncstore->limit_gap) ||
(SCIPgetConcurrentPrimalbound(syncstore->mainscip) - SCIPgetConcurrentDualbound(syncstore->mainscip) <= syncstore->limit_absgap) )
SCIPsyncstoreSetSolveIsStopped(syncstore, TRUE);

syncstore->lastsync = *syncdata;
Expand Down

0 comments on commit 9511b02

Please sign in to comment.