Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of github.com:simgrid/simgrid
authorEhsan Azimi <eazimi@ehsan.irisa.fr>
Mon, 16 Nov 2020 17:16:17 +0000 (18:16 +0100)
committerEhsan Azimi <eazimi@ehsan.irisa.fr>
Mon, 16 Nov 2020 17:16:17 +0000 (18:16 +0100)
12 files changed:
ChangeLog
setup.py
src/instr/instr_paje_containers.cpp
src/instr/instr_paje_types.cpp
src/instr/instr_paje_types.hpp
src/instr/instr_paje_values.hpp
src/instr/instr_private.hpp
src/mc/compare.cpp
src/mc/remote/RemoteSimulation.cpp
src/plugins/vm/VirtualMachineImpl.cpp
src/xbt/exception.cpp
teshsuite/mc/dwarf-expression/dwarf-expression.cpp

index d1b5573..b4aa5e1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -67,6 +67,7 @@ Fixed bugs (FG#.. -> FramaGit bugs; FG!.. -> FG merge requests)
  - FG#48: The Impossible Did Happen (yet again)
  - FG#50: Suspending an actor executed at the current timestamp fails
  - FG#52: Zero-seconds timeout : "That's in the past already"
+ - FG#53: Crash while using ns-3 network model
  - FG#54: How to suspend a comm?
  - FG!22: Stochastic Profiles
  - FG!24: Documentation and fix for xbt/random
@@ -80,6 +81,7 @@ Fixed bugs (FG#.. -> FramaGit bugs; FG!.. -> FG merge requests)
  - GH#336: Packet-level simulation using SMPI?
  - GH#345: Error in the LMM while migrating a VM
  - GH#346: [SMPI] error while loading shared libraries: libsimgrid.so
+ - GH#352: pip install / python setup.py install fail to find pybind11
  - GH!337: Fix link_energy plugin for wifi platforms
  - GH!339: Add Mailbox set_receiver method to python binding
  - GH!344: Cast hugepages macros parameters to int64
index d5475b4..6a7975c 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -47,6 +47,7 @@ class CMakeBuild(build_ext):
             self.build_extension(ext)
 
     def build_extension(self, ext):
+        from pybind11 import get_cmake_dir
         extdir = os.path.abspath(os.path.dirname(
             self.get_ext_fullpath(ext.name)))
         cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir,
@@ -54,7 +55,9 @@ class CMakeBuild(build_ext):
                       '-Denable_smpi=OFF',
                       '-Denable_java=OFF',
                       '-Denable_python=ON',
-                      '-Dminimal-bindings=ON']
+                      '-Dminimal-bindings=ON',
+                      '-Dpybind11_DIR=' + get_cmake_dir()
+                      ]
 
         cfg = 'Debug' if self.debug else 'Release'
         build_args = ['--config', cfg]
index ce91863..dbb271d 100644 (file)
@@ -16,12 +16,6 @@ namespace instr {
 Container* Container::root_container_ = nullptr;              /* the root container */
 std::map<std::string, Container*> Container::all_containers_; /* all created containers indexed by name */
 
-long long int new_paje_id()
-{
-  static long long int type_id = 0;
-  return type_id++;
-}
-
 NetZoneContainer::NetZoneContainer(const std::string& name, unsigned int level, NetZoneContainer* father)
     : Container::Container(name, "", father)
 {
@@ -139,7 +133,6 @@ VariableType* Container::get_variable(const std::string& name)
 EntityValue::EntityValue(const std::string& name, const std::string& color, Type* father)
     : name_(name), color_(color), father_(father)
 {
-  id_ = simgrid::instr::new_paje_id();
   on_creation(*this);
 }
 
index c518588..213c45b 100644 (file)
@@ -15,9 +15,15 @@ static std::set<std::string> platform_variables;
 namespace simgrid {
 namespace instr {
 
+long long int new_paje_id()
+{
+  static long long int type_id = 0;
+  return type_id++;
+}
+
 Type::Type(e_event_type event_type, const std::string& name, const std::string& alias, const std::string& color,
            Type* father)
-    : id_(new_paje_id()), name_(name), color_(color), father_(father)
+    : name_(name), color_(color), father_(father)
 {
   if (name_.empty() || alias.empty())
     throw TracingError(XBT_THROW_POINT, "can't create a new type with no name or alias");
index f4dae73..269175c 100644 (file)
@@ -16,8 +16,10 @@ namespace instr {
 class ContainerType;
 class EventType;
 
+long long int new_paje_id();
+
 class Type {
-  long long int id_;
+  long long int id_ = new_paje_id();
   std::string name_;
   std::string color_;
   Type* father_;
index 1fbcc48..16e716b 100644 (file)
@@ -13,7 +13,7 @@ namespace simgrid {
 namespace instr {
 
 class EntityValue {
-  long long int id_;
+  long long int id_ = new_paje_id();
   std::string name_;
   std::string color_;
   Type* father_;
index 8b5c076..7819f95 100644 (file)
@@ -14,7 +14,6 @@
 #include "src/instr/instr_paje_events.hpp"
 #include "src/instr/instr_paje_types.hpp"
 #include "src/instr/instr_paje_values.hpp"
-#include "xbt/graph.h"
 
 #include <fstream>
 #include <iomanip> /** std::setprecision **/
@@ -45,8 +44,6 @@ extern TraceFormat trace_format;
 extern int trace_precision;
 extern double last_timestamp_to_dump;
 
-long long int new_paje_id();
-
 void init();
 void define_callbacks();
 
index aec0a0c..6baf980 100644 (file)
@@ -748,7 +748,6 @@ static bool heap_area_differ(StateComparator& state, const void* area1, const vo
   int new_size2 = -1;
 
   Type* new_type1 = nullptr;
-  Type* new_type2 = nullptr;
 
   bool match_pairs = false;
 
@@ -925,10 +924,12 @@ static bool heap_area_differ(StateComparator& state, const void* area1, const vo
 
     // The type of the variable is already known:
     if (type) {
-      new_type1 = new_type2 = type;
+      new_type1 = type;
     }
     // Type inference from the block type.
     else if (state.types_<1>(block1, frag1) != nullptr || state.types_<2>(block2, frag2) != nullptr) {
+      Type* new_type2 = nullptr;
+
       offset1 = (const char*)area1 - (const char*)real_addr_frag1;
       offset2 = (const char*)area2 - (const char*)real_addr_frag2;
 
index b9238aa..b9abdbe 100644 (file)
@@ -86,6 +86,7 @@ static const std::vector<std::string> filtered_libraries = {
     "liblua5.3",
     "liblzma",
     "libm",
+    "libmd",
     "libnghttp2",
     "libomp",
     "libpapi",
index 1bb1944..b95cc55 100644 (file)
@@ -173,7 +173,7 @@ VirtualMachineImpl::VirtualMachineImpl(simgrid::s4u::VirtualMachine* piface, sim
    * The value for GUESTOS_NOISE corresponds to the cost of the global action associated to the VM.  It corresponds to
    * the cost of a VM running no tasks.
    */
-  action_ = host_PM->pimpl_cpu->execution_start(0, core_amount);
+  action_ = physical_host_->pimpl_cpu->execution_start(0, core_amount_);
 
   // It's empty for now, so it should not request resources in the PM
   update_action_weight();
index 8879309..de0c748 100644 (file)
@@ -37,35 +37,32 @@ void log_exception(e_xbt_log_priority_t prio, const char* context, std::exceptio
     auto name = simgrid::xbt::demangle(typeid(exception).name());
 
     auto* with_context = dynamic_cast<const simgrid::Exception*>(&exception);
-    if (with_context != nullptr)
+    if (with_context != nullptr) {
       XBT_LOG(prio, "%s %s by %s/%d: %s", context, name.get(), with_context->throw_point().procname_.c_str(),
               with_context->throw_point().pid_, exception.what());
-    else
+      // Do we have a backtrace?
+      if (not simgrid::config::get_value<bool>("exception/cutpath")) {
+        auto backtrace = with_context->resolve_backtrace();
+        XBT_LOG(prio, "  -> %s", backtrace.c_str());
+      }
+    } else {
       XBT_LOG(prio, "%s %s: %s", context, name.get(), exception.what());
-
-    // Do we have a backtrace?
-    if (with_context != nullptr && not simgrid::config::get_value<bool>("exception/cutpath")) {
-      auto backtrace = with_context->resolve_backtrace();
-      XBT_LOG(prio, "  -> %s", backtrace.c_str());
     }
+  } catch (...) {
+    // Don't log exceptions we got when trying to log exception
+    XBT_LOG(prio, "Ignoring exception caught while while trying to log an exception!");
+  }
 
+  try {
     // Do we have a nested exception?
     auto* with_nested = dynamic_cast<const std::nested_exception*>(&exception);
-    if (with_nested == nullptr ||  with_nested->nested_ptr() == nullptr)
-      return;
-    try {
+    if (with_nested != nullptr && with_nested->nested_ptr() != nullptr)
       with_nested->rethrow_nested();
-    } catch (const std::exception& nested_exception) {
-      log_exception(prio, "Caused by", nested_exception);
-    }
+  } catch (const std::exception& nested_exception) {
+    log_exception(prio, "Caused by", nested_exception);
+  } catch (...) {
     // We could catch nested_exception or WithContextException but we don't bother:
-    catch (...) {
-      XBT_LOG(prio, "Caused by an unknown exception");
-    }
-  }
-  catch (...) {
-    // Don't log exceptions we got when trying to log exception
-    XBT_LOG(prio, "Ignoring exception caught while while trying to log an exception!");
+    XBT_LOG(prio, "Caused by an unknown exception");
   }
 }
 
index 8945638..c4daa85 100644 (file)
@@ -45,24 +45,24 @@ static uintptr_t eval_binary_operation(simgrid::dwarf::ExpressionContext const&
 
 static void basic_test(simgrid::dwarf::ExpressionContext const& state)
 {
-  try {
-    std::array<Dwarf_Op, 60> ops;
+  std::array<Dwarf_Op, 60> ops;
 
-    uintptr_t a = rnd_engine();
-    uintptr_t b = rnd_engine();
+  uintptr_t a = rnd_engine();
+  uintptr_t b = rnd_engine();
 
-    simgrid::dwarf::ExpressionStack stack;
+  simgrid::dwarf::ExpressionStack stack;
 
-    bool caught_ex = false;
-    try {
-      ops[0].atom = DW_OP_drop;
-      simgrid::dwarf::execute(ops.data(), 1, state, stack);
-    } catch (const simgrid::dwarf::evaluation_error&) {
-      caught_ex = true;
-    }
-    if (not caught_ex)
-      fprintf(stderr, "Exception expected");
+  bool caught_ex = false;
+  try {
+    ops[0].atom = DW_OP_drop;
+    simgrid::dwarf::execute(ops.data(), 1, state, stack);
+  } catch (const simgrid::dwarf::evaluation_error&) {
+    caught_ex = true;
+  }
+  if (not caught_ex)
+    fprintf(stderr, "Exception expected");
 
+  try {
     ops[0].atom = DW_OP_lit21;
     simgrid::dwarf::execute(ops.data(), 1, state, stack);
     assert(stack.size() == 1);