Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2023.
[simgrid.git] / src / smpi / colls / scatter / scatter-mvapich-two-level.cpp
index a762ce1..4319efc 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2020. 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
@@ -43,8 +43,7 @@ extern int (*MV2_Scatter_intra_function) (const void *sendbuf, int sendcount, MP
     void *recvbuf, int recvcount, MPI_Datatype recvtype,
     int root, MPI_Comm comm);
 
-namespace simgrid{
-namespace smpi{
+namespace simgrid::smpi {
 
 int scatter__mvapich2_two_level_direct(const void *sendbuf,
                                        int sendcnt,
@@ -65,7 +64,7 @@ int scatter__mvapich2_two_level_direct(const void *sendbuf,
     int leader_root, leader_of_root = -1;
     MPI_Comm shmem_comm, leader_comm;
     //if not set (use of the algo directly, without mvapich2 selector)
-    if(MV2_Scatter_intra_function==NULL)
+    if (MV2_Scatter_intra_function == nullptr)
       MV2_Scatter_intra_function = scatter__mpich;
 
     if(comm->get_leaders_comm()==MPI_COMM_NULL){
@@ -142,8 +141,8 @@ int scatter__mvapich2_two_level_direct(const void *sendbuf,
 
         if (leader_comm_size > 1 && local_rank == 0) {
           if (not comm->is_uniform()) {
-            int* displs   = NULL;
-            int* sendcnts = NULL;
+            int* displs   = nullptr;
+            int* sendcnts = nullptr;
             int* node_sizes;
             int i      = 0;
             node_sizes = comm->get_non_uniform_map();
@@ -244,7 +243,7 @@ int scatter__mvapich2_two_level_binomial(const void *sendbuf,
 
 
     //if not set (use of the algo directly, without mvapich2 selector)
-    if(MV2_Scatter_intra_function==NULL)
+    if (MV2_Scatter_intra_function == nullptr)
       MV2_Scatter_intra_function = scatter__mpich;
 
     if(comm->get_leaders_comm()==MPI_COMM_NULL){
@@ -318,8 +317,8 @@ int scatter__mvapich2_two_level_binomial(const void *sendbuf,
 
         if (leader_comm_size > 1 && local_rank == 0) {
           if (not comm->is_uniform()) {
-            int* displs   = NULL;
-            int* sendcnts = NULL;
+            int* displs   = nullptr;
+            int* sendcnts = nullptr;
             int* node_sizes;
             int i      = 0;
             node_sizes = comm->get_non_uniform_map();
@@ -401,6 +400,4 @@ int scatter__mvapich2_two_level_binomial(const void *sendbuf,
     return (mpi_errno);
 }
 
-}
-}
-
+} // namespace simgrid::smpi