engine.hpp
Go to the documentation of this file.
WorkerControl worker_control
Control retained for the lifetime of a leaf engine.
Definition search.hh:1066
Space * steal(unsigned long int &d, Tracer &myt, Tracer &ot)
Hand over some work (nullptr if no work available).
Definition engine.hpp:492
Support::Event _e_terminate
Event for termination (all threads have terminated).
Definition engine.hh:198
std::atomic< unsigned long long int > n_runs
Number of calls to next() that have started search.
Definition engine.hh:246
bool scheduler_grow(void)
Grant leases up to the current request (scheduler_mutex held).
Definition engine.hpp:157
Support::Event e_search
Event for search (solution found, no more solutions, search stopped).
Definition engine.hh:238
virtual Space * next(void)
Return next solution (nullptr, if none exists or search has been stopped).
Definition engine.hpp:523
SchedulerWorker * scheduler_worker
Per-worker adjustable parallel admission state.
Definition engine.hh:125
std::atomic< unsigned long long int > scheduler_generation
Last request generation reconciled by the scheduler.
Definition engine.hh:133
unsigned int scheduler_select(SchedulerLogical logical, unsigned int exclude) const
Select a no-lease worker by logical state (scheduler_mutex held).
Definition engine.hpp:143
void scheduler_enable(bool root_owner)
Enable adjustable parallel admission.
Definition engine.hpp:183
void scheduler_owner(unsigned int worker)
Record that worker worker owns search.
Definition engine.hpp:285
volatile unsigned int _n_reset_not_ack
Number of workers that have not yet acknowledged reset.
Definition engine.hh:216
bool scheduler_admit(unsigned int worker)
Admit worker worker for one exploration action.
Definition engine.hpp:230
bool signal(void) const
Whether search state changed such that signal is needed.
Definition engine.hpp:352
volatile unsigned int _n_term_not_ack
Number of workers that have not yet acknowledged termination.
Definition engine.hh:190
volatile unsigned int _n_not_terminated
Number of not yet terminated workers.
Definition engine.hh:196
void scheduler_handoff(unsigned int worker, bool work_remains)
Hand worker worker's lease to a parked logical worker.
Definition engine.hpp:305
void stop(unsigned long long int r)
Report that a worker was stopped during call r of next().
Definition engine.hpp:384
void scheduler_reset(bool root_owner)
Reset adjustable parallel state while all workers are blocked.
Definition engine.hpp:207
bool scheduler_paused(void) const
Whether the external worker request currently pauses the engine.
Definition engine.hpp:278
const std::atomic< bool > * scheduler_fast_admit
Unchanged-capacity admission fast path.
Definition engine.hh:115
static void signal(WorkerControl &control, unsigned int worker)
Signal the event belonging to worker worker.
Definition worker-control.cpp:257
static void signal_all(WorkerControl &control)
Signal every worker event.
Definition worker-control.cpp:275
static unsigned long long int generation(const WorkerControl &control)
Return the request generation.
Definition worker-control.cpp:187
static void snapshot(const WorkerControl &control, unsigned int &requested, unsigned long long int &generation)
Return a consistent request and generation snapshot.
Definition worker-control.cpp:224
static void wait(WorkerControl &control, unsigned int worker)
Wait for the event belonging to worker worker.
Definition worker-control.cpp:239
static const std::atomic< bool > * fast_admission(const WorkerControl &control)
Return the unchanged-capacity fast-admission flag.
Definition worker-control.cpp:193
static unsigned int requested(const WorkerControl &control)
Return the current request.
Definition worker-control.cpp:218
An interface for objects that can be called after a thread has terminated (after running the thread's...
Definition thread.hpp:168
static void acquireGlobalMutex(Mutex *m)
acquire mutex m globally and possibly lock
Definition thread.cpp:154
Definition astar.cpp:43
Search engines
Space * snapshot(Space *s, const Options &o)
Clone space s depending on options o.
Definition support.hh:71
Gecode toplevel namespace
Per-worker adjustable parallel admission state.
Definition engine.hh:105
