Skip to content

How to solve multi-problems parallelly? #56

@shouriken

Description

@shouriken

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions