Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
try to appease ubsan a bit
authordegomme <augustin.degomme@unibas.ch>
Thu, 6 Apr 2017 09:03:23 +0000 (11:03 +0200)
committerdegomme <augustin.degomme@unibas.ch>
Thu, 6 Apr 2017 09:03:33 +0000 (11:03 +0200)
src/smpi/smpi_op.cpp
src/smpi/smpi_request.cpp
teshsuite/smpi/mpich3-test/rma/manyrma2.c
teshsuite/smpi/mpich3-test/rma/rma-contig.c

index a4e42aa..9d14284 100644 (file)
@@ -243,7 +243,7 @@ void Op::apply(void *invec, void *inoutvec, int *len, MPI_Datatype datatype)
     smpi_switch_data_segment(smpi_process()->index());
   }
 
-  if(!smpi_process()->replaying()){
+  if(!smpi_process()->replaying() && *len > 0){
     if(! is_fortran_op_)
       this->func_(invec, inoutvec, len, &datatype);
     else{
index f4d5410..33eaa9a 100644 (file)
@@ -111,9 +111,13 @@ Request::Request(void *buf, int count, MPI_Datatype datatype, int src, int dst,
   if(((((flags & RECV) != 0) && ((flags & ACCUMULATE) !=0)) || (datatype->flags() & DT_FLAG_DERIVED)) && (!smpi_is_shared(buf_))){
     // This part handles the problem of non-contiguous memory
     old_buf = buf;
-    buf_ = count==0 ? nullptr : xbt_malloc(count*datatype->size());
-    if ((datatype->flags() & DT_FLAG_DERIVED) && ((flags & SEND) != 0)) {
-      datatype->serialize(old_buf, buf_, count);
+    if (count==0){
+      buf_ = nullptr;
+    }else {
+      buf_ = xbt_malloc(count*datatype->size());
+      if ((datatype->flags() & DT_FLAG_DERIVED) && ((flags & SEND) != 0)) {
+        datatype->serialize(old_buf, buf_, count);
+      }
     }
   }
   // This part handles the problem of non-contiguous memory (for the unserialisation at the reception)
index c7436bc..f86619e 100644 (file)
@@ -16,7 +16,7 @@
 #include <string.h>
 
 #define MAX_COUNT 512
-#define MAX_RMA_SIZE 2  /* 16 in manyrma performance test */
+#define MAX_RMA_SIZE 1  /* 16 in manyrma performance test */
 #define MAX_RUNS 8
 #define MAX_ITER_TIME  5.0      /* seconds */
 
index 4ca7127..7cc14de 100644 (file)
@@ -20,7 +20,7 @@ static int rank;
 static void run_test(int lock_mode, int lock_assert)
 {
     int nproc, test_iter, target_rank, data_size;
-    int *buf, *win_buf;
+    char *buf, *win_buf;
     MPI_Win win;
 
     MPI_Comm_rank(MPI_COMM_WORLD, &rank);
@@ -101,8 +101,8 @@ static void run_test(int lock_mode, int lock_assert)
                     t_acc = MPI_Wtime();
 
                 MPI_Win_lock(lock_mode, target_rank, lock_assert, win);
-                MPI_Accumulate(buf, data_size / sizeof(int), MPI_INT, target_rank,
-                               0, data_size / sizeof(int), MPI_INT, MPI_SUM, win);
+                MPI_Accumulate(buf, data_size, MPI_BYTE, target_rank,
+                               0, data_size, MPI_BYTE, MPI_SUM, win);
                 MPI_Win_unlock(target_rank, win);
             }
             t_acc = (MPI_Wtime() - t_acc) / num_iter;