From eb34c4544dc901d54df67aa10f484e34a56f1396 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 19 Feb 2023 15:45:51 +0100 Subject: [PATCH] Finally kill surf_interface.hpp watched_host was actually useless --- MANIFEST.in | 1 - src/kernel/EngineImpl.cpp | 3 +-- src/kernel/actor/ActorImpl.cpp | 7 ------- src/surf/surf_interface.hpp | 18 ------------------ tools/cmake/DefinePackages.cmake | 1 - 5 files changed, 1 insertion(+), 29 deletions(-) delete mode 100644 src/surf/surf_interface.hpp diff --git a/MANIFEST.in b/MANIFEST.in index b1ade225e3..5c50b594f5 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2439,7 +2439,6 @@ include src/smpi/smpitools.sh include src/sthread/sthread.c include src/sthread/sthread.h include src/sthread/sthread_impl.cpp -include src/surf/surf_interface.hpp include src/xbt/OsSemaphore.hpp include src/xbt/PropertyHolder.cpp include src/xbt/automaton/automaton.c diff --git a/src/kernel/EngineImpl.cpp b/src/kernel/EngineImpl.cpp index 2f7d81aec0..092c69730d 100644 --- a/src/kernel/EngineImpl.cpp +++ b/src/kernel/EngineImpl.cpp @@ -19,7 +19,6 @@ #include "src/simgrid/math_utils.h" #include "src/simgrid/sg_config.hpp" #include "src/smpi/include/smpi_actor.hpp" -#include "src/surf/surf_interface.hpp" #include "src/xbt/xbt_modinter.h" /* whether initialization was already done */ #include "xbt/module.h" @@ -553,7 +552,7 @@ double EngineImpl::solve(double max_date) const while (auto* event = profile::future_evt_set.pop_leq(next_event_date, &value, &resource)) { if(value<0) continue; - if (resource->is_used() || (watched_hosts().find(resource->get_cname()) != watched_hosts().end())) { + if (resource->is_used()) { time_delta = next_event_date - now_; XBT_DEBUG("This event invalidates the next_occurring_event() computation of models. Next event set to %f", time_delta); diff --git a/src/kernel/actor/ActorImpl.cpp b/src/kernel/actor/ActorImpl.cpp index 4fb6bf5415..05de3b4fb6 100644 --- a/src/kernel/actor/ActorImpl.cpp +++ b/src/kernel/actor/ActorImpl.cpp @@ -10,7 +10,6 @@ #include "src/internal_config.h" #include "src/kernel/EngineImpl.hpp" -#include "src/surf/surf_interface.hpp" #if HAVE_SMPI #include "src/smpi/include/private.hpp" #endif @@ -128,12 +127,6 @@ void ActorImpl::cleanup_from_kernel() if (not kernel_destroy_list_hook.is_linked()) engine->add_actor_to_destroy_list(*this); - if (has_to_auto_restart() && not get_host()->is_on()) { - XBT_DEBUG("Insert host %s to watched_hosts because it's off and %s needs to restart", get_host()->get_cname(), - get_cname()); - watched_hosts().insert(get_host()->get_name()); - } - undaemonize(); s4u::Actor::on_termination(*get_ciface()); diff --git a/src/surf/surf_interface.hpp b/src/surf/surf_interface.hpp deleted file mode 100644 index 7453d35699..0000000000 --- a/src/surf/surf_interface.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/* Copyright (c) 2004-2023. The SimGrid Team. All rights reserved. */ - -/* 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. */ - -#ifndef SURF_MODEL_H_ -#define SURF_MODEL_H_ - -#include -#include - -/** set of hosts for which one want to be notified if they ever restart */ -inline auto& watched_hosts() // avoid static initialization order fiasco -{ - static std::set> value; - return value; -} -#endif /* SURF_MODEL_H_ */ diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index 07dedb329a..c30d4cd519 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -41,7 +41,6 @@ set(EXTRA_DIST src/smpi/include/smpi_utils.hpp src/smpi/smpi_main.c src/smpi/smpi_replay_main.cpp - src/surf/surf_interface.hpp src/kernel/xml/simgrid.dtd src/kernel/xml/simgrid_dtd.c src/kernel/xml/simgrid_dtd.h -- 2.20.1