]> AND Public Git Repository - simgrid.git/blobdiff - src/smpi/colls/reduce/reduce-mvapich-knomial.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of framagit.org:simgrid/simgrid
[simgrid.git] / src / smpi / colls / reduce / reduce-mvapich-knomial.cpp
index d2c91dec525ddb6901ac55d727047e87d88a2c47..05da8517e76f76705396a39fcb85caed181b0f8e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2020. The SimGrid Team.
+/* Copyright (c) 2013-2021. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -57,7 +57,7 @@ static int MPIR_Reduce_knomial_trace(int root, int reduce_knomial_factor,
     int mask=0x1, k, comm_size, src, rank, relative_rank, lroot=0;
     int orig_mask=0x1;
     int recv_iter=0, send_iter=0;
-    int *knomial_reduce_src_array=NULL;
+    int* knomial_reduce_src_array = nullptr;
     comm_size =  comm->size();
     rank = comm->rank();
 
@@ -135,7 +135,7 @@ int reduce__mvapich2_knomial(
     MPI_Aint true_lb, true_extent, extent;
     MPI_Status status;
     int recv_iter=0, dst=-1, expected_send_count, expected_recv_count;
-    int *src_array=NULL;
+    int* src_array = nullptr;
 
     if (count == 0) return MPI_SUCCESS;
 
@@ -173,8 +173,8 @@ int reduce__mvapich2_knomial(
            &dst, &expected_send_count, &expected_recv_count, &src_array);
 
     if(expected_recv_count > 0 ) {
-      unsigned char** tmp_buf = new unsigned char*[expected_recv_count];
-      MPI_Request* requests = new MPI_Request[expected_recv_count];
+      auto** tmp_buf = new unsigned char*[expected_recv_count];
+      auto* requests = new MPI_Request[expected_recv_count];
       for (k = 0; k < expected_recv_count; k++) {
         tmp_buf[k] = smpi_get_tmp_sendbuffer(count * std::max(extent, true_extent));
         tmp_buf[k] = tmp_buf[k] - true_lb;
@@ -207,7 +207,7 @@ int reduce__mvapich2_knomial(
         delete[] requests;
     }
 
-    if(src_array != NULL) {
+    if (src_array != nullptr) {
       delete[] src_array;
     }