Scippy

SCIP

Solving Constraint Integer Programs

tpi.h File Reference

Detailed Description

the type definitions for the SCIP parallel interface

Author
Robert Lion Gottwald
Stephen J. Maher

Definition in file tpi.h.

#include "scip/def.h"
#include "scip/pub_message.h"
#include "tpi/def_openmp.h"
#include "tpi/type_tpi.h"
#include "tpi/tpi_openmp.h"
#include "tpi/tpi_tnycthrd.h"
#include "tpi/tpi_none.h"

Go to the source code of this file.

Functions

SCIP_EXPORT SCIP_RETCODE SCIPtpiInitLock (SCIP_LOCK *lock)
 
SCIP_EXPORT void SCIPtpiDestroyLock (SCIP_LOCK *lock)
 
SCIP_EXPORT SCIP_RETCODE SCIPtpiAcquireLock (SCIP_LOCK *lock)
 
SCIP_EXPORT SCIP_RETCODE SCIPtpiReleaseLock (SCIP_LOCK *lock)
 
SCIP_EXPORT SCIP_RETCODE SCIPtpiInitCondition (SCIP_LOCK *lock)
 
SCIP_EXPORT void SCIPtpiDestroyCondition (SCIP_LOCK *lock)
 
SCIP_EXPORT SCIP_RETCODE SCIPtpiSignalCondition (SCIP_CONDITION *condition)
 
SCIP_EXPORT SCIP_RETCODE SCIPtpiBroadcastCondition (SCIP_CONDITION *condition)
 
SCIP_EXPORT SCIP_RETCODE SCIPtpiWaitCondition (SCIP_CONDITION *condition, SCIP_LOCK *lock)
 
SCIP_EXPORT int SCIPtpiGetNumThreads (void)
 
SCIP_EXPORT int SCIPtpiGetThreadNum (void)
 
SCIP_EXPORT SCIP_RETCODE SCIPtpiCreateJob (SCIP_JOB **job, int jobid, SCIP_RETCODE(*jobfunc)(void *args), void *jobarg)
 
SCIP_EXPORT int SCIPtpiGetNewJobID (void)
 
SCIP_EXPORT SCIP_RETCODE SCIPtpiSumbitJob (SCIP_JOB *job, SCIP_SUBMITSTATUS *status)
 
SCIP_EXPORT SCIP_RETCODE SCIPtpiCollectJobs (int jobid)
 
SCIP_EXPORT SCIP_RETCODE SCIPtpiInit (int nthreads, int queuesize, SCIP_Bool blockwhenfull)
 
SCIP_EXPORT SCIP_RETCODE SCIPtpiExit (void)
 

Function Documentation

◆ SCIPtpiInitLock()

SCIP_EXPORT SCIP_RETCODE SCIPtpiInitLock ( SCIP_LOCK *  lock)

initializes the given lock

Parameters
lockthe lock

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

◆ SCIPtpiDestroyLock()

SCIP_EXPORT void SCIPtpiDestroyLock ( SCIP_LOCK *  lock)

destroys the given lock

Parameters
lockthe lock

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

◆ SCIPtpiAcquireLock()

◆ SCIPtpiReleaseLock()

◆ SCIPtpiInitCondition()

SCIP_EXPORT SCIP_RETCODE SCIPtpiInitCondition ( SCIP_LOCK *  lock)

initializes the given condition variable

Parameters
lockthe lock

Referenced by createThreadPool(), and SCIPsyncstoreInit().

◆ SCIPtpiDestroyCondition()

SCIP_EXPORT void SCIPtpiDestroyCondition ( SCIP_LOCK *  lock)

destroys the given condition variable

Parameters
lockthe lock

Referenced by freeThreadPool(), and SCIPsyncstoreExit().

◆ SCIPtpiSignalCondition()

SCIP_EXPORT SCIP_RETCODE SCIPtpiSignalCondition ( SCIP_CONDITION *  condition)

signals one waiting thread

Parameters
conditionthe condition variable to signal

Definition at line 261 of file tpi_openmp.c.

References SCIP_CALL, SCIP_OKAY, SCIPtpiAcquireLock(), and SCIPtpiReleaseLock().

Referenced by jobQueueAddJob().

◆ SCIPtpiBroadcastCondition()

SCIP_EXPORT SCIP_RETCODE SCIPtpiBroadcastCondition ( SCIP_CONDITION *  condition)

signals all waiting threads

Parameters
conditionthe condition variable to broadcast

Definition at line 275 of file tpi_openmp.c.

References SCIP_CALL, SCIP_OKAY, SCIPtpiAcquireLock(), and SCIPtpiReleaseLock().

Referenced by freeThreadPool(), and SCIPsyncstoreFinishSync().

◆ SCIPtpiWaitCondition()

SCIP_EXPORT 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 287 of file tpi_openmp.c.

References SCIP_CALL, SCIP_OKAY, SCIPtpiAcquireLock(), and SCIPtpiReleaseLock().

Referenced by freeThreadPool(), and SCIPsyncstoreEnsureAllSynced().

◆ SCIPtpiGetNumThreads()

SCIP_EXPORT int SCIPtpiGetNumThreads ( void  )

returns the number of threads

Returns the number of threads

Definition at line 325 of file tpi_openmp.c.

◆ SCIPtpiGetThreadNum()

SCIP_EXPORT int SCIPtpiGetThreadNum ( void  )

returns the thread number

Returns the thread number

Definition at line 332 of file tpi_openmp.c.

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

◆ SCIPtpiCreateJob()

SCIP_EXPORT SCIP_RETCODE SCIPtpiCreateJob ( SCIP_JOB **  job,
int  jobid,
SCIP_RETCODE(*)(void *args)  jobfunc,
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 28 of file tpi_none.c.

References BMSallocMemory, SCIP_Job::jobfunc, SCIP_Job::jobid, NULL, SCIP_ALLOC, SCIP_ERROR, SCIP_OKAY, and SCIP_UNUSED.

Referenced by SCIPconcurrentSolve().

◆ SCIPtpiGetNewJobID()

SCIP_EXPORT int SCIPtpiGetNewJobID ( void  )

get a new job id for a new set of jobs

get a new job id for the new set of submitted jobs

Definition at line 357 of file tpi_openmp.c.

References SCIP_Job::jobid.

Referenced by SCIPconcurrentSolve().

◆ SCIPtpiSumbitJob()

SCIP_EXPORT SCIP_RETCODE SCIPtpiSumbitJob ( SCIP_JOB job,
SCIP_SUBMITSTATUS status 
)

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

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

Definition at line 44 of file tpi_none.c.

References SCIP_Job::jobid, NULL, SCIP_ERROR, and SCIP_UNUSED.

Referenced by SCIPconcurrentSolve().

◆ SCIPtpiCollectJobs()

SCIP_EXPORT 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

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

Parameters
jobidthe jobid of the jobs to wait for

Definition at line 57 of file tpi_none.c.

References SCIP_Job::retcode, SCIP_CALL, SCIP_ERROR, SCIP_OKAY, SCIP_UNUSED, and SCIPtpiAcquireLock().

Referenced by SCIPconcurrentSolve().

◆ SCIPtpiInit()

SCIP_EXPORT 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 67 of file tpi_none.c.

References SCIP_ERROR, and SCIP_UNUSED.

Referenced by SCIPsyncstoreInit().

◆ SCIPtpiExit()

SCIP_EXPORT SCIP_RETCODE SCIPtpiExit ( void  )

deinitializes the tpi

deinitializes tpi

Definition at line 81 of file tpi_none.c.

References SCIP_ERROR.

Referenced by SCIPsyncstoreExit().