Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 7 Sep 2015 19:37:08 +0000 (21:37 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 7 Sep 2015 19:37:08 +0000 (21:37 +0200)
36 files changed:
contrib/deployment_generation/generate_random_deployment.pl
contrib/network_model/regression2.py
examples/java/bittorrent/generate.py
examples/msg/bittorrent/generate.py
examples/msg/chord/generate.py
examples/msg/kademlia/generate.py
examples/platforms/conf/transform_optorsim_platform.pl
examples/platforms/generation_scripts/create_hierarchical_clusters.pl
examples/platforms/generation_scripts/enhancedDTDwithHierarchicalCluster.pl
examples/platforms/generation_scripts/generate_g5k_platform.pl
examples/platforms/generation_scripts/generate_g5k_platform_cabinets.pl
examples/platforms/syscoord/generate_peer_platform.pl
examples/simdag/dax/generate_forkjoin.pl
examples/simdag/dax/generate_strassen.pl
src/mc/mc_dwarf.cpp
src/mc/mc_dwarf_expression.cpp
src/smpi/fixsrc.pl
teshsuite/smpi/mpich3-test/checktests
teshsuite/smpi/mpich3-test/runtests
tools/MSG_visualization/colorize.pl
tools/MSG_visualization/trace2fig.pl
tools/cmake/Scripts/generate_memcheck_tests.pl
tools/cmake/Scripts/my_valgrind.pl
tools/cmake/Scripts/update_tesh.pl
tools/doxygen/fig2dev_postprocessor.pl
tools/doxygen/index_create.pl
tools/doxygen/xbt_log_extract_hierarchy.pl
tools/internal/generate-multi-jar.py
tools/internal/spell_comments.pl
tools/normalize-pointers.py
tools/sg_unit_extractor.pl
tools/stack-cleaner/as
tools/stack-cleaner/clean-stack-filter
tools/stack-cleaner/compiler-wrapper
tools/tesh/colorize.pl
tools/tesh/tesh.pl

index b160b3f..bd353fa 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
 # Copyright (c) 2009, 2011, 2014. The SimGrid Team.
 # All rights reserved.
@@ -7,6 +7,7 @@
 # under the terms of the license (GNU LGPL) which comes with this package.
 
 use strict;
+use warnings;
 
 sub melange {
     my $tableau=shift;
index f314d9e..fc4e84b 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 # Copyright (c) 2011, 2014. The SimGrid Team.
 # All rights reserved.
index d4ea09e..155957f 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 # Copyright (c) 2013-2014. The SimGrid Team.
 # All rights reserved.
index f3460bb..7f0d6d4 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 # Copyright (c) 2012, 2014. The SimGrid Team.
 # All rights reserved.
index afc0ea9..3b707ac 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 # Copyright (c) 2011-2012, 2014. The SimGrid Team.
 # All rights reserved.
index b475120..1b9526c 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 # Copyright (c) 2012, 2014. The SimGrid Team.
 # All rights reserved.
index 7e5369a..d2db4d9 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
 # Copyright (c) 2011, 2014. The SimGrid Team.
 # All rights reserved.
@@ -7,6 +7,7 @@
 # under the terms of the license (GNU LGPL) which comes with this package.
 
 use strict;
+use warnings;
 
 if($#ARGV!=0) {
     die "Usage: perl transfrom_optorsim_platform.pl <file.conf>\n";
index 023ffac..048143f 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
 # Copyright (c) 2011, 2014. The SimGrid Team.
 # All rights reserved.
@@ -7,6 +7,7 @@
 # under the terms of the license (GNU LGPL) which comes with this package.
 
 use strict;
+use warnings;
 use Switch;
 my $toversion=3;
 
index 2205650..9f3818e 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
 # Copyright (c) 2011, 2014. The SimGrid Team.
 # All rights reserved.
@@ -7,6 +7,7 @@
 # under the terms of the license (GNU LGPL) which comes with this package.
 
 use strict;
+use warnings;
 use Switch;
 
 my $site="";
index a01bceb..7b530e3 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
 # Copyright (c) 2011, 2014. The SimGrid Team.
 # All rights reserved.
@@ -7,6 +7,7 @@
 # under the terms of the license (GNU LGPL) which comes with this package.
 
 use strict;
+use warnings;
 
 my $toversion=3;
 my $nb_peer = $ARGV[0];
index aafcab1..545ccf9 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#! /usr/bin/env perl
 
 # Copyright (c) 2009, 2014. The SimGrid Team.
 # All rights reserved.
index ec59f83..060f899 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#! /usr/bin/env perl
 
 # Copyright (c) 2009, 2014. The SimGrid Team.
 # All rights reserved.
index 9283528..3b8e900 100644 (file)
@@ -276,30 +276,26 @@ static const char *MC_dwarf_at_linkage_name(Dwarf_Die * die)
 static Dwarf_Off MC_dwarf_attr_dieoffset(Dwarf_Die * die, int attribute)
 {
   Dwarf_Attribute attr;
-  if (dwarf_hasattr_integrate(die, attribute)) {
-    dwarf_attr_integrate(die, attribute, &attr);
-    Dwarf_Die subtype_die;
-    if (dwarf_formref_die(&attr, &subtype_die) == NULL) {
-      xbt_die("Could not find DIE");
-    }
-    return dwarf_dieoffset(&subtype_die);
-  } else
+  if (dwarf_hasattr_integrate(die, attribute) == 0)
     return 0;
+  dwarf_attr_integrate(die, attribute, &attr);
+  Dwarf_Die subtype_die;
+  if (dwarf_formref_die(&attr, &subtype_die) == NULL)
+    xbt_die("Could not find DIE");
+  return dwarf_dieoffset(&subtype_die);
 }
 
 static Dwarf_Off MC_dwarf_attr_integrate_dieoffset(Dwarf_Die * die,
                                                    int attribute)
 {
   Dwarf_Attribute attr;
-  if (dwarf_hasattr_integrate(die, attribute)) {
-    dwarf_attr_integrate(die, DW_AT_type, &attr);
-    Dwarf_Die subtype_die;
-    if (dwarf_formref_die(&attr, &subtype_die) == NULL) {
-      xbt_die("Could not find DIE");
-    }
-    return dwarf_dieoffset(&subtype_die);
-  } else
+  if (dwarf_hasattr_integrate(die, attribute) == 0)
     return 0;
+  dwarf_attr_integrate(die, DW_AT_type, &attr);
+  Dwarf_Die subtype_die;
+  if (dwarf_formref_die(&attr, &subtype_die) == NULL)
+    xbt_die("Could not find DIE");
+  return dwarf_dieoffset(&subtype_die);
 }
 
 /** \brief Find the type/subtype (DW_AT_type) for a DIE
@@ -404,24 +400,22 @@ static uint64_t MC_dwarf_subrange_element_count(Dwarf_Die * die,
              MC_dwarf_die_tagname(die));
 
   // Use DW_TAG_count if present:
-  if (dwarf_hasattr_integrate(die, DW_AT_count)) {
+  if (dwarf_hasattr_integrate(die, DW_AT_count))
     return MC_dwarf_attr_integrate_uint(die, DW_AT_count, 0);
-  }
   // Otherwise compute DW_TAG_upper_bound-DW_TAG_lower_bound + 1:
 
-  if (!dwarf_hasattr_integrate(die, DW_AT_upper_bound)) {
+  if (!dwarf_hasattr_integrate(die, DW_AT_upper_bound))
     // This is not really 0, but the code expects this (we do not know):
     return 0;
-  }
+
   uint64_t upper_bound =
       MC_dwarf_attr_integrate_uint(die, DW_AT_upper_bound, -1);
 
   uint64_t lower_bound = 0;
-  if (dwarf_hasattr_integrate(die, DW_AT_lower_bound)) {
+  if (dwarf_hasattr_integrate(die, DW_AT_lower_bound))
     lower_bound = MC_dwarf_attr_integrate_uint(die, DW_AT_lower_bound, -1);
-  } else {
+  else
     lower_bound = MC_dwarf_default_lower_bound(dwarf_srclang(unit));
-  }
   return upper_bound - lower_bound + 1;
 }
 
@@ -447,9 +441,8 @@ static uint64_t MC_dwarf_array_element_count(Dwarf_Die * die, Dwarf_Die * unit)
        res = dwarf_siblingof(&child, &child)) {
     int child_tag = dwarf_tag(&child);
     if (child_tag == DW_TAG_subrange_type
-        || child_tag == DW_TAG_enumeration_type) {
+        || child_tag == DW_TAG_enumeration_type)
       result *= MC_dwarf_subrange_element_count(&child, unit);
-    }
   }
   return result;
 }
@@ -484,19 +477,16 @@ static bool MC_compare_variable(
 static void MC_dwarf_fill_member_location(simgrid::mc::Type* type, simgrid::mc::Type* member,
                                           Dwarf_Die * child)
 {
-  if (dwarf_hasattr(child, DW_AT_data_bit_offset)) {
+  if (dwarf_hasattr(child, DW_AT_data_bit_offset))
     xbt_die("Can't groke DW_AT_data_bit_offset.");
-  }
 
   if (!dwarf_hasattr_integrate(child, DW_AT_data_member_location)) {
-    if (type->type != DW_TAG_union_type) {
-      xbt_die
-          ("Missing DW_AT_data_member_location field in DW_TAG_member %s of type <%"
-           PRIx64 ">%s", member->name.c_str(),
-           (uint64_t) type->id, type->name.c_str());
-    } else {
+    if (type->type == DW_TAG_union_type)
       return;
-    }
+    xbt_die
+        ("Missing DW_AT_data_member_location field in DW_TAG_member %s of type <%"
+         PRIx64 ">%s", member->name.c_str(),
+         (uint64_t) type->id, type->name.c_str());
   }
 
   Dwarf_Attribute attr;
@@ -510,12 +500,11 @@ static void MC_dwarf_fill_member_location(simgrid::mc::Type* type, simgrid::mc::
     {
       Dwarf_Op *expr;
       size_t len;
-      if (dwarf_getlocation(&attr, &expr, &len)) {
+      if (dwarf_getlocation(&attr, &expr, &len))
         xbt_die
             ("Could not read location expression DW_AT_data_member_location in DW_TAG_member %s of type <%"
              PRIx64 ">%s", MC_dwarf_attr_integrate_string(child, DW_AT_name),
              (uint64_t) type->id, type->name.c_str());
-      }
       simgrid::mc::DwarfExpression(expr, expr+len);
       break;
     }
@@ -585,17 +574,15 @@ static void MC_dwarf_add_members(simgrid::mc::ObjectInformation* info, Dwarf_Die
       member.element_count = -1;
       member.type_id = MC_dwarf_at_type(&child);
 
-      if (dwarf_hasattr(&child, DW_AT_data_bit_offset)) {
+      if (dwarf_hasattr(&child, DW_AT_data_bit_offset))
         xbt_die("Can't groke DW_AT_data_bit_offset.");
-      }
 
       MC_dwarf_fill_member_location(type, &member, &child);
 
-      if (!member.type_id) {
+      if (!member.type_id)
         xbt_die("Missing type for member %s of <%" PRIx64 ">%s",
                 member.name.c_str(),
                 (uint64_t) type->id, type->name.c_str());
-      }
 
       type->members.push_back(std::move(member));
     }
@@ -660,9 +647,8 @@ static simgrid::mc::Type MC_dwarf_die_to_type(
            || type.type == DW_TAG_structure_type
            || type.type == DW_TAG_class_type) {
     Dwarf_Word size;
-    if (dwarf_aggregate_size(die, &size) == 0) {
+    if (dwarf_aggregate_size(die, &size) == 0)
       type.byte_size = size;
-    }
   }
 
   switch (type.type) {
@@ -717,10 +703,9 @@ static std::unique_ptr<simgrid::mc::Variable> MC_die_to_variable(
     return nullptr;
 
   Dwarf_Attribute attr_location;
-  if (dwarf_attr(die, DW_AT_location, &attr_location) == NULL) {
+  if (dwarf_attr(die, DW_AT_location, &attr_location) == NULL)
     // No location: do not add it ?
     return nullptr;
-  }
 
   std::unique_ptr<simgrid::mc::Variable> variable =
     std::unique_ptr<simgrid::mc::Variable>(new simgrid::mc::Variable());
@@ -1008,20 +993,12 @@ void MC_dwarf_get_variables(simgrid::mc::ObjectInformation* info)
   Dwarf_Off offset = 0;
   Dwarf_Off next_offset = 0;
   size_t length;
+
   while (dwarf_nextcu(dwarf, offset, &next_offset, &length, NULL, NULL, NULL) ==
          0) {
     Dwarf_Die unit_die;
-    if (dwarf_offdie(dwarf, offset + length, &unit_die) != NULL) {
-
-      // For each child DIE:
-      Dwarf_Die child;
-      int res;
-      for (res = dwarf_child(&unit_die, &child); res == 0;
-           res = dwarf_siblingof(&child, &child)) {
-        MC_dwarf_handle_die(info, &child, &unit_die, NULL, NULL);
-      }
-
-    }
+    if (dwarf_offdie(dwarf, offset + length, &unit_die) != NULL)
+      MC_dwarf_handle_children(info, &unit_die, &unit_die, NULL, NULL);
     offset = next_offset;
   }
 
@@ -1073,10 +1050,9 @@ static void MC_post_process_variables(simgrid::mc::ObjectInformation* info)
     MC_compare_variable);
 
   for(simgrid::mc::Variable& variable : info->global_variables)
-    if (variable.type_id) {
+    if (variable.type_id)
       variable.type = simgrid::util::find_map_ptr(
         info->types, variable.type_id);
-    }
 }
 
 static void mc_post_process_scope(simgrid::mc::ObjectInformation* info, simgrid::mc::Frame* scope)
@@ -1093,10 +1069,9 @@ static void mc_post_process_scope(simgrid::mc::ObjectInformation* info, simgrid:
 
   // Direct:
   for (simgrid::mc::Variable& variable : scope->variables)
-    if (variable.type_id) {
+    if (variable.type_id)
       variable.type = simgrid::util::find_map_ptr(
         info->types, variable.type_id);
-    }
 
   // Recursive post-processing of nested-scopes:
   for (simgrid::mc::Frame& nested_scope : scope->scopes)
@@ -1162,13 +1137,13 @@ void MC_post_process_object_info(simgrid::mc::Process* process, simgrid::mc::Obj
 
     simgrid::mc::Type* type = &(i.second);
     simgrid::mc::Type* subtype = type;
-    while (subtype->type == DW_TAG_typedef || subtype->type == DW_TAG_volatile_type
-      || subtype->type == DW_TAG_const_type) {
+    while (subtype->type == DW_TAG_typedef
+        || subtype->type == DW_TAG_volatile_type
+        || subtype->type == DW_TAG_const_type)
       if (subtype->subtype)
         subtype = subtype->subtype;
       else
         break;
-    }
 
     // Resolve full_type:
     if (!subtype->name.empty() && subtype->byte_size == 0) {
index d4926a2..7bf2335 100644 (file)
@@ -38,10 +38,10 @@ static int mc_dwarf_push_value(mc_expression_state_t state, Dwarf_Off value)
  */
 static int mc_dwarf_register_to_libunwind(int dwarf_register)
 {
-#if defined(UNW_TARGET_X86_64)
+#if defined(__x86_64__)
   // It seems for this arch, DWARF and libunwind agree in the numbering:
   return dwarf_register;
-#elif defined(UNW_TARGET_X86)
+#elif defined(__i386__)
   // Could't find the authoritative source of information for this.
   // This is inspired from http://source.winehq.org/source/dlls/dbghelp/cpu_i386.c#L517.
   switch (dwarf_register) {
@@ -170,7 +170,7 @@ int mc_dwarf_execute_expression(size_t n, const Dwarf_Op * ops,
         unw_step(&cursor);
 
         unw_word_t res;
-        unw_get_reg(&cursor, UNW_TDEP_SP, &res);
+        unw_get_reg(&cursor, UNW_REG_SP, &res);
         error = mc_dwarf_push_value(state, res);
         break;
       }
index 2bc55d9..8844d20 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 # Copyright (c) 2011, 2014. The SimGrid Team.
 # All rights reserved.
index ab26692..0c6ed52 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/local/bin/perl
+#! /usr/bin/env perl
 
 $debug   = 1;
 $verbose = 1;
index 8d28884..b356be9 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#! /usr/bin/env perl
 # -*- Mode: perl; -*-
 #
 # This script is the beginnings of a script to run a sequence of test
index b3c5671..db2676b 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 # Copyright (c) 2005, 2007, 2010, 2014. The SimGrid Team.
 # All rights reserved.
index cd23d39..2ac7c85 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
 # Copyright (c) 2006-2007, 2014. The SimGrid Team.
 # All rights reserved.
@@ -7,6 +7,8 @@
 # under the terms of the license (GNU LGPL) which comes with this package.
 
 use strict;
+use warnings;
+
 #use Data::Dumper;
 use XFig;
 use POSIX;
index fc4fd61..d37977a 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
 # Copyright (c) 2012-2014. The SimGrid Team.
 # All rights reserved.
@@ -7,6 +7,7 @@
 # under the terms of the license (GNU LGPL) which comes with this package.
 
 use strict;
+use warnings;
 
 # input file = AddTest.txt
 
index 073b4b8..3b273d5 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
 # Copyright (c) 2012-2014. The SimGrid Team.
 # All rights reserved.
@@ -7,6 +7,8 @@
 # under the terms of the license (GNU LGPL) which comes with this package.
 
 use strict;
+use warnings;
+
 my @argv = ("valgrind");
 my $count = 0;
 
index 7c340b4..5e0a06d 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
 # Copyright (c) 2012, 2014. The SimGrid Team.
 # All rights reserved.
@@ -7,6 +7,7 @@
 # under the terms of the license (GNU LGPL) which comes with this package.
 
 use strict;
+use warnings;
 
 if($#ARGV!=1) {
     die "Usage: perl make_tesh.pl <directory> <old.tesh>\n";
index b5b7d82..d14ce09 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#! /usr/bin/env perl
 
 # Copyright (c) 2010, 2014. The SimGrid Team.
 # All rights reserved.
index f9f58d2..7d23af0 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
 # Copyright (c) 2005, 2012-2014. The SimGrid Team.
 # All rights reserved.
@@ -6,6 +6,8 @@
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the license (GNU LGPL) which comes with this package.
 
+use warnings;
+
 ($#ARGV >= 1) or die "Usage: index_create.pl <input-tag-file> <output-doc-file>";
 
 my($type) = "";
index 40f60ee..ba13f8a 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 # Copyright (c) 2008, 2010, 2012-2014. The SimGrid Team.
 # All rights reserved.
index c200c49..41ec224 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 # Copyright (c) 2013-2014. The SimGrid Team.
 # All rights reserved.
index 5ab5958..7ff91da 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 # Copyright (c) 2013-2015. The SimGrid Team.
 # All rights reserved.
@@ -13,6 +13,7 @@
 # Copyright 2003, Dan Kegel.  Licensed under GPL.  See the file ../COPYING for details.
 
 use strict;
+use warnings;
 
 die "Please install iamerican to use that script." 
   unless (-r "/usr/lib/ispell/american.hash");
index 04049fa..ba78a80 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 # Copyright (c) 2013-2014. The SimGrid Team.
 # All rights reserved.
index 1c29e79..6502ccf 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#! /usr/bin/env perl
 
 # Copyright (c) 2005-2012, 2014. The SimGrid Team.
 # All rights reserved.
index 1a66dd3..46446cb 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/ruby
+#!/usr/bin/env ruby
 # Wrapper around the real `as` which adds filtering capabilities.
 
 require "tempfile"
index a2f91aa..64e7990 100755 (executable)
@@ -1,9 +1,10 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 # Transform assembly in order to clean each stack frame for X86_64.
 
 use strict;
-$SIG{__WARN__} = sub { die @_ };
+use warnings;
 
+$SIG{__WARN__} = sub { die @_ };
 
 # Whether we are still scanning the content of a function:
 our $scanproc = 0;
index 8b8a62f..62504af 100755 (executable)
@@ -1,7 +1,9 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 # Compiler wrapper with stack-cleaner support (enabled by default).
 # Usage: ./compiler-wrapper target-compiler args [-f[no-]stack-cleaner]
 
+use warnings;
+
 use File::Basename;
 
 my $compiler = shift(@ARGV);
index 9cc8d18..88b1f55 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
 # Copyright (c) 2010, 2014. The SimGrid Team.
 # All rights reserved.
@@ -6,6 +6,8 @@
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the license (GNU LGPL) which comes with this package.
 
+use warnings;
+
 use Term::ANSIColor qw{:constants};
 $Term::ANSIColor::AUTORESET = 1;
 
index 2dd685b..e83cbc6 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#! /usr/bin/env perl
 
 # Copyright (c) 2012-2014. The SimGrid Team.
 # All rights reserved.