Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Properly register the waiter in wait_any_for(), so that it gets handled on suspend...
[simgrid.git] / src / smpi / colls / bcast / bcast-mvapich-smp.cpp
index ca2b73963749c02cdfa1664ed0e4e36083248460..8c540ab384cdd447656f38032a6f24627fbf4cd7 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
@@ -48,7 +48,6 @@ extern int mv2_pipelined_zcpy_knomial_factor;
 extern int bcast_segment_size;
 extern int mv2_inter_node_knomial_factor;
 extern int mv2_intra_node_knomial_factor;
-extern int mv2_bcast_two_level_system_size;
 #define INTRA_NODE_ROOT 0
 
 #define MPIR_Pipelined_Bcast_Zcpy_MV2 bcast__mpich
@@ -73,8 +72,7 @@ extern int mv2_intra_node_knomial_factor;
 #define mv2_bcast_large_msg            512*1024
 #define mv2_knomial_intra_node_threshold 131072
 #define mv2_scatter_rd_inter_leader_bcast 1
-namespace simgrid {
-namespace smpi {
+namespace simgrid::smpi {
 int bcast__mvapich2_inter_node(void *buffer,
                                int count,
                                MPI_Datatype datatype,
@@ -91,12 +89,11 @@ int bcast__mvapich2_inter_node(void *buffer,
     rank = comm->rank();
     //comm_size = comm->size();
 
-
-    if (MV2_Bcast_function==NULL){
+    if (MV2_Bcast_function == nullptr) {
       MV2_Bcast_function = bcast__mpich;
     }
 
-    if (MV2_Bcast_intra_node_function==NULL){
+    if (MV2_Bcast_intra_node_function == nullptr) {
       MV2_Bcast_intra_node_function = bcast__mpich;
     }
 
@@ -179,11 +176,11 @@ int bcast__mvapich2_knomial_intra_node(void *buffer,
     int mpi_errno = MPI_SUCCESS;
     int src, dst, mask, relative_rank;
     int k;
-    if (MV2_Bcast_function==NULL){
+    if (MV2_Bcast_function == nullptr) {
       MV2_Bcast_function = bcast__mpich;
     }
 
-    if (MV2_Bcast_intra_node_function==NULL){
+    if (MV2_Bcast_intra_node_function == nullptr) {
       MV2_Bcast_intra_node_function = bcast__mpich;
     }
 
@@ -194,9 +191,9 @@ int bcast__mvapich2_knomial_intra_node(void *buffer,
     local_size = comm->size();
     rank = comm->rank();
 
-    MPI_Request* reqarray = new MPI_Request[2 * mv2_intra_node_knomial_factor];
+    auto* reqarray = new MPI_Request[2 * mv2_intra_node_knomial_factor];
 
-    MPI_Status* starray = new MPI_Status[2 * mv2_intra_node_knomial_factor];
+    auto* starray = new MPI_Status[2 * mv2_intra_node_knomial_factor];
 
     /* intra-node k-nomial bcast  */
     if (local_size > 1) {
@@ -259,11 +256,11 @@ int bcast__mvapich2_intra_node(void *buffer,
 
     if (count == 0)
         return MPI_SUCCESS;
-    if (MV2_Bcast_function==NULL){
+    if (MV2_Bcast_function == nullptr) {
       MV2_Bcast_function = bcast__mpich;
     }
 
-    if (MV2_Bcast_intra_node_function==NULL){
+    if (MV2_Bcast_intra_node_function == nullptr) {
       MV2_Bcast_intra_node_function = bcast__mpich;
     }
 
@@ -381,5 +378,4 @@ int bcast__mvapich2_intra_node(void *buffer,
 
 }
 
-}
-}
+} // namespace simgrid::smpi