38 #ifndef __GECODE_SEARCH_PARALLEL_DFS_HH__ 39 #define __GECODE_SEARCH_PARALLEL_DFS_HH__ 43 namespace Gecode {
namespace Search {
namespace Parallel {
56 virtual void run(
void);
95 return static_cast<DFS&>(
_engine);
113 _worker = static_cast<Worker**>
167 for (
unsigned int i=0;
i<engine().workers();
i++) {
168 unsigned long int r_d = 0ul;
169 if (
Space* s = engine().worker(
i)->steal(r_d)) {
unsigned int workers(void) const
Return number of workers.
Parallel depth-first search worker
Path path
Current path ins search tree.
void idle(void)
Report that worker is idle.
static void run(Runnable *r)
Construct a new thread and run r.
virtual Statistics statistics(void) const
Return statistics.
void acquire(void)
Acquire the mutex and possibly block.
void * ralloc(size_t s)
Allocate s bytes from heap.
virtual void run(void)
Start execution of worker.
void path(Home home, int offset, const IntVarArgs &x, IntVar s, IntVar e, IntConLevel icl)
Post propagator such that x forms a Hamiltonian path.
void block(void)
Block all workers.
void signal(void)
Signal the event.
void find(void)
Try to find some work.
Heap heap
The single global heap.
void release(void)
Release the mutex.
virtual NoGoods & nogoods(void)
Return no-goods.
Gecode::IntArgs i(4, 1, 2, 3, 4)
unsigned int d
Distance until next clone.
bool idle
Whether the worker is idle.
virtual void reset(Space *s)
Reset engine to restart at space s.
Space * cur
Current space being explored.
DFS(Space *s, const Options &o)
Initialize for space s with options o.
Support::Event e_search
Event for search (solution found, no more solutions, search stopped)
bool signal(void) const
Whether search state changed such that signal is needed.
Parallel depth-first search engine
void solution(Space *s)
Report solution s.
No-goods recorded from restarts.
Parallel depth-first search worker
Parallel depth-first search engine
SpaceStatus status(StatusStatistics &stat=unused_status)
Query space status.
Support::DynamicQueue< Space *, Heap > solutions
Queue of solutions.
Engine & _engine
Reference to engine.
Worker * worker(unsigned int i) const
Provide access to worker i.
Gecode toplevel namespace
DFS & engine(void) const
Provide access to engine.
Worker ** _worker
Array of worker references.
void reset(int l)
Reset stack and set no-good depth limit to l.
virtual ~DFS(void)
Destructor.
Support::Mutex m_search
Mutex for search.