From 7dd087927f072aa7f6fa000bacb8b9ac91fa46e5 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <matthieu.schaller@durham.ac.uk> Date: Fri, 3 Feb 2017 12:31:13 +0000 Subject: [PATCH] Use the correct number of messages when waiting in engine_exchange_strays() --- src/engine.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/engine.c b/src/engine.c index 311004b73d..2708d52ce7 100644 --- a/src/engine.c +++ b/src/engine.c @@ -1394,7 +1394,7 @@ void engine_exchange_strays(struct engine *e, size_t offset_parts, error("MPI_Waitany failed (%s).", buff); } if (pid == MPI_UNDEFINED) break; - // message( "request from proxy %i has arrived." , pid / 3 ); + // message( "request from proxy %i has arrived." , pid / 4 ); pid = 4 * (pid / 4); /* If all the requests for a given proxy have arrived... */ @@ -1403,7 +1403,7 @@ void engine_exchange_strays(struct engine *e, size_t offset_parts, reqs_in[pid + 2] == MPI_REQUEST_NULL && reqs_in[pid + 3] == MPI_REQUEST_NULL) { /* Copy the particle data to the part/xpart/gpart arrays. */ - struct proxy *prox = &e->proxies[pid / 3]; + struct proxy *prox = &e->proxies[pid / 4]; memcpy(&s->parts[offset_parts + count_parts], prox->parts_in, sizeof(struct part) * prox->nr_parts_in); memcpy(&s->xparts[offset_parts + count_parts], prox->xparts_in, @@ -1444,7 +1444,7 @@ void engine_exchange_strays(struct engine *e, size_t offset_parts, /* Wait for all the sends to have finished too. */ if (nr_out > 0) - if (MPI_Waitall(3 * e->nr_proxies, reqs_out, MPI_STATUSES_IGNORE) != + if (MPI_Waitall(4 * e->nr_proxies, reqs_out, MPI_STATUSES_IGNORE) != MPI_SUCCESS) error("MPI_Waitall on sends failed."); -- GitLab