Gecode::Search::Par::BAB< Tracer > Class Template Reference
Parallel branch-and-bound engine More...
#include <gecode/search/par/bab.hh>
Classes | |
| class | Worker |
| Parallel branch-and-bound search worker More... | |
Public Member Functions | |
| Worker * | worker (unsigned int i) const |
| Provide access to worker i. | |
| Public Member Functions inherited from Gecode::Search::Par::Engine< Tracer > | |
| const Options & | opt (void) const |
| Provide access to search options. | |
| unsigned int | workers (void) const |
| Return number of workers. | |
| void | scheduler_enable (bool root_owner) |
| Enable adjustable parallel admission. | |
| void | scheduler_reset (bool root_owner) |
| Reset adjustable parallel state while all workers are blocked. | |
| bool | scheduler_admit (unsigned int worker) |
| Admit worker worker for one exploration action. | |
| bool | scheduler_paused (void) const |
| Whether the external worker request currently pauses the engine. | |
| void | scheduler_owner (unsigned int worker) |
| Record that worker worker owns search. | |
| void | scheduler_idle (unsigned int worker) |
| Record that worker worker is idle. | |
| void | scheduler_handoff (unsigned int worker, bool work_remains) |
| Hand worker worker's lease to a parked logical worker. | |
| Cmd | cmd (void) const |
| Return current command. | |
| void | block (void) |
| Block all workers. | |
| void | release (Cmd c) |
| Release all workers. | |
| void | wait (void) |
| Ensure that worker waits. | |
| void | ack_terminate (void) |
| For worker to acknowledge termination command. | |
| virtual void | terminated (void) |
| For worker to register termination. | |
| void | wait_terminate (void) |
| For worker to wait until termination is legal. | |
| void | terminate (void) |
| For engine to perform thread termination. | |
| void | ack_reset_start (void) |
| For worker to acknowledge start of reset cycle. | |
| void | ack_reset_stop (void) |
| For worker to acknowledge stop of reset cycle. | |
| void | wait_reset (void) |
| For worker to wait for all workers to reset. | |
| void | idle (void) |
| Report that worker is idle. | |
| void | busy (void) |
| Report that worker is busy. | |
| unsigned long long int | run (void) const |
| Return the current call of next(). | |
| void | stop (unsigned long long int r) |
| Report that a worker was stopped during call r of next(). | |
| bool | work_remains (void) |
| Whether logical search work remains. | |
| Engine (const Options &o) | |
| Initialize with options o. | |
| virtual Space * | next (void) |
| Return next solution (nullptr, if none exists or search has been stopped). | |
| virtual bool | stopped (void) const |
| Check whether engine has been stopped. | |
| virtual | ~Engine (void) |
| Destructor. | |
| Public Member Functions inherited from Gecode::Search::Engine | |
| virtual bool | limited (void) const |
| Whether the engine stopped at a local limit (such as a CABS width limit) and cannot continue. | |
| Public Member Functions inherited from Gecode::Support::Terminator | |
| virtual | ~Terminator () |
| Destructor. | |
Protected Attributes | |
| Worker ** | _worker |
| Array of worker references. | |
| Space * | best |
| Best solution so far. | |
| Protected Attributes inherited from Gecode::Search::Par::Engine< Tracer > | |
| Options | _opt |
| Search options. | |
| bool | scheduler_enabled |
| Whether adjustable parallel admission is enabled. | |
| const std::atomic< bool > * | scheduler_fast_admit |
| Unchanged-capacity admission fast path. | |
| Support::Mutex | scheduler_mutex |
| Mutex for adjustable parallel admission. | |
| SchedulerWorker * | scheduler_worker |
| Per-worker adjustable parallel admission state. | |
| unsigned int | scheduler_requested |
| Current requested lease count. | |
| unsigned int | scheduler_leases |
| Current lease count. | |
| unsigned int | scheduler_cursor |
| Round-robin cursor for lease handoff. | |
| std::atomic< unsigned long long int > | scheduler_generation |
| Last request generation reconciled by the scheduler. | |
| std::atomic< Cmd > | _cmd |
| The current command. | |
| Support::Mutex | _m_wait |
| Mutex for forcing workers to wait. | |
| Support::Mutex | _m_term |
| Mutex for access to termination information. | |
| volatile unsigned int | _n_term_not_ack |
| Number of workers that have not yet acknowledged termination. | |
| Support::Event | _e_term_ack |
| Event for termination acknowledgment. | |
| Support::Mutex | _m_wait_terminate |
| Mutex for waiting for termination. | |
| volatile unsigned int | _n_not_terminated |
| Number of not yet terminated workers. | |
| Support::Event | _e_terminate |
| Event for termination (all threads have terminated). | |
| Support::Mutex | _m_reset |
| Mutex for access to reset information. | |
| volatile unsigned int | _n_reset_not_ack |
| Number of workers that have not yet acknowledged reset. | |
| Support::Event | e_reset_ack_start |
| Event for reset acknowledgment started. | |
| Support::Event | e_reset_ack_stop |
| Event for reset acknowledgment stopped. | |
| Support::Mutex | m_wait_reset |
| Mutex for waiting for reset. | |
| Support::Mutex | m_search |
| Mutex for search. | |
| Support::Event | e_search |
| Event for search (solution found, no more solutions, search stopped). | |
| Support::DynamicQueue< Space *, Heap > | solutions |
| Queue of solutions. | |
| volatile unsigned int | n_busy |
| Number of busy workers. | |
| std::atomic< bool > | has_stopped |
| Whether a worker had been stopped. | |
| std::atomic< unsigned long long int > | n_runs |
| Number of calls to next() that have started search. | |
| Protected Attributes inherited from Gecode::Search::Engine | |
| WorkerControl | worker_control |
| Control retained for the lifetime of a leaf engine. | |
Search control | |
| void | solution (Space *s) |
| Report solution s. | |
Engine interface | |
| BAB (Space *s, const Options &o) | |
| Initialize for space s with options o. | |
| virtual Statistics | statistics (void) const |
| Return statistics. | |
| virtual void | reset (Space *s) |
| Reset engine to restart at space s. | |
| virtual void | constrain (const Space &b) |
| Constrain future solutions to be better than b. | |
| virtual NoGoods & | nogoods (void) |
| Constrain Return no-goods. | |
| virtual | ~BAB (void) |
| Destructor. | |
Additional Inherited Members | |
| Public Types inherited from Gecode::Search::Par::Engine< Tracer > | |
| enum | Cmd { C_WORK , C_WAIT , C_RESET , C_TERMINATE } |
| Commands from engine to workers. More... | |
| Static Public Member Functions inherited from Gecode::HeapAllocated | |
| static void * | operator new (size_t s) |
| Memory management. | |
| static void | operator delete (void *p) |
| Free memory allocated from heap. | |
| Protected Types inherited from Gecode::Search::Par::Engine< Tracer > | |
| enum class | SchedulerLogical { OWNER , PENDING , IDLE } |
| Logical worker state used by adjustable parallel admission. More... | |
| Protected Member Functions inherited from Gecode::Search::Par::Engine< Tracer > | |
| unsigned int | scheduler_select (SchedulerLogical logical, unsigned int exclude) const |
| Select a no-lease worker by logical state (scheduler_mutex held). | |
| bool | scheduler_grow (void) |
| Grant leases up to the current request (scheduler_mutex held). | |
| bool | signal (void) const |
| Whether search state changed such that signal is needed. | |
| Protected Member Functions inherited from Gecode::Search::Engine | |
| Engine (void) | |
| Construct a meta engine without worker control. | |
| Engine (const Options &o, unsigned int capacity) | |
| Construct a leaf engine and bind worker control to capacity. | |
Detailed Description
template<class Tracer>
class Gecode::Search::Par::BAB< Tracer >
class Gecode::Search::Par::BAB< Tracer >
Parallel branch-and-bound engine
Constructor & Destructor Documentation
◆ BAB()
template<class Tracer>
|
inline |
◆ ~BAB()
template<class Tracer>
|
virtual |
Member Function Documentation
◆ worker()
◆ solution()
template<class Tracer>
|
inline |
◆ statistics()
template<class Tracer>
|
virtual |
◆ reset()
template<class Tracer>
|
virtual |
Reset engine to restart at space s.
Reimplemented from Gecode::Search::Engine.
◆ constrain()
template<class Tracer>
|
virtual |
Constrain future solutions to be better than b.
Reimplemented from Gecode::Search::Engine.
◆ nogoods()
template<class Tracer>
|
virtual |
Constrain Return no-goods.
Reimplemented from Gecode::Search::Engine.
Member Data Documentation
◆ _worker
template<class Tracer>
|
protected |
◆ best
template<class Tracer>
|
protected |
The documentation for this class was generated from the following files:
