Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid
[simgrid.git] / src / smpi / internals / smpi_deployment.cpp
index 921f3c0..93ebff4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2022. The SimGrid Team.
+/* Copyright (c) 2004-2023. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -13,9 +13,7 @@
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi);
 
-namespace simgrid {
-namespace smpi {
-namespace app {
+namespace simgrid::smpi::app {
 
 static int universe_size = 0;
 
@@ -33,9 +31,7 @@ public:
   unsigned int finalized_ranks_ = 0;
   MPI_Comm comm_world_;
 };
-}
-}
-}
+} // namespace simgrid::smpi::app
 
 using simgrid::smpi::app::Instance;
 
@@ -93,9 +89,8 @@ MPI_Comm* smpi_deployment_comm_world(const std::string& instance_id)
 }
 
 void smpi_deployment_cleanup_instances(){
-  for (auto const& item : smpi_instances) {
-    XBT_INFO("Stalling SMPI instance: %s. Do all your MPI ranks call MPI_Finalize()?", item.first.c_str());
-    Instance instance = item.second;
+  for (auto const& [name, instance] : smpi_instances) {
+    XBT_INFO("Stalling SMPI instance: %s. Do all your MPI ranks call MPI_Finalize()?", name.c_str());
     simgrid::smpi::Comm::destroy(instance.comm_world_);
   }
   smpi_instances.clear();