SCIP Doxygen Documentation
Loading...
Searching...
No Matches

Detailed Description

the type definitions for the SCIP parallel interface

Author
Leona Gottwald
Stephen J. Maher
Marc Pfetsch

Definition in file tpi.h.

#include "scip/def.h"
#include "scip/type_retcode.h"
#include "tpi/type_tpi.h"

Go to the source code of this file.

Functions

SCIP_RETCODE SCIPtpiInitLock (SCIP_LOCK **lock)
void SCIPtpiDestroyLock (SCIP_LOCK **lock)
SCIP_RETCODE SCIPtpiAcquireLock (SCIP_LOCK *lock)
SCIP_RETCODE SCIPtpiReleaseLock (SCIP_LOCK *lock)
SCIP_RETCODE SCIPtpiInitCondition (SCIP_CONDITION **condition)
void SCIPtpiDestroyCondition (SCIP_CONDITION **condition)
SCIP_RETCODE SCIPtpiSignalCondition (SCIP_CONDITION *condition)
SCIP_RETCODE SCIPtpiBroadcastCondition (SCIP_CONDITION *condition)
SCIP_RETCODE SCIPtpiWaitCondition (SCIP_CONDITION *condition, SCIP_LOCK *lock)
int SCIPtpiGetNumThreads (void)
int SCIPtpiGetThreadNum (void)
SCIP_RETCODE SCIPtpiCreateJob (SCIP_JOB **job, int jobid, SCIP_RETCODE(*jobfunc)(void *args), void *jobarg)
int SCIPtpiGetNewJobID (void)
SCIP_RETCODE SCIPtpiSubmitJob (SCIP_JOB *job, SCIP_SUBMITSTATUS *status)
SCIP_RETCODE SCIPtpiCollectJobs (int jobid)
SCIP_RETCODE SCIPtpiInit (int nthreads, int queuesize, SCIP_Bool blockwhenfull)
SCIP_RETCODE SCIPtpiExit (void)
SCIP_Bool SCIPtpiIsAvailable (void)
void SCIPtpiGetLibraryName (char *name, int namesize)
void SCIPtpiGetLibraryDesc (char *desc, int descsize)

Function Documentation

◆ SCIPtpiInitLock()

SCIP_RETCODE SCIPtpiInitLock ( SCIP_LOCK ** lock)

creates and initializes the given lock

initializes the given lock

Parameters
lockthe lock

Definition at line 45 of file tpi_none.c.

References assert(), BMSallocMemory, BMSfreeMemory, SCIP_JobQueues::lock, NULL, SCIP_ALLOC, SCIP_ERROR, SCIP_OKAY, and SCIPtpiInitLock().

Referenced by SCIPsyncstoreCreate(), SCIPsyncstoreInit(), and SCIPtpiInitLock().

◆ SCIPtpiDestroyLock()

void SCIPtpiDestroyLock ( SCIP_LOCK ** lock)

destroys and frees the given lock

destroys the given lock

Parameters
lockthe lock

Definition at line 56 of file tpi_none.c.

References assert(), BMSfreeMemory, SCIP_JobQueues::lock, NULL, and SCIPtpiDestroyLock().

Referenced by SCIPsyncstoreExit(), SCIPsyncstoreRelease(), and SCIPtpiDestroyLock().

◆ SCIPtpiAcquireLock()

◆ SCIPtpiReleaseLock()

◆ SCIPtpiInitCondition()

SCIP_RETCODE SCIPtpiInitCondition ( SCIP_CONDITION ** condition)

initializes the given condition variable

Parameters
conditioncondition to be created and initialized

Definition at line 87 of file tpi_none.c.

References assert(), BMSallocMemory, NULL, SCIP_ALLOC, SCIP_ERROR, SCIP_OKAY, and SCIPtpiInitCondition().

Referenced by SCIPsyncstoreInit(), and SCIPtpiInitCondition().

◆ SCIPtpiDestroyCondition()

void SCIPtpiDestroyCondition ( SCIP_CONDITION ** condition)

destroys the given condition variable

Parameters
conditioncondition to be destroyed and freed

Definition at line 98 of file tpi_none.c.

