There are multi independent problems, I want to solve them parallelly with multi scip instances. Pseudo code like this:
CompletableFuture[] futures = problems.stream()
.map(problem -> CompletableFuture.runAsync(() -> {
System.loadLibrary("jscip");
Scip scip = new Scip();
scip.create(problem.name());
// add variables and constraints and set objective
scip.solve();
}, executor)
)
.toArray(CompletableFuture[]::new);
CompletableFuture.allOf(futures).join();
Try it, but the method scip.solve() seems execute one by one in different threads, problems don't been solved parallelly.
That's why?
I find a scip compile parameter TPI, it seems mean solving one problem with a scip instance in multi-threads.
Then, I find a same situation, [SCIP] run multiple problems in parallel, and I recompile scip follow the answer (Cmake with THREADSAFE flag), but it doesn't work.
So, there are some method for parallelly solving multi-problems? Or, I coding incorrectly?
There are multi independent problems, I want to solve them parallelly with multi scip instances. Pseudo code like this:
Try it, but the method
scip.solve()seems execute one by one in different threads, problems don't been solved parallelly.That's why?
I find a scip compile parameter
TPI, it seems mean solving one problem with a scip instance in multi-threads.Then, I find a same situation, [SCIP] run multiple problems in parallel, and I recompile scip follow the answer (Cmake with
THREADSAFEflag), but it doesn't work.So, there are some method for parallelly solving multi-problems? Or, I coding incorrectly?