Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'pikachuyann/simgrid-stoprofiles'
[simgrid.git] / src / smpi / colls / allgather / allgather-mvapich-smp.cpp
index c8e0600..8297387 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2019. The SimGrid Team.
+/* Copyright (c) 2013-2020. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -100,23 +100,22 @@ int allgather__mvapich2_smp(const void *sendbuf,int sendcnt, MPI_Datatype sendty
     /* Exchange the data between the node leaders*/
     if (local_rank == 0 && (leader_comm_size > 1)) {
         /*When data in each socket is different*/
-        if (comm->is_uniform() != 1) {
+        if (not comm->is_uniform()) {
 
-            int *node_sizes = NULL;
-            int i = 0;
+          int* node_sizes = nullptr;
+          int i           = 0;
 
-            node_sizes = comm->get_non_uniform_map();
+          node_sizes = comm->get_non_uniform_map();
 
-            int* displs   = new int[leader_comm_size];
-            int* recvcnts = new int[leader_comm_size];
-            recvcnts[0] = node_sizes[0] * recvcnt;
-            displs[0] = 0;
-
-            for (i = 1; i < leader_comm_size; i++) {
-                displs[i] = displs[i - 1] + node_sizes[i - 1] * recvcnt;
-                recvcnts[i] = node_sizes[i] * recvcnt;
-            }
+          int* displs   = new int[leader_comm_size];
+          int* recvcnts = new int[leader_comm_size];
+          recvcnts[0]   = node_sizes[0] * recvcnt;
+          displs[0]     = 0;
 
+          for (i = 1; i < leader_comm_size; i++) {
+            displs[i]   = displs[i - 1] + node_sizes[i - 1] * recvcnt;
+            recvcnts[i] = node_sizes[i] * recvcnt;
+          }
 
             void* sendbuf=((char*)recvbuf)+recvtype->get_extent()*displs[leader_comm->rank()];