References assert(), BMSfreeMemory, NULL, and SCIPtpiDestroyCondition().

Referenced by SCIPsyncstoreExit(), and SCIPtpiDestroyCondition().

◆ SCIPtpiSignalCondition()

SCIP_RETCODE SCIPtpiSignalCondition ( SCIP_CONDITION * condition)

signals one waiting thread

Parameters
conditionthe condition variable to signal

Definition at line 107 of file tpi_none.c.

References assert(), SCIP_Condition::condition, NULL, SCIP_CALL, SCIP_ERROR, SCIP_OKAY, SCIPompAcquireLock, SCIPompReleaseLock, and SCIPtpiSignalCondition().

Referenced by SCIPtpiSignalCondition().

◆ SCIPtpiBroadcastCondition()

SCIP_RETCODE SCIPtpiBroadcastCondition ( SCIP_CONDITION * condition)

signals all waiting threads

Parameters
conditionthe condition variable to broadcast

Definition at line 115 of file tpi_none.c.

References assert(), SCIP_Condition::condition, NULL, SCIP_CALL, SCIP_ERROR, SCIP_OKAY, SCIPompAcquireLock, SCIPompReleaseLock, and SCIPtpiBroadcastCondition().

Referenced by executeJob(), SCIPsyncstoreFinishSync(), and SCIPtpiBroadcastCondition().

◆ SCIPtpiWaitCondition()

SCIP_RETCODE SCIPtpiWaitCondition ( SCIP_CONDITION * condition,
SCIP_LOCK * lock )

waits on a condition variable. The given lock must be held by the caller and will be held when this function returns.

Parameters
conditionthe condition variable to wait on
lockthe lock that is held by the caller

Definition at line 125 of file tpi_none.c.

References SCIP_Condition::condition, SCIP_JobQueues::lock, SCIP_Lock::lock, SCIP_CALL, SCIP_ERROR, SCIP_OKAY, SCIPompAcquireLock, SCIPompReleaseLock, SCIPtpiAcquireLock(), SCIPtpiReleaseLock(), and SCIPtpiWaitCondition().

Referenced by SCIPsyncstoreEnsureAllSynced(), and SCIPtpiWaitCondition().

◆ SCIPtpiGetNumThreads()

int SCIPtpiGetNumThreads ( void )

returns the number of threads

Definition at line 134 of file tpi_none.c.

References NULL, and SCIPtpiGetNumThreads().

Referenced by jobQueueAddJob(), jobQueueProcessJob(), SCIPtpiGetNumThreads(), and SCIPtpiGetNumThreads().

◆ SCIPtpiGetThreadNum()

int SCIPtpiGetThreadNum ( void )

returns the thread number

Definition at line 142 of file tpi_none.c.

References SCIPtpiGetThreadNum().

Referenced by applyBoundChanges(), executeJob(), SCIPtpiGetThreadNum(), and SCIPtpiGetThreadNum().

◆ SCIPtpiCreateJob()

SCIP_RETCODE SCIPtpiCreateJob ( SCIP_JOB ** job,
int jobid,
SCIP_RETCODE(* jobfunc )(void *args),
void * jobarg )

creates a job for parallel processing

Parameters
jobpointer to the job that will be created
jobidthe id for the current job
jobfuncpointer to the job function
jobargthe job's argument

Definition at line 156 of file tpi_none.c.

References BMSallocMemory, NULL, SCIP_ALLOC, SCIP_ERROR, SCIP_OKAY, SCIP_UNUSED, and SCIPtpiCreateJob().

Referenced by SCIPconcurrentSolve(), and SCIPtpiCreateJob().

◆ SCIPtpiGetNewJobID()

int SCIPtpiGetNewJobID ( void )

get a new job id for a new set of jobs

Definition at line 172 of file tpi_none.c.

References assert(), NULL, SCIP_CALL_ABORT, SCIPtnyAcquireLock, SCIPtnyReleaseLock, and SCIPtpiGetNewJobID().

Referenced by SCIPconcurrentSolve(), and SCIPtpiGetNewJobID().

◆ SCIPtpiSubmitJob()

