Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'python_ptask' into 'master'
[simgrid.git] / src / smpi / internals / smpi_utils.cpp
index e4cbc80..967e729 100644 (file)
@@ -22,9 +22,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_utils, smpi, "Logging specific to SMPI (uti
 extern std::string surf_parsed_filename;
 extern int surf_parse_lineno;
 
-namespace simgrid {
-namespace smpi {
-namespace utils {
+namespace simgrid::smpi::utils {
 
 double total_benched_time=0;
 unsigned long total_malloc_size=0;
@@ -113,7 +111,7 @@ void add_benched_time(double time){
   total_benched_time += time;
 }
 
-void account_malloc_size(size_t size, const std::string& file, int line, const void* ptr)
+void account_malloc_size(size_t size, std::string_view file, int line, const void* ptr)
 {
   if (smpi_cfg_display_alloc()) {
     alloc_metadata_t metadata;
@@ -349,8 +347,7 @@ int check_collectives_ordering(MPI_Comm comm, const std::string& call)
 {
   unsigned int count = comm->get_collectives_count();
   comm->increment_collectives_count();
-  auto vec = collective_calls.find(comm->id());
-  if (vec == collective_calls.end()) {
+  if (auto vec = collective_calls.find(comm->id()); vec == collective_calls.end()) {
     collective_calls.try_emplace(comm->id(), std::vector<std::string>{call});
   } else {
     // are we the first ? add the call
@@ -368,6 +365,4 @@ int check_collectives_ordering(MPI_Comm comm, const std::string& call)
   }
   return MPI_SUCCESS;
 }
-}
-}
-} // namespace simgrid
+} // namespace simgrid::smpi::utils