Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move MPI_COMM_WORLD to smpi_comm.cpp.
authorAugustin Degomme <adegomme@users.noreply.github.com>
Mon, 8 Mar 2021 08:10:52 +0000 (09:10 +0100)
committerAugustin Degomme <adegomme@users.noreply.github.com>
Mon, 8 Mar 2021 08:10:52 +0000 (09:10 +0100)
It's better here.

src/smpi/internals/smpi_global.cpp
src/smpi/mpi/smpi_comm.cpp

index 5cf7025..7764fa5 100644 (file)
@@ -74,17 +74,7 @@ static int smpi_exit_status = 0;
 extern double smpi_total_benched_time;
 xbt_os_timer_t global_timer;
 static std::vector<std::string> privatize_libs_paths;
-/**
- * Setting MPI_COMM_WORLD to MPI_COMM_UNINITIALIZED (it's a variable)
- * is important because the implementation of MPI_Comm checks
- * "this == MPI_COMM_UNINITIALIZED"? If yes, it uses smpi_process()->comm_world()
- * instead of "this".
- * This is basically how we only have one global variable but all processes have
- * different communicators (the one their SMPI instance uses).
- *
- * See smpi_comm.cpp and the functions therein for details.
- */
-MPI_Comm MPI_COMM_WORLD = MPI_COMM_UNINITIALIZED;
+
 // No instance gets manually created; check also the smpirun.in script as
 // this default name is used there as well (when the <actor> tag is generated).
 static const std::string smpi_default_instance_name("smpirun");
index 3ce4890..1722cec 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_comm, smpi, "Logging specific to SMPI (comm)");
 
-simgrid::smpi::Comm mpi_MPI_COMM_UNINITIALIZED;
-MPI_Comm MPI_COMM_UNINITIALIZED=&mpi_MPI_COMM_UNINITIALIZED;
+simgrid::smpi::Comm smpi_MPI_COMM_UNINITIALIZED;
+MPI_Comm MPI_COMM_UNINITIALIZED=&smpi_MPI_COMM_UNINITIALIZED;
+/**
+ * Setting MPI_COMM_WORLD to MPI_COMM_UNINITIALIZED (it's a variable)
+ * is important because the implementation of MPI_Comm checks
+ * "this == MPI_COMM_UNINITIALIZED"? If yes, it uses smpi_process()->comm_world()
+ * instead of "this".
+ * This is basically how we only have one global variable but all processes have
+ * different communicators (the one their SMPI instance uses).
+ *
+ */
+MPI_Comm MPI_COMM_WORLD = MPI_COMM_UNINITIALIZED;
 
 /* Support for cartesian topology was added, but there are 2 other types of topology, graph et dist graph. In order to
  * support them, we have to add a field SMPI_Topo_type, and replace the MPI_Topology field by an union. */