Generated on Thu Apr 11 14:00:08 2019 for Gecode by doxygen 1.6.3

Gecode::Search::Par::Engine< Tracer > Class Template Reference

Parallel depth-first search engine More...

#include <engine.hh>

List of all members.

Classes

class  Worker
 Parallel depth-first search worker More...

Public Member Functions

const Optionsopt (void) const
 Provide access to search options.
unsigned int workers (void) const
 Return number of workers.

Protected Attributes

Options _opt
 Search options.

Commands from engine to workers and wait management



enum  Cmd { C_WORK, C_WAIT, C_RESET, C_TERMINATE }
 

Commands from engine to workers.

More...
volatile Cmd _cmd
 The current command.
Support::Mutex _m_wait
 Mutex for forcing workers to wait.
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.

Termination control



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).
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 peform thread termination.

Reset control



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.
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.

Search control



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.
volatile bool has_stopped
 Whether a worker had been stopped.
void idle (void)
 Report that worker is idle.
void busy (void)
 Report that worker is busy.
void stop (void)
 Report that worker has been stopped.
bool signal (void) const
 Whether search state changed such that signal is needed.

Engine interface



 Engine (const Options &o)
 Initialize with options o.
virtual Spacenext (void)
 Return next solution (NULL, if none exists or search has been stopped).
virtual bool stopped (void) const
 Check whether engine has been stopped.

Detailed Description

template<class Tracer>
class Gecode::Search::Par::Engine< Tracer >

Parallel depth-first search engine

Definition at line 46 of file engine.hh.


Member Enumeration Documentation

template<class Tracer >
enum Gecode::Search::Par::Engine::Cmd

Commands from engine to workers.

Enumerator:
C_WORK 

Perform work.

C_WAIT 

Run into wait lock.

C_RESET 

Perform reset operation.

C_TERMINATE 

Terminate.

Definition at line 93 of file engine.hh.


Constructor & Destructor Documentation

template<class Tracer >
Gecode::Search::Par::Engine< Tracer >::Engine ( const Options o  )  [inline]

Initialize with options o.

Definition at line 116 of file engine.hpp.


Member Function Documentation

template<class Tracer >
const Options & Gecode::Search::Par::Engine< Tracer >::opt ( void   )  const [inline]

Provide access to search options.

Definition at line 47 of file engine.hpp.

template<class Tracer >
unsigned int Gecode::Search::Par::Engine< Tracer >::workers ( void   )  const [inline]

Return number of workers.

Definition at line 52 of file engine.hpp.

template<class Tracer >
Engine< Tracer >::Cmd Gecode::Search::Par::Engine< Tracer >::cmd ( void   )  const [inline]

Return current command.

Definition at line 68 of file engine.hpp.

template<class Tracer >
void Gecode::Search::Par::Engine< Tracer >::block ( void   )  [inline]

Block all workers.

Definition at line 73 of file engine.hpp.

template<class Tracer >
void Gecode::Search::Par::Engine< Tracer >::release ( Cmd  c  )  [inline]

Release all workers.

Definition at line 79 of file engine.hpp.

template<class Tracer >
void Gecode::Search::Par::Engine< Tracer >::wait ( void   )  [inline]

Ensure that worker waits.

Definition at line 85 of file engine.hpp.

template<class Tracer >
void Gecode::Search::Par::Engine< Tracer >::ack_terminate ( void   )  [inline]

For worker to acknowledge termination command.

Definition at line 200 of file engine.hpp.

template<class Tracer >
void Gecode::Search::Par::Engine< Tracer >::terminated ( void   )  [inline, virtual]

For worker to register termination.

Implements Gecode::Support::Terminator.

Definition at line 187 of file engine.hpp.

template<class Tracer >
void Gecode::Search::Par::Engine< Tracer >::wait_terminate ( void   )  [inline]

For worker to wait until termination is legal.

Definition at line 209 of file engine.hpp.

template<class Tracer >
void Gecode::Search::Par::Engine< Tracer >::terminate ( void   )  [inline]

For engine to peform thread termination.

Definition at line 216 of file engine.hpp.

template<class Tracer >
void Gecode::Search::Par::Engine< Tracer >::ack_reset_start ( void   )  [inline]

For worker to acknowledge start of reset cycle.

Definition at line 235 of file engine.hpp.

template<class Tracer >
void Gecode::Search::Par::Engine< Tracer >::ack_reset_stop ( void   )  [inline]

For worker to acknowledge stop of reset cycle.

Definition at line 244 of file engine.hpp.

template<class Tracer >
void Gecode::Search::Par::Engine< Tracer >::wait_reset ( void   )  [inline]

For worker to wait for all workers to reset.

Definition at line 253 of file engine.hpp.

template<class Tracer >
bool Gecode::Search::Par::Engine< Tracer >::signal ( void   )  const [inline, protected]

Whether search state changed such that signal is needed.

Definition at line 147 of file engine.hpp.

template<class Tracer >
void Gecode::Search::Par::Engine< Tracer >::idle ( void   )  [inline]

Report that worker is idle.

Definition at line 152 of file engine.hpp.

template<class Tracer >
void Gecode::Search::Par::Engine< Tracer >::busy ( void   )  [inline]

Report that worker is busy.

Definition at line 163 of file engine.hpp.

template<class Tracer >
void Gecode::Search::Par::Engine< Tracer >::stop ( void   )  [inline]

Report that worker has been stopped.

Definition at line 172 of file engine.hpp.

template<class Tracer >
Space * Gecode::Search::Par::Engine< Tracer >::next ( void   )  [inline, virtual]

Return next solution (NULL, if none exists or search has been stopped).

Implements Gecode::Search::Engine.

Reimplemented in Gecode::Search::Par::PBS< Collect >, and Gecode::Search::Par::PBS< CollectBest >.

Definition at line 298 of file engine.hpp.

template<class Tracer >
bool Gecode::Search::Par::Engine< Tracer >::stopped ( void   )  const [inline, virtual]

Check whether engine has been stopped.

Implements Gecode::Search::Engine.

Reimplemented in Gecode::Search::Par::PBS< Collect >, and Gecode::Search::Par::PBS< CollectBest >.

Definition at line 57 of file engine.hpp.


Member Data Documentation

template<class Tracer >
Options Gecode::Search::Par::Engine< Tracer >::_opt [protected]

Search options.

Definition at line 83 of file engine.hh.

template<class Tracer >
volatile Cmd Gecode::Search::Par::Engine< Tracer >::_cmd [protected]

The current command.

Definition at line 101 of file engine.hh.

template<class Tracer >
Support::Mutex Gecode::Search::Par::Engine< Tracer >::_m_wait [protected]

Mutex for forcing workers to wait.

Definition at line 103 of file engine.hh.

template<class Tracer >
Support::Mutex Gecode::Search::Par::Engine< Tracer >::_m_term [protected]

Mutex for access to termination information.

Definition at line 119 of file engine.hh.

template<class Tracer >
volatile unsigned int Gecode::Search::Par::Engine< Tracer >::_n_term_not_ack [protected]

Number of workers that have not yet acknowledged termination.

Definition at line 121 of file engine.hh.

template<class Tracer >
Support::Event Gecode::Search::Par::Engine< Tracer >::_e_term_ack [protected]

Event for termination acknowledgment.

Definition at line 123 of file engine.hh.

template<class Tracer >
Support::Mutex Gecode::Search::Par::Engine< Tracer >::_m_wait_terminate [protected]

Mutex for waiting for termination.

Definition at line 125 of file engine.hh.

template<class Tracer >
volatile unsigned int Gecode::Search::Par::Engine< Tracer >::_n_not_terminated [protected]

Number of not yet terminated workers.

Definition at line 127 of file engine.hh.

template<class Tracer >
Support::Event Gecode::Search::Par::Engine< Tracer >::_e_terminate [protected]

Event for termination (all threads have terminated).

Definition at line 129 of file engine.hh.

template<class Tracer >
Support::Mutex Gecode::Search::Par::Engine< Tracer >::_m_reset [protected]

Mutex for access to reset information.

Definition at line 145 of file engine.hh.

template<class Tracer >
volatile unsigned int Gecode::Search::Par::Engine< Tracer >::_n_reset_not_ack [protected]

Number of workers that have not yet acknowledged reset.

Definition at line 147 of file engine.hh.

template<class Tracer >
Support::Event Gecode::Search::Par::Engine< Tracer >::e_reset_ack_start [protected]

Event for reset acknowledgment started.

Definition at line 149 of file engine.hh.

template<class Tracer >
Support::Event Gecode::Search::Par::Engine< Tracer >::e_reset_ack_stop [protected]

Event for reset acknowledgment stopped.

Definition at line 151 of file engine.hh.

template<class Tracer >
Support::Mutex Gecode::Search::Par::Engine< Tracer >::m_wait_reset [protected]

Mutex for waiting for reset.

Definition at line 153 of file engine.hh.

template<class Tracer >
Support::Mutex Gecode::Search::Par::Engine< Tracer >::m_search [protected]

Mutex for search.

Definition at line 167 of file engine.hh.

template<class Tracer >
Support::Event Gecode::Search::Par::Engine< Tracer >::e_search [protected]

Event for search (solution found, no more solutions, search stopped).

Definition at line 169 of file engine.hh.

template<class Tracer >
Support::DynamicQueue<Space*,Heap> Gecode::Search::Par::Engine< Tracer >::solutions [protected]

Queue of solutions.

Reimplemented in Gecode::Search::Par::PBS< Collect >, and Gecode::Search::Par::PBS< CollectBest >.

Definition at line 171 of file engine.hh.

template<class Tracer >
volatile unsigned int Gecode::Search::Par::Engine< Tracer >::n_busy [protected]

Number of busy workers.

Reimplemented in Gecode::Search::Par::PBS< Collect >, and Gecode::Search::Par::PBS< CollectBest >.

Definition at line 173 of file engine.hh.

template<class Tracer >
volatile bool Gecode::Search::Par::Engine< Tracer >::has_stopped [protected]

Whether a worker had been stopped.

Definition at line 175 of file engine.hh.


The documentation for this class was generated from the following files: