Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 1 Dec 2017 17:36:48 +0000 (18:36 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 1 Dec 2017 17:36:48 +0000 (18:36 +0100)
teshsuite/smpi/mpich3-test/rma/CMakeLists.txt
teshsuite/smpi/mpich3-test/rma/rget-testall.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/rma/testlist

index 6c30288..1a1dcad 100644 (file)
@@ -19,7 +19,7 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite)
      strided_acc_onelock strided_get_indexed strided_putget_indexed contention_put contention_putget
      adlb_mimic1 lock_contention_dt acc-loc get_acc_local get_accumulate put_base put_bottom
      linked_list_bench_lock_all linked_list_bench_lock_excl manyrma2 pscw_ordering rma-contig get-struct
-     rput_local_comp racc_local_comp)
+     rput_local_comp racc_local_comp rget-testall)
     # fence_shm fetchandadd_am fetchandadd fetchandadd_tree_am fetchandadd_tree 
     #  linked_list_bench_lock_shr linked_list linked_list_fop linked_list_lockall 
     #   mcs-mutex mixedsync mutex_bench lockcontention3 reqops
@@ -61,7 +61,7 @@ foreach(file accfence1 accfence2_am accfence2 accpscw1 allocmem epochtest getfen
           rget-unlock overlap_wins_rma lock_nested derived-acc-flush_local large-acc-flush_local lockall_dt lockall_dt_flushall
           lockall_dt_flush nb_test lockall_dt_flushlocal lockall_dt_flushlocalall lock_contention_dt lock_dt lock_dt_flush lock_dt_flushlocal 
           racc_local_comp rput_local_comp win_shared_create win_shared_put_flush_get win_shared_rma_flush_load
-          wrma_flush_get)
+          wrma_flush_get rget-testall)
   set(examples_src  ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${file}.c)
 endforeach()
 
diff --git a/teshsuite/smpi/mpich3-test/rma/rget-testall.c b/teshsuite/smpi/mpich3-test/rma/rget-testall.c
new file mode 100644 (file)
index 0000000..4f3eec2
--- /dev/null
@@ -0,0 +1,75 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2017 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include <stdio.h>
+#include <mpi.h>
+#include "mpitest.h"
+
+/* This test checks request-based get with MPI_Testall. Both the return value of
+ * MPI_Testall and status.MPI_ERROR should be correctly set.
+ *
+ * Thanks for Joseph Schuchart reporting this bug in MPICH and contributing
+ * the prototype of this test program. */
+
+int main(int argc, char **argv)
+{
+    int rank, size;
+    MPI_Win win = MPI_WIN_NULL;
+    int *baseptr = NULL;
+    int errs = 0, mpi_errno = MPI_SUCCESS;
+    int val1 = 0, val2 = 0, flag = 0;
+    MPI_Request reqs[2];
+    MPI_Status stats[2];
+
+    MTest_Init(&argc, &argv);
+    MPI_Comm_size(MPI_COMM_WORLD, &size);
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+    MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+
+    MPI_Win_allocate(2 * sizeof(int), sizeof(int), MPI_INFO_NULL, MPI_COMM_WORLD, &baseptr, &win);
+
+    /* Initialize window buffer */
+    MPI_Win_lock(MPI_LOCK_EXCLUSIVE, rank, 0, win);
+    baseptr[0] = 1;
+    baseptr[1] = 2;
+    MPI_Win_unlock(rank, win);
+
+    /* Issue request-based get with testall. */
+    MPI_Win_lock_all(0, win);
+    MPI_Rget(&val1, 1, MPI_INT, 0, 0, 1, MPI_INT, win, &reqs[0]);
+    MPI_Rget(&val2, 1, MPI_INT, 0, 1, 1, MPI_INT, win, &reqs[1]);
+
+    do {
+        mpi_errno = MPI_Testall(2, reqs, &flag, stats);
+    } while (flag == 0);
+
+    /* Check get value. */
+    if (val1 != 1 || val2 != 2) {
+        printf("%d - Got val1 = %d, val2 = %d, expected 1, 2\n", rank, val1, val2);
+        fflush(stdout);
+        errs++;
+    }
+
+    /* Check return error code. */
+    if (mpi_errno != MPI_SUCCESS) {
+        printf("%d - Got return errno %d, expected MPI_SUCCESS(%d)\n",
+               rank, mpi_errno, MPI_SUCCESS);
+        fflush(stdout);
+        errs++;
+    }
+
+    MPI_Win_unlock_all(win);
+    MPI_Barrier(MPI_COMM_WORLD);
+
+    MPI_Win_free(&win);
+
+    MTest_Finalize(errs);
+    MPI_Finalize();
+
+    return errs != 0;
+}
index 3cf6fc8..527b45b 100644 (file)
@@ -164,6 +164,7 @@ large-small-acc 2
 #overlap_wins_fop 3
 #overlap_wins_cas 3
 lock_nested 3
+rget-testall 2
 
 ## This test is not strictly correct.  This was meant to test out the
 ## case when MPI_Test is not nonblocking.  However, we ended up