52 return 2 * (maxnsyncdelay + 1);
60 assert(syncstore !=
NULL);
67 (*syncstore)->initialized =
FALSE;
68 (*syncstore)->syncdata =
NULL;
69 (*syncstore)->stopped =
FALSE;
70 (*syncstore)->nuses = 1;
83 assert(syncstore !=
NULL);
84 assert(*syncstore !=
NULL);
87 (*syncstore)->nuses -= 1;
88 references = (*syncstore)->nuses;
93 if( (*syncstore)->initialized )
98 assert(!(*syncstore)->initialized);
117 ++(syncstore->
nuses);
134 assert(scip !=
NULL);
136 assert(syncstore !=
NULL);
150 for( i = 0; i < syncstore->
nsyncdata; ++i )
152 syncstore->
syncdata[i].syncnum = -1;
158 for( j = 0; j < syncstore->
maxnsols; ++j )
196 assert(syncstore !=
NULL);
201 for( i = 0; i < syncstore->
nsyncdata; ++i )
209 for( j = 0; j < syncstore->
maxnsols; ++j )
261 assert(syncstore !=
NULL);
272 assert(syncstore !=
NULL);
283 assert(syncstore !=
NULL);
294 assert(syncstore !=
NULL);
305 assert(syncstore !=
NULL);
316 assert(syncstore !=
NULL);
333 assert(syncstore !=
NULL);
339 assert(syncstore->
syncdata[j].syncnum == syncnum);
357 assert(syncstore !=
NULL);
359 assert(delay !=
NULL);
361 if( syncdata ==
NULL )
370 nextsyncnum = syncdata->syncnum + 1;
373 if( nextsyncnum == writenum )
376 newdelay = *delay - syncfreq;
383 if( newdelay < syncstore->minsyncdelay && nextsyncnum >= writenum - syncstore->
maxnsyncdelay )
387 assert(syncstore->
syncdata[nextsyncnum % syncstore->
nsyncdata].syncnum == nextsyncnum);
399 assert(syncdata !=
NULL);
400 assert(syncstore !=
NULL);
406 while( syncdata->syncedcount < syncstore->
nsolvers )
432 assert(syncdata !=
NULL);
433 assert(syncstore !=
NULL);
443 *syncdata = &syncstore->
syncdata[i];
444 assert(*syncdata !=
NULL);
448 if( (*syncdata)->syncnum != syncnum )
451 (*syncdata)->nsols = 0;
453 (*syncdata)->syncedcount = 0;
455 (*syncdata)->bestlowerbound = -(*syncdata)->bestupperbound;
457 (*syncdata)->winner = 0;
458 (*syncdata)->syncnum = syncnum;
459 (*syncdata)->syncfreq = 0.0;
473 assert(syncdata !=
NULL);
474 assert((*syncdata) !=
NULL);
475 assert(syncstore !=
NULL);
478 ++(*syncdata)->syncedcount;
480 if( (*syncdata)->syncedcount == syncstore->
nsolvers )
508 assert(syncdata !=
NULL);
510 return syncdata->status;
518 assert(syncstore !=
NULL);
532 assert(syncdata !=
NULL);
534 return syncdata->syncedcount;
542 assert(syncstore !=
NULL);
554 assert(syncdata !=
NULL);
556 return syncdata->memtotal;
564 assert(syncdata !=
NULL);
566 return syncdata->syncfreq;
574 assert(syncdata !=
NULL);
576 return syncdata->bestupperbound;
584 assert(syncdata !=
NULL);
586 return syncdata->bestlowerbound;
597 assert(syncdata !=
NULL);
598 assert(solvalues !=
NULL);
599 assert(solowner !=
NULL);
600 assert(nsols !=
NULL);
602 *solvalues = syncdata->sols;
603 *solowner = syncdata->solsource;
604 *nsols = syncdata->nsols;
612 assert(syncdata !=
NULL);
614 return syncdata->boundstore;
624 assert(syncstore !=
NULL);
626 assert(syncdata !=
NULL);
638 assert(syncdata !=
NULL);
647 if( status > syncdata->status || (status == syncdata->status && solverid < syncdata->winner) )
649 syncdata->status = status;
650 syncdata->winner = solverid;
655 if( status < syncdata->status || (status == syncdata->status && solverid < syncdata->winner) )
657 syncdata->status = status;
658 syncdata->winner = solverid;
669 assert(syncdata !=
NULL);
671 syncdata->memtotal += memtotal;
680 assert(syncdata !=
NULL);
682 syncdata->bestupperbound =
MIN(syncdata->bestupperbound, upperbound);
691 assert(syncdata !=
NULL);
693 syncdata->bestlowerbound =
MAX(syncdata->bestlowerbound, lowerbound);
711 assert(syncstore !=
NULL);
713 assert(syncdata !=
NULL);
714 assert(buffer !=
NULL);
716 for( pos = 0; pos < syncdata->nsols; ++pos )
718 if( syncdata->solobj[pos] < solobj || (syncdata->solobj[pos] == solobj && ownerid < syncdata->solsource[pos]) )
722 if( syncdata->nsols < syncstore->
maxnsols )
724 for( i = syncdata->nsols; i > pos; --i )
726 syncdata->solobj[i] = syncdata->solobj[i - 1];
727 syncdata->solsource[i] = syncdata->solsource[i - 1];
728 SCIPswapPointers((
void**) &syncdata->sols[i], (
void**) &syncdata->sols[i - 1]);
737 for( i = 0; i < pos; ++i )
739 syncdata->solobj[i] = syncdata->solobj[i + 1];
740 syncdata->solsource[i] = syncdata->solsource[i + 1];
741 SCIPswapPointers((
void**) &syncdata->sols[i], (
void**) &syncdata->sols[i + 1]);
747 syncdata->solobj[pos] = solobj;
748 syncdata->solsource[pos] = ownerid;
749 *buffer = syncdata->sols[pos];
764 assert(syncstore !=
NULL);
766 assert(syncdata !=
NULL);
767 assert(boundstore !=
NULL);
779 assert(syncstore !=
NULL);
789 assert(syncstore !=
NULL);
791 return syncstore->
mode;
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
SCIP_RETCODE SCIPtpiWaitCondition(SCIP_CONDITION *condition, SCIP_LOCK *lock)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
SCIP_RETCODE SCIPsyncstoreRelease(SCIP_SYNCSTORE **syncstore)
int SCIPboundstoreGetNChgs(SCIP_BOUNDSTORE *boundstore)
int SCIPgetNConcurrentSolvers(SCIP *scip)
SCIP_RETCODE SCIPsyncstoreEnsureAllSynced(SCIP_SYNCSTORE *syncstore, SCIP_SYNCDATA *syncdata)
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
SCIP_STATUS SCIPsyncdataGetStatus(SCIP_SYNCDATA *syncdata)
void SCIPsyncdataSetUpperbound(SCIP_SYNCDATA *syncdata, SCIP_Real upperbound)
SCIP_SYNCDATA * SCIPsyncstoreGetSyncdata(SCIP_SYNCSTORE *syncstore, SCIP_Longint syncnum)
SCIP_RETCODE SCIPprintDisplayLine(SCIP *scip, FILE *file, SCIP_VERBLEVEL verblevel, SCIP_Bool endline)
void SCIPswapPointers(void **pointer1, void **pointer2)
SCIP_Real SCIPinfinity(SCIP *scip)
void SCIPsyncdataSetLowerbound(SCIP_SYNCDATA *syncdata, SCIP_Real lowerbound)
enum SCIP_Retcode SCIP_RETCODE
SCIP_RETCODE SCIPtpiBroadcastCondition(SCIP_CONDITION *condition)
SCIP_RETCODE SCIPtpiAcquireLock(SCIP_LOCK *lock)
SCIP_Longint SCIPgetNNZs(SCIP *scip)
datastructures for concurrent solvers
SCIP_RETCODE SCIPtpiInitCondition(SCIP_LOCK *lock)
datastructures for concurrent solvers
static int getNSyncdata(SCIP *scip)
the struct definitions for the synchronization store
#define BMSfreeMemory(ptr)
SCIP_Real SCIPsyncstoreGetLastUpperbound(SCIP_SYNCSTORE *syncstore)
SCIP_SYNCDATA * SCIPsyncstoreGetNextSyncdata(SCIP_SYNCSTORE *syncstore, SCIP_SYNCDATA *syncdata, SCIP_Real syncfreq, SCIP_Longint writenum, SCIP_Real *delay)
void SCIPsyncdataGetSolutionBuffer(SCIP_SYNCSTORE *syncstore, SCIP_SYNCDATA *syncdata, SCIP_Real solobj, int ownerid, SCIP_Real **buffer)
SCIP_PARALLELMODE SCIPsyncstoreGetMode(SCIP_SYNCSTORE *syncstore)
void SCIPsyncdataSetSyncFreq(SCIP_SYNCSTORE *syncstore, SCIP_SYNCDATA *syncdata, SCIP_Real syncfreq)
SCIP_RETCODE SCIPtpiReleaseLock(SCIP_LOCK *lock)
internal methods for storing and manipulating the main problem
SCIP_Real SCIPsyncstoreGetLastLowerbound(SCIP_SYNCSTORE *syncstore)
SCIP_Bool SCIPsyncstoreIsInitialized(SCIP_SYNCSTORE *syncstore)
void SCIPboundstoreFree(SCIP *scip, SCIP_BOUNDSTORE **boundstore)
the type definitions for the SCIP parallel interface
void SCIPsyncdataSetStatus(SCIP_SYNCDATA *syncdata, SCIP_STATUS status, int solverid)
struct SCIP_SyncData SCIP_SYNCDATA
the interface of the boundstore structure
SCIP_RETCODE SCIPgetIntParam(SCIP *scip, const char *name, int *value)
SCIP_Real SCIPsyncstoreGetLastSyncfreq(SCIP_SYNCSTORE *syncstore)
the function declarations for the synchronization store
SCIP_RETCODE SCIPtpiExit(void)
void SCIPsyncdataAddMemTotal(SCIP_SYNCDATA *syncdata, SCIP_Longint memtotal)
enum SCIP_Status SCIP_STATUS
SCIP_RETCODE SCIPautoselectDisps(SCIP *scip)
SCIP_SYNCSTORE * SCIPgetSyncstore(SCIP *scip)
SCIP_RETCODE SCIPtpiInitLock(SCIP_LOCK *lock)
SCIP_RETCODE SCIPsyncstoreInit(SCIP *scip)
SCIP_Real SCIPsyncdataGetLowerbound(SCIP_SYNCDATA *syncdata)
enum SCIP_Parallelmode SCIP_PARALLELMODE
SCIP_RETCODE SCIPsyncstoreStartSync(SCIP_SYNCSTORE *syncstore, SCIP_Longint syncnum, SCIP_SYNCDATA **syncdata)
SCIP_Longint SCIPsyncdataGetMemTotal(SCIP_SYNCDATA *syncdata)
SCIP_Longint SCIPsyncstoreGetLastMemTotal(SCIP_SYNCSTORE *syncstore)
int SCIPsyncstoreGetWinner(SCIP_SYNCSTORE *syncstore)
helper functions for concurrent scip solvers
int SCIPgetNVars(SCIP *scip)
SCIP_RETCODE SCIPsyncstoreExit(SCIP_SYNCSTORE *syncstore)
SCIP_RETCODE SCIPsyncstoreCreate(SCIP_SYNCSTORE **syncstore)
int SCIPsyncdataGetNSynced(SCIP_SYNCDATA *syncdata)
int SCIPsyncstoreGetLastNSols(SCIP_SYNCSTORE *syncstore)
SCIP_Longint SCIPgetMemTotal(SCIP *scip)
void SCIPtpiDestroyLock(SCIP_LOCK *lock)
void SCIPtpiDestroyCondition(SCIP_LOCK *lock)
SCIP_BOUNDSTORE * SCIPsyncdataGetBoundChgs(SCIP_SYNCDATA *syncdata)
void SCIPsyncstoreSetSolveIsStopped(SCIP_SYNCSTORE *syncstore, SCIP_Bool stopped)
public methods for message output
SCIP_Real SCIPsyncdataGetSyncFreq(SCIP_SYNCDATA *syncdata)
#define BMSallocMemory(ptr)
SCIP_Bool SCIPsyncstoreSolveIsStopped(SCIP_SYNCSTORE *syncstore)
SCIP_RETCODE SCIPboundstoreCreate(SCIP *scip, SCIP_BOUNDSTORE **boundstore, int nvars)
SCIP_RETCODE SCIPsyncstoreFinishSync(SCIP_SYNCSTORE *syncstore, SCIP_SYNCDATA **syncdata)
SCIP_RETCODE SCIPboundstoreMerge(SCIP *scip, SCIP_BOUNDSTORE *target, SCIP_BOUNDSTORE *source)
SCIP_RETCODE SCIPsyncstoreCapture(SCIP_SYNCSTORE *syncstore)
int SCIPsyncstoreGetLastNBounds(SCIP_SYNCSTORE *syncstore)
common defines and data types used in all packages of SCIP
SCIP_RETCODE SCIPtpiInit(int nthreads, int queuesize, SCIP_Bool blockwhenfull)
#define SCIP_CALL_ABORT(x)
SCIP_Real SCIPsyncdataGetUpperbound(SCIP_SYNCDATA *syncdata)
int SCIPsyncstoreGetNSolvers(SCIP_SYNCSTORE *syncstore)
SCIP_RETCODE SCIPsyncdataAddBoundChanges(SCIP_SYNCSTORE *syncstore, SCIP_SYNCDATA *syncdata, SCIP_BOUNDSTORE *boundstore)
void SCIPsyncdataGetSolutions(SCIP_SYNCDATA *syncdata, SCIP_Real ***solvalues, int **solowner, int *nsols)
void SCIPboundstoreClear(SCIP_BOUNDSTORE *boundstore)
memory allocation routines