From: Ehsan Azimi Date: Mon, 16 Nov 2020 17:16:17 +0000 (+0100) Subject: Merge branch 'master' of github.com:simgrid/simgrid X-Git-Tag: v3.26~72^2^2~57 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/178d93b55be5105559c7b8277838b44944e3ad8c?hp=c7697bfda032a59b6074018dd78ac0f4de838829 Merge branch 'master' of github.com:simgrid/simgrid --- diff --git a/ChangeLog b/ChangeLog index d1b5573bd6..b4aa5e1383 100644 --- 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 diff --git a/setup.py b/setup.py index d5475b4c79..6a7975c194 100755 --- 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] diff --git a/src/instr/instr_paje_containers.cpp b/src/instr/instr_paje_containers.cpp index ce918634bc..dbb271da24 100644 --- a/src/instr/instr_paje_containers.cpp +++ b/src/instr/instr_paje_containers.cpp @@ -16,12 +16,6 @@ namespace instr { Container* Container::root_container_ = nullptr; /* the root container */ std::map 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); } diff --git a/src/instr/instr_paje_types.cpp b/src/instr/instr_paje_types.cpp index c5185883e3..213c45b3b1 100644 --- a/src/instr/instr_paje_types.cpp +++ b/src/instr/instr_paje_types.cpp @@ -15,9 +15,15 @@ static std::set 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"); diff --git a/src/instr/instr_paje_types.hpp b/src/instr/instr_paje_types.hpp index f4dae73d4d..269175c1e2 100644 --- a/src/instr/instr_paje_types.hpp +++ b/src/instr/instr_paje_types.hpp @@ -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_; diff --git a/src/instr/instr_paje_values.hpp b/src/instr/instr_paje_values.hpp index 1fbcc4816f..16e716b625 100644 --- a/src/instr/instr_paje_values.hpp +++ b/src/instr/instr_paje_values.hpp @@ -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_; diff --git a/src/instr/instr_private.hpp b/src/instr/instr_private.hpp index 8b5c076e95..7819f951c0 100644 --- a/src/instr/instr_private.hpp +++ b/src/instr/instr_private.hpp @@ -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 #include /** 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(); diff --git a/src/mc/compare.cpp b/src/mc/compare.cpp index aec0a0cdf2..6baf980d9d 100644 --- a/src/mc/compare.cpp +++ b/src/mc/compare.cpp @@ -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; diff --git a/src/mc/remote/RemoteSimulation.cpp b/src/mc/remote/RemoteSimulation.cpp index b9238aad60..b9abdbe368 100644 --- a/src/mc/remote/RemoteSimulation.cpp +++ b/src/mc/remote/RemoteSimulation.cpp @@ -86,6 +86,7 @@ static const std::vector filtered_libraries = { "liblua5.3", "liblzma", "libm", + "libmd", "libnghttp2", "libomp", "libpapi", diff --git a/src/plugins/vm/VirtualMachineImpl.cpp b/src/plugins/vm/VirtualMachineImpl.cpp index 1bb1944a84..b95cc55909 100644 --- a/src/plugins/vm/VirtualMachineImpl.cpp +++ b/src/plugins/vm/VirtualMachineImpl.cpp @@ -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(); diff --git a/src/xbt/exception.cpp b/src/xbt/exception.cpp index 8879309020..de0c748bf5 100644 --- a/src/xbt/exception.cpp +++ b/src/xbt/exception.cpp @@ -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(&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("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("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(&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"); } } diff --git a/teshsuite/mc/dwarf-expression/dwarf-expression.cpp b/teshsuite/mc/dwarf-expression/dwarf-expression.cpp index 8945638edb..c4daa85f6e 100644 --- a/teshsuite/mc/dwarf-expression/dwarf-expression.cpp +++ b/teshsuite/mc/dwarf-expression/dwarf-expression.cpp @@ -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 ops; + std::array 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);