the type definitions for the SCIP parallel interface
Definition in file tpi.h.
#include "scip/def.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_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_LOCK *lock) |
void | SCIPtpiDestroyCondition (SCIP_LOCK *lock) |
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 | SCIPtpiSumbitJob (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_RETCODE SCIPtpiInitLock | ( | SCIP_LOCK * | lock | ) |
initializes the given lock
lock | the lock |
Referenced by createThreadPool(), SCIPsyncstoreCreate(), and SCIPsyncstoreInit().
void SCIPtpiDestroyLock | ( | SCIP_LOCK * | lock | ) |
destroys the given lock
lock | the lock |
Referenced by freeThreadPool(), SCIPsyncstoreExit(), and SCIPsyncstoreRelease().
SCIP_RETCODE SCIPtpiAcquireLock | ( | SCIP_LOCK * | lock | ) |
acquires the given lock
lock | the lock |
Referenced by executeJob(), freeThreadPool(), jobQueueAddJob(), jobQueueProcessJob(), SCIPsyncstoreCapture(), SCIPsyncstoreEnsureAllSynced(), SCIPsyncstoreRelease(), SCIPsyncstoreSetSolveIsStopped(), SCIPsyncstoreSolveIsStopped(), SCIPsyncstoreStartSync(), SCIPtpiBroadcastCondition(), SCIPtpiCollectJobs(), SCIPtpiSignalCondition(), and SCIPtpiWaitCondition().
SCIP_RETCODE SCIPtpiReleaseLock | ( | SCIP_LOCK * | lock | ) |
releases the given lock
lock | the lock |
Referenced by freeThreadPool(), SCIPsyncstoreCapture(), SCIPsyncstoreEnsureAllSynced(), SCIPsyncstoreFinishSync(), SCIPsyncstoreRelease(), SCIPsyncstoreSetSolveIsStopped(), SCIPsyncstoreSolveIsStopped(), SCIPtpiBroadcastCondition(), SCIPtpiSignalCondition(), and SCIPtpiWaitCondition().
SCIP_RETCODE SCIPtpiInitCondition | ( | SCIP_LOCK * | lock | ) |
initializes the given condition variable
lock | the lock |
Referenced by createThreadPool(), and SCIPsyncstoreInit().
void SCIPtpiDestroyCondition | ( | SCIP_LOCK * | lock | ) |
destroys the given condition variable
lock | the lock |
Referenced by freeThreadPool(), and SCIPsyncstoreExit().
SCIP_RETCODE SCIPtpiSignalCondition | ( | SCIP_CONDITION * | condition | ) |
signals one waiting thread
condition | the condition variable to signal |
Definition at line 260 of file tpi_openmp.c.
References SCIP_CALL, SCIP_OKAY, SCIPtpiAcquireLock(), and SCIPtpiReleaseLock().
Referenced by jobQueueAddJob().
SCIP_RETCODE SCIPtpiBroadcastCondition | ( | SCIP_CONDITION * | condition | ) |
signals all waiting threads
condition | the condition variable to broadcast |
Definition at line 274 of file tpi_openmp.c.
References SCIP_CALL, SCIP_OKAY, SCIPtpiAcquireLock(), and SCIPtpiReleaseLock().
Referenced by freeThreadPool(), and SCIPsyncstoreFinishSync().
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.
condition | the condition variable to wait on |
lock | the lock that is held by the caller |
Definition at line 286 of file tpi_openmp.c.
References SCIP_CALL, SCIP_OKAY, SCIPtpiAcquireLock(), and SCIPtpiReleaseLock().
Referenced by freeThreadPool(), and SCIPsyncstoreEnsureAllSynced().
int SCIPtpiGetNumThreads | ( | void | ) |
returns the number of threads
Returns the number of threads
Definition at line 324 of file tpi_openmp.c.
int SCIPtpiGetThreadNum | ( | void | ) |
returns the thread number
Returns the thread number
Definition at line 331 of file tpi_openmp.c.
Referenced by applyBoundChanges(), execConcsolver(), and executeJob().
SCIP_RETCODE SCIPtpiCreateJob | ( | SCIP_JOB ** | job, |
int | jobid, | ||
SCIP_RETCODE(*)(void *args) | jobfunc, | ||
void * | jobarg | ||
) |
creates a job for parallel processing
job | pointer to the job that will be created |
jobid | the id for the current job |
jobfunc | pointer to the job function |
jobarg | the job's argument |
Definition at line 28 of file tpi_none.c.
References BMSallocMemory, SCIP_Job::jobfunc, SCIP_Job::jobid, SCIP_ALLOC, SCIP_ERROR, SCIP_OKAY, and SCIP_UNUSED.
Referenced by SCIPconcurrentSolve().
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 356 of file tpi_openmp.c.
References SCIP_Job::jobid.
Referenced by SCIPconcurrentSolve().
SCIP_RETCODE SCIPtpiSumbitJob | ( | SCIP_JOB * | job, |
SCIP_SUBMITSTATUS * | status | ||
) |
submit a job for parallel processing the return is a globally defined status
submit a job for parallel processing
job | pointer to the job to be submitted |
status | pointer to store the job's submit status |
Definition at line 45 of file tpi_none.c.
References SCIP_Job::jobid, SCIP_ERROR, and SCIP_UNUSED.
Referenced by SCIPconcurrentSolve().
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
if the job has the right jobid collect its retcode, remove it from the finished job list, and free it
jobid | the jobid of the jobs to wait for |
Definition at line 58 of file tpi_none.c.
References SCIP_Job::retcode, SCIP_CALL, SCIP_ERROR, SCIP_OKAY, SCIP_UNUSED, and SCIPtpiAcquireLock().
Referenced by SCIPconcurrentSolve().
SCIP_RETCODE SCIPtpiInit | ( | int | nthreads, |
int | queuesize, | ||
SCIP_Bool | blockwhenfull | ||
) |
initializes tpi
nthreads | the number of threads to be used |
queuesize | the size of the queue |
blockwhenfull | should the queue block when full |
Definition at line 68 of file tpi_none.c.
References SCIP_ERROR, and SCIP_UNUSED.
Referenced by SCIPsyncstoreInit().
SCIP_RETCODE SCIPtpiExit | ( | void | ) |
deinitializes the tpi
deinitializes tpi
Definition at line 82 of file tpi_none.c.
References SCIP_ERROR.
Referenced by SCIPsyncstoreExit().