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 if( *syncstore == NULL )
88 (*syncstore)->nuses -= 1;
89 references = (*syncstore)->nuses;
94 if( (*syncstore)->initialized )
99 assert(!(*syncstore)->initialized);
118 ++(syncstore->
nuses);
135 assert(scip != NULL);
137 assert(syncstore != NULL);
151 for( i = 0; i < syncstore->
nsyncdata; ++i )
153 syncstore->
syncdata[i].syncnum = -1;
159 for( j = 0; j < syncstore->
maxnsols; ++j )
197 assert(syncstore != NULL);
202 for( i = 0; i < syncstore->
nsyncdata; ++i )
210 for( j = 0; j < syncstore->
maxnsols; ++j )
262 assert(syncstore != NULL);
273 assert(syncstore != NULL);
284 assert(syncstore != NULL);
295 assert(syncstore != NULL);
306 assert(syncstore != NULL);
317 assert(syncstore != NULL);
334 assert(syncstore != NULL);
340 assert(syncstore->
syncdata[j].syncnum == syncnum);
358 assert(syncstore != NULL);
360 assert(delay != NULL);
362 if( syncdata == NULL )
371 nextsyncnum = syncdata->syncnum + 1;
374 if( nextsyncnum == writenum )
377 newdelay = *delay - syncfreq;
384 if( newdelay < syncstore->minsyncdelay && nextsyncnum >= writenum - syncstore->
maxnsyncdelay )
388 assert(syncstore->
syncdata[nextsyncnum % syncstore->
nsyncdata].syncnum == nextsyncnum);
400 assert(syncdata != NULL);
401 assert(syncstore != NULL);
407 while( syncdata->syncedcount < syncstore->
nsolvers )
433 assert(syncdata != NULL);
434 assert(syncstore != NULL);
444 *syncdata = &syncstore->
syncdata[i];
445 assert(*syncdata != NULL);
449 if( (*syncdata)->syncnum != syncnum )
452 (*syncdata)->nsols = 0;
454 (*syncdata)->syncedcount = 0;
456 (*syncdata)->bestlowerbound = -(*syncdata)->bestupperbound;
458 (*syncdata)->winner = 0;
459 (*syncdata)->syncnum = syncnum;
460 (*syncdata)->syncfreq = 0.0;
474 assert(syncdata != NULL);
475 assert((*syncdata) != NULL);
476 assert(syncstore != NULL);
479 ++(*syncdata)->syncedcount;
481 if( (*syncdata)->syncedcount == syncstore->
nsolvers )
509 assert(syncdata != NULL);
511 return syncdata->status;
519 assert(syncstore != NULL);
533 assert(syncdata != NULL);
535 return syncdata->syncedcount;
543 assert(syncstore != NULL);
555 assert(syncdata != NULL);
557 return syncdata->memtotal;
565 assert(syncdata != NULL);
567 return syncdata->syncfreq;
575 assert(syncdata != NULL);
577 return syncdata->bestupperbound;
585 assert(syncdata != NULL);
587 return syncdata->bestlowerbound;
598 assert(syncdata != NULL);
599 assert(solvalues != NULL);
600 assert(solowner != NULL);
601 assert(nsols != NULL);
603 *solvalues = syncdata->sols;
604 *solowner = syncdata->solsource;
605 *nsols = syncdata->nsols;
613 assert(syncdata != NULL);
615 return syncdata->boundstore;
625 assert(syncstore != NULL);
627 assert(syncdata != NULL);
629 syncdata->syncfreq = MIN(syncfreq, syncstore->
syncfreqmax);
639 assert(syncdata != NULL);
648 if( status > syncdata->status || (status == syncdata->status && solverid < syncdata->winner) )
650 syncdata->status = status;
651 syncdata->winner = solverid;
656 if( status < syncdata->status || (status == syncdata->status && solverid < syncdata->winner) )
658 syncdata->status = status;
659 syncdata->winner = solverid;
670 assert(syncdata != NULL);
672 syncdata->memtotal += memtotal;
681 assert(syncdata != NULL);
683 syncdata->bestupperbound = MIN(syncdata->bestupperbound, upperbound);
692 assert(syncdata != NULL);
694 syncdata->bestlowerbound =
MAX(syncdata->bestlowerbound, lowerbound);
712 assert(syncstore != NULL);
714 assert(syncdata != NULL);
715 assert(buffer != NULL);
717 for( pos = 0; pos < syncdata->nsols; ++pos )
719 if( syncdata->solobj[pos] < solobj || (syncdata->solobj[pos] == solobj && ownerid < syncdata->solsource[pos]) )
723 if( syncdata->nsols < syncstore->
maxnsols )
725 for( i = syncdata->nsols; i > pos; --i )
727 syncdata->solobj[i] = syncdata->solobj[i - 1];
728 syncdata->solsource[i] = syncdata->solsource[i - 1];
729 SCIPswapPointers((
void**) &syncdata->sols[i], (
void**) &syncdata->sols[i - 1]);
738 for( i = 0; i < pos; ++i )
740 syncdata->solobj[i] = syncdata->solobj[i + 1];
741 syncdata->solsource[i] = syncdata->solsource[i + 1];
742 SCIPswapPointers((
void**) &syncdata->sols[i], (
void**) &syncdata->sols[i + 1]);
748 syncdata->solobj[pos] = solobj;
749 syncdata->solsource[pos] = ownerid;
750 *buffer = syncdata->sols[pos];
765 assert(syncstore != NULL);
767 assert(syncdata != NULL);
768 assert(boundstore != NULL);
780 assert(syncstore != NULL);
790 assert(syncstore != NULL);
792 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