Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2022.
[simgrid.git] / src / smpi / internals / smpi_utils.cpp
index bff153d..837cedf 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016-2021. The SimGrid Team.
+/* Copyright (c) 2016-2022. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -6,16 +6,15 @@
 
 #include "smpi_utils.hpp"
 
-#include "src/surf/xml/platf_private.hpp"
+#include "private.hpp"
+#include "smpi_config.hpp"
+#include "src/surf/xml/platf.hpp"
+#include "xbt/file.hpp"
 #include "xbt/log.h"
 #include "xbt/parse_units.hpp"
 #include "xbt/sysdep.h"
-#include "xbt/file.hpp"
-#include <boost/tokenizer.hpp>
-#include "smpi_config.hpp"
-#include "src/simix/smx_private.hpp"
 #include <algorithm>
-#include "private.hpp"
+#include <boost/tokenizer.hpp>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_utils, smpi, "Logging specific to SMPI (utils)");
 
@@ -66,14 +65,14 @@ std::vector<s_smpi_factor_t> parse_factor(const std::string& smpi_coef_string)
    * E --> F
    * G --> H
    */
-  for (Tokenizer::iterator token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) {
+  for (auto token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) {
     XBT_DEBUG("token: %s", token_iter->c_str());
     Tokenizer factor_values(*token_iter, factor_separator);
     s_smpi_factor_t fact;
     xbt_assert(factor_values.begin() != factor_values.end(), "Malformed radical for smpi factor: '%s'",
                smpi_coef_string.c_str());
     unsigned int iteration = 0;
-    for (Tokenizer::iterator factor_iter = factor_values.begin(); factor_iter != factor_values.end(); ++factor_iter) {
+    for (auto factor_iter = factor_values.begin(); factor_iter != factor_values.end(); ++factor_iter) {
       iteration++;
 
       if (factor_iter == factor_values.begin()) { /* first element */
@@ -321,11 +320,14 @@ void set_current_buffer(int i, const char* name, const void* buf){
   }
 }
 
-void print_buffer_info(){
-    if(not current_buffer1.name.empty())
-      XBT_INFO("Buffer %s was allocated from %s line %d, with size %zu", current_buffer1.name.c_str(), current_buffer1.alloc.file.c_str(), current_buffer1.alloc.line, current_buffer1.alloc.size);
-    if(not current_buffer2.name.empty())
-      XBT_INFO("Buffer %s was allocated from %s line %d, with size %zu", current_buffer2.name.c_str(), current_buffer2.alloc.file.c_str(), current_buffer2.alloc.line, current_buffer2.alloc.size);    
+void print_buffer_info()
+{
+  if (not current_buffer1.name.empty())
+    XBT_INFO("Buffer %s was allocated from %s line %d, with size %zu", current_buffer1.name.c_str(),
+             current_buffer1.alloc.file.c_str(), current_buffer1.alloc.line, current_buffer1.alloc.size);
+  if (not current_buffer2.name.empty())
+    XBT_INFO("Buffer %s was allocated from %s line %d, with size %zu", current_buffer2.name.c_str(),
+             current_buffer2.alloc.file.c_str(), current_buffer2.alloc.line, current_buffer2.alloc.size);
 }
 
 size_t get_buffer_size(const void* buf){