MCPcopy Create free account
hub / github.com/Gecode/gecode / pbsseq

Function pbsseq

gecode/search/pbs.hpp:94–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92
93 template<class T, template<class> class E>
94 Engine*
95 pbsseq(T* master, const Search::Statistics& stat, Options& opt) {
96 Stop* stop = opt.stop;
97 Region r;
98
99 // In case there are more threads than assets requested
100 opt.threads = std::max(floor(opt.threads /
101 static_cast<double>(opt.assets)),1.0);
102
103 unsigned int n_slaves = opt.assets;
104 Engine** slaves = r.alloc<Engine*>(n_slaves);
105 Stop** stops = r.alloc<Stop*>(n_slaves);
106
107 WrapTraceRecorder::engine(opt.tracer,
108 SearchTracer::EngineType::PBS, n_slaves);
109
110 for (unsigned int i=0U; i<n_slaves; i++) {
111 opt.stop = stops[i] = Seq::pbsstop(stop);
112 Space* slave = (i == n_slaves-1) ?
113 master : master->clone();
114 (void) slave->slave(i);
115 slaves[i] = build<T,E>(slave,opt);
116 }
117
118 return Seq::pbsengine(slaves,stops,n_slaves,stat,opt,E<T>::best);
119 }
120
121 template<class T, template<class> class E>
122 Engine*

Callers

nothing calls this directly

Calls 6

pbsstopFunction · 0.85
pbsengineFunction · 0.85
maxFunction · 0.50
cloneMethod · 0.45
slaveMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected