From cf829f363010d842a70e8f7b3107b2d06f6fd407 Mon Sep 17 00:00:00 2001 From: Kevin Sala Date: Mon, 16 Aug 2021 12:29:54 +0200 Subject: [PATCH] Fixing ovnisync tool --- ovnisync.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ovnisync.c b/ovnisync.c index 70dfd1b..3d0503e 100644 --- a/ovnisync.c +++ b/ovnisync.c @@ -66,7 +66,7 @@ get_offset(double *timetable, char (*hosttable)[OVNI_MAX_HOSTNAME], int nproc, i mean = 0.0; var = 0.0; - qsort(delta, sizeof(*delta), nsamples, cmp_double); + qsort(delta, nsamples, sizeof(*delta), cmp_double); median = delta[nsamples / 2]; @@ -138,7 +138,9 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } - MPI_Gather(hosttable[rank], sizeof(*hosttable), MPI_CHAR, + void *sendbuff = (rank > 0) ? hosttable[rank] : MPI_IN_PLACE; + + MPI_Gather(sendbuff, sizeof(*hosttable), MPI_CHAR, hosttable[0], sizeof(*hosttable), MPI_CHAR, 0, MPI_COMM_WORLD);