Replies: 3 comments
-
But to point you in the direction of the information: Just in case you are looking for more examples, there is also no harm in looking at how the script you mentioned is implemented: |
Beta Was this translation helpful? Give feedback.
-
As @Dekker1 says, the Here is a small example on how to use search options to set up a parallel search using 3 threads and additionally letting the search engine take ownership of the root node. Gecode::Search::Options options;
// Use 3 threads.
options.threads = 3;
// Take ownership of the root node passed into the search engine
options.clone = false;
auto* root = new Sudoku(instance);
Gecode::DFS<Sudoku> engine(root, options);
while (auto* solution = engine.next()) {
solution->print(std::cout);
delete solution;
} The threads argument is documented in Section 9.3.1 in MPG. |
Beta Was this translation helpful? Give feedback.
-
Thanks Mikael, this code snippet is exactly what I was looking for. The reason I avoided |
Beta Was this translation helpful? Give feedback.
-
The example
golomb-ruler.cpp
usesIntMinimizeScript::run()
with thethreads
argument passed through theSizeOptions
object.But are there examples showing how to use parallel search with bare engine objects? For example:
Beta Was this translation helpful? Give feedback.
All reactions