]> AND Public Git Repository - simgrid.git/blobdiff - src/smpi/colls/allgather/allgather-2dmesh.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2023.
[simgrid.git] / src / smpi / colls / allgather / allgather-2dmesh.cpp
index 0a774ada8730378cebe526aeafd6335f88503ac2..54b7d745bcca32338201a6972f718ba010ef0334 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2019. The SimGrid Team.
+/* Copyright (c) 2013-2023. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -53,7 +53,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
  * Function: is_2dmesh
 
- * Return: int
+ * Return: bool
 
  * Inputs:
      num: the number of processors in a communicator
@@ -66,7 +66,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ****************************************************************************/
 #ifndef TWOD
 #define TWOD
-static int is_2dmesh(int num, int *i, int *j)
+static bool is_2dmesh(int num, int* i, int* j)
 {
   int x, max = num / 2;
   x = sqrt(double(num));
@@ -82,11 +82,11 @@ static int is_2dmesh(int num, int *i, int *j)
         *j = x;
       }
 
-      return 1;
+      return true;
     }
     x++;
   }
-  return 0;
+  return false;
 }
 #endif
 /*****************************************************************************
@@ -106,9 +106,7 @@ static int is_2dmesh(int num, int *i, int *j)
  * Author: Ahmad Faraj
 ****************************************************************************/
 
-namespace simgrid{
-namespace smpi{
-
+namespace simgrid::smpi {
 
 int
 allgather__2dmesh(const void *send_buff, int send_count, MPI_Datatype
@@ -139,7 +137,7 @@ allgather__2dmesh(const void *send_buff, int send_count, MPI_Datatype
   if (Y > X)
     num_reqs = Y;
 
-  MPI_Request* req     = new MPI_Request[num_reqs];
+  auto* req            = new MPI_Request[num_reqs];
   MPI_Request* req_ptr = req;
 
   // do local allgather/local copy
@@ -196,5 +194,4 @@ allgather__2dmesh(const void *send_buff, int send_count, MPI_Datatype
   return MPI_SUCCESS;
 }
 
-}
-}
+} // namespace simgrid::smpi