summaryrefslogtreecommitdiff
path: root/tabulator-mpi/head.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tabulator-mpi/head.cpp')
-rw-r--r--tabulator-mpi/head.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/tabulator-mpi/head.cpp b/tabulator-mpi/head.cpp
index e2372bc..bd270af 100644
--- a/tabulator-mpi/head.cpp
+++ b/tabulator-mpi/head.cpp
@@ -2,6 +2,8 @@
#include <cstdio>
#include <mpi.h>
+#include "constants.hpp"
+
static int **score_results;
static int get_result() {
@@ -26,11 +28,12 @@ void head_main(int comm_size, int warrior_count, const lib94::warrior *const *wa
for (int i = 0; i < warrior_count; ++i)
for (int j = i + 1; j < warrior_count; ++j) {
fprintf(stderr, "%s vs %s\n", warriors[i]->name.c_str(), warriors[j]->name.c_str());
- for (int x = 0; x < 10; ++x) {
+ for (int x = 0; x < CHUNKS_PER_PAIR; ++x) {
int rank = get_result();
- int message[3] = {i, j, x * 100};
+ int message[3] = {i, j, x * ROUNDS_PER_CHUNK};
MPI_Send(message, 2, MPI_INT, rank, 0, MPI_COMM_WORLD);
- fprintf(stderr, "sent rounds %d through %d to worker %d\n", x * 100 + 1, x * 100 + 100, rank);
+ fprintf(stderr, "sent rounds %d through %d to worker %d\n",
+ x * ROUNDS_PER_CHUNK + 1, x * ROUNDS_PER_CHUNK + ROUNDS_PER_CHUNK, rank);
}
fputc('\n', stderr);
}