diff options
author | Benji Dial <benji@benjidial.net> | 2023-05-30 21:49:05 -0400 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2023-05-30 21:49:05 -0400 |
commit | 1a0a068b87e3f04e9c7301b6c7b238dc4baf1af2 (patch) | |
tree | 2299c47a245b35960ecbafc5cf7aaa331ca6bdb2 /tabulator-mpi/worker.cpp | |
parent | 6b2cbe6c00c1b008e3145c1adf6096640f4e7bbd (diff) | |
download | lib94-1a0a068b87e3f04e9c7301b6c7b238dc4baf1af2.tar.gz |
move tabulator-mpi's parameters into separate file for easier changing
Diffstat (limited to 'tabulator-mpi/worker.cpp')
-rw-r--r-- | tabulator-mpi/worker.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tabulator-mpi/worker.cpp b/tabulator-mpi/worker.cpp index 47b8eeb..5a20db2 100644 --- a/tabulator-mpi/worker.cpp +++ b/tabulator-mpi/worker.cpp @@ -1,6 +1,8 @@ #include <lib94/lib94.hpp> #include <mpi.h> +#include "constants.hpp" + static int do_round(const lib94::warrior *w1, const lib94::warrior *w2) { const lib94::warrior *ws[2] = {w1, w2}; @@ -14,7 +16,7 @@ static int do_round(const lib94::warrior *w1, const lib94::warrior *w2) { lib94::init_round(ws, 2); - for (int i = 0; i < 1000000; ++i) { + for (int i = 0; i < STEPS_TO_TIE; ++i) { const lib94::warrior *result = lib94::single_step<false>(); if (result == w1) return -1; @@ -37,7 +39,7 @@ void worker_main(const lib94::warrior *const *warriors) { buffer[2] = 0; - for (int i = 0; i < 100; ++i) + for (int i = 0; i < ROUNDS_PER_CHUNK; ++i) buffer[2] += do_round(warriors[buffer[0]], warriors[buffer[1]]); } } |