SCIP_RETCODE SCIPtpiSubmitJob ( SCIP_JOB * job,
SCIP_SUBMITSTATUS * status )

submit a job for parallel processing; the return value is a globally defined status

Parameters
jobpointer to the job to be submitted
statuspointer to store the job's submit status

Definition at line 180 of file tpi_none.c.

References assert(), SCIP_Job::jobid, jobQueueAddJob(), NULL, SCIP_CALL, SCIP_ERROR, SCIP_OKAY, SCIP_SUBMIT_SUCCESS, SCIP_UNUSED, SCIPtpiSubmitJob(), and threadPoolAddWork().

Referenced by SCIPconcurrentSolve(), and SCIPtpiSubmitJob().

◆ SCIPtpiCollectJobs()

SCIP_RETCODE SCIPtpiCollectJobs ( int jobid)

blocks until all jobs of the given jobid have finished and then returns the smallest SCIP_RETCODE of all the jobs

Blocks until all jobs with the given jobid have finished and then returns the smallest SCIP_RETCODE of all the jobs

Parameters
jobidthe id of the jobs to collect

Definition at line 193 of file tpi_none.c.

References assert(), BMSfreeMemory, isJobRunning(), isJobWaiting(), SCIP_Job::jobid, MIN, SCIP_Job::nextjob, NULL, SCIP_Job::retcode, SCIP_CALL, SCIP_CALL_ABORT, SCIP_ERROR, SCIP_OKAY, SCIP_UNUSED, SCIPompAcquireLock, SCIPompReleaseLock, SCIPompWaitCondition(), SCIPtnyAcquireLock, SCIPtnyReleaseLock, SCIPtnyWaitCondition, and SCIPtpiCollectJobs().

Referenced by SCIPconcurrentSolve(), and SCIPtpiCollectJobs().

◆ SCIPtpiInit()

SCIP_RETCODE SCIPtpiInit ( int nthreads,
int queuesize,
SCIP_Bool blockwhenfull )

initializes tpi

Parameters
nthreadsthe number of threads to be used
queuesizethe size of the queue
blockwhenfullshould the queue block when full

Definition at line 203 of file tpi_none.c.

References assert(), createJobQueue(), createThreadPool(), SCIP_JobQueues::nthreads, NULL, SCIP_Bool, SCIP_CALL, SCIP_ERROR, SCIP_OKAY, SCIP_UNUSED, and SCIPtpiInit().

Referenced by SCIPsyncstoreInit(), and SCIPtpiInit().

◆ SCIPtpiExit()

SCIP_RETCODE SCIPtpiExit ( void )

deinitializes the tpi

Definition at line 217 of file tpi_none.c.

References assert(), freeJobQueue(), freeThreadPool(), NULL, SCIP_CALL, SCIP_ERROR, SCIP_OKAY, SCIPtpiExit(), and TRUE.

Referenced by SCIPsyncstoreExit(), and SCIPtpiExit().

◆ SCIPtpiIsAvailable()

SCIP_Bool SCIPtpiIsAvailable ( void )

indicate whether a working TPI is available

Definition at line 225 of file tpi_none.c.

References FALSE, SCIP_Bool, SCIPtpiIsAvailable(), and TRUE.

Referenced by doScipCreate(), SCIPsolveConcurrent(), and SCIPtpiIsAvailable().

◆ SCIPtpiGetLibraryName()

void SCIPtpiGetLibraryName ( char * name,
int namesize )

get name of library that the TPI interfaces to

Parameters
namebuffer to store name
namesizelength of name buffer

Definition at line 231 of file tpi_none.c.

References assert(), NULL, SCIPsnprintf(), and SCIPtpiGetLibraryName().

Referenced by doScipCreate(), and SCIPtpiGetLibraryName().

◆ SCIPtpiGetLibraryDesc()

void SCIPtpiGetLibraryDesc ( char * desc,
int descsize )

get description of library that the TPI interfaces to

Parameters
descbuffer to store description
descsizelength of description

Definition at line 242 of file tpi_none.c.

References assert(), NULL, SCIPsnprintf(), and SCIPtpiGetLibraryDesc().

Referenced by doScipCreate(), and SCIPtpiGetLibraryDesc().