Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
see if that pleases scan-build
authorAugustin Degomme <augustin.degomme@unibas.ch>
Sat, 2 Sep 2017 18:38:24 +0000 (20:38 +0200)
committerAugustin Degomme <augustin.degomme@unibas.ch>
Sat, 2 Sep 2017 18:38:24 +0000 (20:38 +0200)
src/smpi/bindings/smpi_pmpi_request.cpp
src/smpi/colls/smpi_mvapich2_selector.cpp
src/smpi/mpi/smpi_win.cpp

index 926b55c..c8ef0ec 100644 (file)
@@ -645,6 +645,9 @@ int PMPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * sta
 {
   if (index == nullptr)
     return MPI_ERR_ARG;
+  
+  if (count <= 0)
+    return MPI_SUCCESS;
 
   smpi_bench_end();
   //save requests information for tracing
@@ -656,9 +659,9 @@ int PMPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * sta
     MPI_Comm comm;
   } savedvalstype;
   savedvalstype* savedvals=nullptr;
-  if(count>0){
-    savedvals = xbt_new0(savedvalstype, count);
-  }
+
+  savedvals = xbt_new0(savedvalstype, count);
+
   for (int i = 0; i < count; i++) {
     MPI_Request req = requests[i];      //already received requests are no longer valid
     if (req) {
index 837584f..1d6978c 100644 (file)
@@ -64,7 +64,7 @@ int Coll_alltoall_mvapich2::alltoall( void *sendbuf, int sendcount,
           ||nbytes > mv2_alltoall_thresholds_table[conf_index][range].in_place_algo_table[range_threshold].max
       ) {
           tmp_buf = (char *)smpi_get_tmp_sendbuffer( comm_size * recvcount * recvtype_size );
-          mpi_errno = Datatype::copy((char *)recvbuf,
+          Datatype::copy((char *)recvbuf,
               comm_size*recvcount, recvtype,
               (char *)tmp_buf,
               comm_size*recvcount, recvtype);
@@ -622,11 +622,9 @@ int Coll_bcast_mvapich2::bcast(void *buffer,
         {
             shmem_comm = comm->get_intra_comm();
             if (not is_contig || not is_homogeneous) {
-              mpi_errno = MPIR_Bcast_tune_inter_node_helper_MV2(tmp_buf, nbytes, MPI_BYTE, root, comm);
+              MPIR_Bcast_tune_inter_node_helper_MV2(tmp_buf, nbytes, MPI_BYTE, root, comm);
             } else {
-                mpi_errno =
-                    MPIR_Bcast_tune_inter_node_helper_MV2(buffer, count, datatype, root,
-                                                          comm);
+              MPIR_Bcast_tune_inter_node_helper_MV2(buffer, count, datatype, root, comm);
             }
 
             /* We are now done with the inter-node phase */
@@ -847,7 +845,7 @@ int Coll_reduce_scatter_mvapich2::reduce_scatter(void *sendbuf, void *recvbuf, i
       while (pof2 < comm_size) pof2 <<= 1;
       if (pof2 == comm_size && is_block_regular) {
           /* noncommutative, pof2 size, and block regular */
-          mpi_errno = MPIR_Reduce_scatter_non_comm_MV2(sendbuf, recvbuf,
+          MPIR_Reduce_scatter_non_comm_MV2(sendbuf, recvbuf,
               recvcnts, datatype,
               op, comm);
       }
index f976108..02c7765 100644 (file)
@@ -413,7 +413,7 @@ int Win::compare_and_swap(void *origin_addr, void *compare_addr,
   }
 
   XBT_DEBUG("Entering MPI_Compare_and_swap with %d", target_rank);
-  MPI_Request req;
+  MPI_Request req = MPI_REQUEST_NULL;
   xbt_mutex_acquire(send_win->atomic_mut_);
   get(result_addr, 1, datatype, target_rank,
               target_disp, 1, datatype, &req);