diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-09-29 14:12:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-29 14:12:01 +0200 |
| commit | bf6e1c3516a4eb0509c12b00d9a1baf6ee119987 (patch) | |
| tree | 95ab133f9771c4791d5c784f1b3d4822b1dd7d3c /src/nissy.c | |
| parent | 774a824a6c80b5af495f4fb99d98758e3b9f6b81 (diff) | |
| parent | 7a52b4cd50a40e4bce919b6bd51203d0e9867141 (diff) | |
| download | nissy-core-bf6e1c3516a4eb0509c12b00d9a1baf6ee119987.tar.gz nissy-core-bf6e1c3516a4eb0509c12b00d9a1baf6ee119987.zip | |
Merge pull request #3 from enricotenuti/master
Threaded solver
Diffstat (limited to 'src/nissy.c')
| -rw-r--r-- | src/nissy.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nissy.c b/src/nissy.c index e610199..44efb83 100644 --- a/src/nissy.c +++ b/src/nissy.c | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | #include <inttypes.h> | 1 | #include <inttypes.h> |
| 2 | #include <pthread.h> | 2 | #include <pthread.h> |
| 3 | #include <stdatomic.h> | ||
| 3 | #include <stdarg.h> | 4 | #include <stdarg.h> |
| 4 | #include <stdbool.h> | 5 | #include <stdbool.h> |
| 5 | #include <string.h> | 6 | #include <string.h> |
| @@ -401,8 +402,9 @@ nissy_solve( | |||
| 401 | LOG("gendata: could not parse options\n"); | 402 | LOG("gendata: could not parse options\n"); |
| 402 | ret = -1; | 403 | ret = -1; |
| 403 | } else { | 404 | } else { |
| 404 | ret = solve_h48(c, minmoves, maxmoves, maxsolutions, | 405 | ret = THREADS > 1 ? |
| 405 | data, solutions); | 406 | solve_h48_multithread(c, minmoves, maxmoves, maxsolutions, data, solutions) : |
| 407 | solve_h48(c, minmoves, maxmoves, maxsolutions, data, solutions); | ||
| 406 | } | 408 | } |
| 407 | } else if (!strcmp(solver, "h48stats")) { | 409 | } else if (!strcmp(solver, "h48stats")) { |
| 408 | ret = solve_h48stats(c, maxmoves, data, solutions); | 410 | ret = solve_h48stats(c, maxmoves, data, solutions); |
