Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't build useless temporary object (sonar, c++17).
[simgrid.git] / src / smpi / internals / smpi_deployment.cpp
index ff50710..921f3c0 100644 (file)
@@ -26,9 +26,9 @@ public:
     auto* group = new simgrid::smpi::Group(size_);
     comm_world_ = new simgrid::smpi::Comm(group, nullptr, false, -1);
     universe_size += max_no_processes;
-    bar_ = std::make_shared<s4u::Barrier>(size_);
+    bar_ = s4u::Barrier::create(size_);
   }
-  std::shared_ptr<s4u::Barrier> bar_;
+  s4u::BarrierPtr bar_;
   unsigned int size_;
   unsigned int finalized_ranks_ = 0;
   MPI_Comm comm_world_;
@@ -56,9 +56,7 @@ void SMPI_app_instance_register(const char *name, xbt_main_func_t code, int num_
   if (code != nullptr) // When started with smpirun, we will not execute a function
     simgrid::s4u::Engine::get_instance()->register_function(name, code);
 
-  Instance instance(num_processes);
-
-  smpi_instances.insert(std::pair<std::string, Instance>(name, instance));
+  smpi_instances.try_emplace(name, num_processes);
 }
 
 void smpi_deployment_register_process(const std::string& instance_id, int rank, const simgrid::s4u::Actor* actor)