58 static const int n_info = 8192;
75 std::atomic<unsigned int> npid;
88 double decay(
void)
const;
92 Info*
allocate(
unsigned int p,
unsigned int gid);
96 unsigned int pid(
void)
const;
111 GPI::Block::Block(
void)
112 : next(nullptr), free(n_info) {}
115 GPI::Block::rescale(
void) {
116 for (
int i=free; i < n_info; i++)
123 : b(&fst), invd(1.0), npid(0U), us(false) {}
128 c.
afc = invd * (c.
afc + 1.0);
130 for (Block* i = b; i !=
nullptr; i = i->next)
138 const_cast<GPI&
>(*this).m.acquire();
140 const_cast<GPI&
>(*this).m.release();
144 forceinline
unsigned int
146 return npid.load(std::memory_order_acquire);
170 Block* n =
new Block;
173 c = &b->info[--b->free];
184 Block* n =
new Block;
187 c = &b->info[--b->free];
189 c->
init(npid.fetch_add(1, std::memory_order_seq_cst),gid);
Base class for heap allocated objects.
Class for storing propagator information.
void init(unsigned int pid, unsigned int gid)
Initialize.
unsigned int pid
Propagator identifier.
unsigned int gid
Group identifier.
unsigned int pid(void) const
Return next free propagator id.
double decay(void) const
Return decay factor.
void fail(Info &c)
Increment failure count.
bool unshare(void)
Provide access to unshare info and set to true.
Info * allocate(unsigned int p, unsigned int gid)
Allocate info for existing propagator with pid p.
A mutex for mutual exclausion among several threads.
#define GECODE_KERNEL_EXPORT
const double rescale_limit
Rescale action and afc values when larger than this.
const double rescale
Rescale factor for action and afc values.
Gecode toplevel namespace