From ad2642665c0d0a2f8ea35066864e565b8541fff2 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 27 May 2021 10:35:46 +0200 Subject: [PATCH] Deprecate SIMIX_get_clock(). Use simgrid_get_clock() or Engine::get_clock(). --- ChangeLog | 7 +++++-- doc/doxygen/uhood_switch.doc | 2 +- include/simgrid/chrono.hpp | 7 ++----- include/simgrid/s4u/ConditionVariable.hpp | 3 ++- include/simgrid/simix.h | 2 +- src/instr/instr_config.cpp | 6 +++--- src/instr/instr_paje_containers.cpp | 2 +- src/instr/instr_paje_events.cpp | 2 +- src/instr/instr_paje_events.hpp | 2 +- src/instr/instr_platform.cpp | 4 ++-- src/kernel/activity/CommImpl.cpp | 2 +- src/kernel/activity/ExecImpl.cpp | 3 ++- src/kernel/activity/IoImpl.cpp | 3 ++- src/kernel/actor/ActorImpl.cpp | 2 +- src/kernel/timer/Timer.cpp | 3 ++- src/s4u/s4u_Actor.cpp | 2 +- src/s4u/s4u_ConditionVariable.cpp | 2 +- src/s4u/s4u_Engine.cpp | 7 ++++++- src/simix/smx_global.cpp | 10 +++------- src/smpi/colls/smpi_automatic_selector.cpp | 9 +++++---- src/smpi/internals/smpi_actor.cpp | 7 ++++--- src/smpi/internals/smpi_bench.cpp | 13 +++++++------ src/smpi/internals/smpi_utils.cpp | 6 +++--- src/surf/sg_platf.cpp | 4 ++-- teshsuite/kernel/stack-overflow/stack-overflow.cpp | 1 + 25 files changed, 60 insertions(+), 51 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1b9c21cc47..44d6cd4fcb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,8 +3,8 @@ SimGrid (3.27.1) NOT RELEASED YET (v3.28 expected June 21. 2021, 03:32 UTC) New features: - - New plugin: Producer-Consumer with monitor. Just requires to include the - include/simgrid/plugins/ProducerConsumer.hpp header to be used. See the + - New plugin: Producer-Consumer with monitor. Just requires to include the + include/simgrid/plugins/ProducerConsumer.hpp header to be used. See the associated example (examples/cpp/plugin-prodcons). S4U: @@ -19,6 +19,9 @@ SMPI: LUA: - Lua platform files are deprecated. Their support will be dropped after v3.31. +Simix: + - Legacy functions deprecated in this release: SIMIX_get_clock(), SIMIX_run(). + XBT: - xbt_assert is not disabled anymore, even when built with enable_debug=off. diff --git a/doc/doxygen/uhood_switch.doc b/doc/doxygen/uhood_switch.doc index 45217229a0..3f3dc808f5 100644 --- a/doc/doxygen/uhood_switch.doc +++ b/doc/doxygen/uhood_switch.doc @@ -747,7 +747,7 @@ bool ConditionVariable::wait_for(std::unique_lock& lock, double duration, P pred) { return this->wait_until(lock, - SIMIX_get_clock() + duration, std::move(pred)); + simgrid::s4u::Engine::get_clock() + duration, std::move(pred)); } @endcode diff --git a/include/simgrid/chrono.hpp b/include/simgrid/chrono.hpp index 2410d664d0..84bbd2b868 100644 --- a/include/simgrid/chrono.hpp +++ b/include/simgrid/chrono.hpp @@ -15,7 +15,7 @@ #include #include -#include +#include namespace simgrid { @@ -44,10 +44,7 @@ public: using duration = std::chrono::duration; using time_point = std::chrono::time_point; static constexpr bool is_steady = true; - static time_point now() - { - return time_point(duration(SIMIX_get_clock())); - } + static time_point now() { return time_point(duration(simgrid_get_clock())); } }; /** Default duration for simulated time */ diff --git a/include/simgrid/s4u/ConditionVariable.hpp b/include/simgrid/s4u/ConditionVariable.hpp index de52bde921..184c4c989f 100644 --- a/include/simgrid/s4u/ConditionVariable.hpp +++ b/include/simgrid/s4u/ConditionVariable.hpp @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -74,7 +75,7 @@ public: /// As long as the predicate is false, wait for the given amount of seconds (specified as a plain double) template bool wait_for(const std::unique_lock& lock, double duration, P pred) { - return this->wait_until(lock, SIMIX_get_clock() + duration, std::move(pred)); + return this->wait_until(lock, Engine::get_clock() + duration, std::move(pred)); } // Wait function taking a C++ style time: diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index 89daa7025e..2f805f2b14 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -46,7 +46,7 @@ XBT_PUBLIC void SIMIX_set_maestro(void (*code)(void*), void* data); /* Simulation execution */ XBT_ATTRIB_DEPRECATED_v332("Please use EngineImpl:run()") XBT_PUBLIC void SIMIX_run(); -XBT_PUBLIC double SIMIX_get_clock(); +XBT_ATTRIB_DEPRECATED_v332("Please use simgrid_get_clock() or Engine::get_clock()") XBT_PUBLIC double SIMIX_get_clock(); XBT_ATTRIB_DEPRECATED_v329("Please use simgrid::kernel::timer::Timer::set()") XBT_PUBLIC smx_timer_t SIMIX_timer_set(double date, void (*function)(void*), void* arg); diff --git a/src/instr/instr_config.cpp b/src/instr/instr_config.cpp index 65d5a634d5..a8df9b1c9e 100644 --- a/src/instr/instr_config.cpp +++ b/src/instr/instr_config.cpp @@ -227,7 +227,7 @@ xbt::signal EntityValue::on_creation; static void on_container_creation_paje(const Container& c) { - double timestamp = SIMIX_get_clock(); + double timestamp = simgrid_get_clock(); std::stringstream stream; XBT_DEBUG("%s: event_type=%u, timestamp=%f", __func__, static_cast(PajeEventType::CreateContainer), @@ -250,7 +250,7 @@ static void on_container_destruction_paje(const Container& c) // trace my destruction, but not if user requests so or if the container is root if (not trace_disable_destroy && &c != Container::get_root()) { std::stringstream stream; - double timestamp = SIMIX_get_clock(); + double timestamp = simgrid_get_clock(); XBT_DEBUG("%s: event_type=%u, timestamp=%f", __func__, static_cast(PajeEventType::DestroyContainer), timestamp); @@ -265,7 +265,7 @@ static void on_container_destruction_paje(const Container& c) static void on_container_creation_ti(const Container& c) { XBT_DEBUG("%s: event_type=%u, timestamp=%f", __func__, static_cast(PajeEventType::CreateContainer), - SIMIX_get_clock()); + simgrid_get_clock()); // if we are in the mode with only one file static std::ofstream* ti_unique_file = nullptr; static double prefix = 0.0; diff --git a/src/instr/instr_paje_containers.cpp b/src/instr/instr_paje_containers.cpp index f7ae0b5403..f97d975a59 100644 --- a/src/instr/instr_paje_containers.cpp +++ b/src/instr/instr_paje_containers.cpp @@ -81,7 +81,7 @@ Container::~Container() all_containers_.erase(name_); // obligation to dump previous events because they might reference the container that is about to be destroyed - last_timestamp_to_dump = SIMIX_get_clock(); + last_timestamp_to_dump = simgrid_get_clock(); dump_buffer(true); on_destruction(*this); diff --git a/src/instr/instr_paje_events.cpp b/src/instr/instr_paje_events.cpp index d32bb12fe1..78ac8a9200 100644 --- a/src/instr/instr_paje_events.cpp +++ b/src/instr/instr_paje_events.cpp @@ -26,7 +26,7 @@ PajeEvent::~PajeEvent() } StateEvent::StateEvent(Container* container, Type* type, PajeEventType event_type, EntityValue* value, TIData* extra) - : PajeEvent::PajeEvent(container, type, SIMIX_get_clock(), event_type), value(value), extra_(extra) + : PajeEvent::PajeEvent(container, type, simgrid_get_clock(), event_type), value(value), extra_(extra) { #if HAVE_SMPI if (smpi_cfg_trace_call_location()) { diff --git a/src/instr/instr_paje_events.hpp b/src/instr/instr_paje_events.hpp index bfb79da55e..17aab29eaa 100644 --- a/src/instr/instr_paje_events.hpp +++ b/src/instr/instr_paje_events.hpp @@ -100,7 +100,7 @@ class LinkEvent : public PajeEvent { public: LinkEvent(Container* container, Type* type, PajeEventType event_type, Container* sourceContainer, const std::string& value, const std::string& key, size_t size = static_cast(-1)) - : PajeEvent(container, type, SIMIX_get_clock(), event_type) + : PajeEvent(container, type, simgrid_get_clock(), event_type) , endpoint_(sourceContainer) , value_(value) , key_(key) diff --git a/src/instr/instr_platform.cpp b/src/instr/instr_platform.cpp index 908d7b8627..3d81743b32 100644 --- a/src/instr/instr_platform.cpp +++ b/src/instr/instr_platform.cpp @@ -344,13 +344,13 @@ static void on_action_state_change(kernel::resource::Action const& action, if (cpu != nullptr) resource_set_utilization("HOST", "speed_used", cpu->get_cname(), action.get_category(), value, - action.get_last_update(), SIMIX_get_clock() - action.get_last_update()); + action.get_last_update(), simgrid_get_clock() - action.get_last_update()); const kernel::resource::LinkImpl* link = dynamic_cast(resource); if (link != nullptr) resource_set_utilization("LINK", "bandwidth_used", link->get_cname(), action.get_category(), value, - action.get_last_update(), SIMIX_get_clock() - action.get_last_update()); + action.get_last_update(), simgrid_get_clock() - action.get_last_update()); } } diff --git a/src/kernel/activity/CommImpl.cpp b/src/kernel/activity/CommImpl.cpp index 7f8b8c3604..edd3e5ff47 100644 --- a/src/kernel/activity/CommImpl.cpp +++ b/src/kernel/activity/CommImpl.cpp @@ -453,7 +453,7 @@ void CommImpl::wait_any_for(actor::ActorImpl* issuer, const std::vectorsimcall_.timeout_cb_ = nullptr; } else { - issuer->simcall_.timeout_cb_ = timer::Timer::set(SIMIX_get_clock() + timeout, [issuer, comms]() { + issuer->simcall_.timeout_cb_ = timer::Timer::set(s4u::Engine::get_clock() + timeout, [issuer, comms]() { // FIXME: Vector `comms' is copied here. Use a reference once its lifetime is extended (i.e. when the simcall is // modernized). issuer->simcall_.timeout_cb_ = nullptr; diff --git a/src/kernel/activity/ExecImpl.cpp b/src/kernel/activity/ExecImpl.cpp index c1d2583cce..a687d1d8af 100644 --- a/src/kernel/activity/ExecImpl.cpp +++ b/src/kernel/activity/ExecImpl.cpp @@ -7,6 +7,7 @@ #include "simgrid/Exception.hpp" #include "simgrid/kernel/routing/NetPoint.hpp" #include "simgrid/modelchecker.h" +#include "simgrid/s4u/Engine.hpp" #include "simgrid/s4u/Exec.hpp" #include "src/kernel/actor/SimcallObserver.hpp" #include "src/mc/mc_replay.hpp" @@ -241,7 +242,7 @@ void ExecImpl::wait_any_for(actor::ActorImpl* issuer, const std::vectorsimcall_.timeout_cb_ = nullptr; } else { - issuer->simcall_.timeout_cb_ = timer::Timer::set(SIMIX_get_clock() + timeout, [issuer, &execs]() { + issuer->simcall_.timeout_cb_ = timer::Timer::set(s4u::Engine::get_clock() + timeout, [issuer, &execs]() { issuer->simcall_.timeout_cb_ = nullptr; for (auto* exec : execs) exec->unregister_simcall(&issuer->simcall_); diff --git a/src/kernel/activity/IoImpl.cpp b/src/kernel/activity/IoImpl.cpp index 034099dc90..6f77d52abf 100644 --- a/src/kernel/activity/IoImpl.cpp +++ b/src/kernel/activity/IoImpl.cpp @@ -7,6 +7,7 @@ #include "simgrid/Exception.hpp" #include "simgrid/kernel/resource/Action.hpp" #include "simgrid/kernel/routing/NetPoint.hpp" +#include "simgrid/s4u/Engine.hpp" #include "simgrid/s4u/Host.hpp" #include "simgrid/s4u/Io.hpp" #include "src/kernel/actor/SimcallObserver.hpp" @@ -152,7 +153,7 @@ void IoImpl::wait_any_for(actor::ActorImpl* issuer, const std::vector& if (timeout < 0.0) { issuer->simcall_.timeout_cb_ = nullptr; } else { - issuer->simcall_.timeout_cb_ = timer::Timer::set(SIMIX_get_clock() + timeout, [issuer, &ios]() { + issuer->simcall_.timeout_cb_ = timer::Timer::set(s4u::Engine::get_clock() + timeout, [issuer, &ios]() { issuer->simcall_.timeout_cb_ = nullptr; for (auto* io : ios) io->unregister_simcall(&issuer->simcall_); diff --git a/src/kernel/actor/ActorImpl.cpp b/src/kernel/actor/ActorImpl.cpp index edfd15cfb2..78f5be79ab 100644 --- a/src/kernel/actor/ActorImpl.cpp +++ b/src/kernel/actor/ActorImpl.cpp @@ -260,7 +260,7 @@ void ActorImpl::kill_all() const void ActorImpl::set_kill_time(double kill_time) { - if (kill_time <= SIMIX_get_clock()) + if (kill_time <= s4u::Engine::get_clock()) return; XBT_DEBUG("Set kill time %f for actor %s@%s", kill_time, get_cname(), host_->get_cname()); kill_timer_ = timer::Timer::set(kill_time, [this] { diff --git a/src/kernel/timer/Timer.cpp b/src/kernel/timer/Timer.cpp index df005caac9..c0f475f939 100644 --- a/src/kernel/timer/Timer.cpp +++ b/src/kernel/timer/Timer.cpp @@ -5,6 +5,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include +#include #include namespace simgrid { @@ -29,7 +30,7 @@ void Timer::remove() bool Timer::execute_all() { bool result = false; - while (not kernel_timers().empty() && SIMIX_get_clock() >= kernel_timers().top().first) { + while (not kernel_timers().empty() && s4u::Engine::get_clock() >= kernel_timers().top().first) { result = true; // FIXME: make the timers being real callbacks (i.e. provide dispatchers that read and expand the args) Timer* timer = kernel_timers().top().second; diff --git a/src/s4u/s4u_Actor.cpp b/src/s4u/s4u_Actor.cpp index c0666ad3e3..35b707050d 100644 --- a/src/s4u/s4u_Actor.cpp +++ b/src/s4u/s4u_Actor.cpp @@ -352,7 +352,7 @@ void yield() XBT_PUBLIC void sleep_until(double wakeup_time) { - double now = SIMIX_get_clock(); + double now = s4u::Engine::get_clock(); if (wakeup_time > now) sleep_for(wakeup_time - now); } diff --git a/src/s4u/s4u_ConditionVariable.cpp b/src/s4u/s4u_ConditionVariable.cpp index 7244cf83c9..cfced69bdc 100644 --- a/src/s4u/s4u_ConditionVariable.cpp +++ b/src/s4u/s4u_ConditionVariable.cpp @@ -66,7 +66,7 @@ std::cv_status s4u::ConditionVariable::wait_for(const std::unique_lock& l std::cv_status ConditionVariable::wait_until(const std::unique_lock& lock, double timeout_time) { - double now = SIMIX_get_clock(); + double now = Engine::get_clock(); double timeout; if (timeout_time < now) timeout = 0.0; diff --git a/src/s4u/s4u_Engine.cpp b/src/s4u/s4u_Engine.cpp index 6cdb27598a..9898b81da6 100644 --- a/src/s4u/s4u_Engine.cpp +++ b/src/s4u/s4u_Engine.cpp @@ -16,6 +16,7 @@ #include "simgrid/simix.h" #include "src/instr/instr_private.hpp" #include "src/kernel/EngineImpl.hpp" +#include "src/mc/mc_replay.hpp" #include "src/surf/network_interface.hpp" #include "surf/surf.hpp" // routing_platf. FIXME:KILLME. SOON #include @@ -80,7 +81,11 @@ void Engine::shutdown() double Engine::get_clock() { - return SIMIX_get_clock(); + if (MC_is_active() || MC_record_replay_is_active()) { + return MC_process_clock_get(SIMIX_process_self()); + } else { + return surf_get_clock(); + } } void Engine::add_model(std::shared_ptr model, diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index 40055f0ef5..82e38ccb21 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -201,7 +201,7 @@ void SIMIX_clean() smx_cleaned = true; XBT_DEBUG("SIMIX_clean called. Simulation's over."); auto* engine = simgrid::kernel::EngineImpl::get_instance(); - if (engine->has_actors_to_run() && SIMIX_get_clock() <= 0.0) { + if (engine->has_actors_to_run() && simgrid::s4u::Engine::get_clock() <= 0.0) { XBT_CRITICAL(" "); XBT_CRITICAL("The time is still 0, and you still have processes ready to run."); XBT_CRITICAL("It seems that you forgot to run the simulation that you setup."); @@ -241,13 +241,9 @@ void SIMIX_clean() * * @return Return the clock. */ -double SIMIX_get_clock() +double SIMIX_get_clock() // XBT_ATTRIB_DEPRECATED_v332 { - if (MC_is_active() || MC_record_replay_is_active()) { - return MC_process_clock_get(SIMIX_process_self()); - } else { - return surf_get_clock(); - } + return simgrid::s4u::Engine::get_clock(); } void SIMIX_run() // XBT_ATTRIB_DEPRECATED_v332 diff --git a/src/smpi/colls/smpi_automatic_selector.cpp b/src/smpi/colls/smpi_automatic_selector.cpp index 4a8b5abfc0..a84cd1e118 100644 --- a/src/smpi/colls/smpi_automatic_selector.cpp +++ b/src/smpi/colls/smpi_automatic_selector.cpp @@ -7,6 +7,7 @@ #include #include "colls_private.hpp" +#include "simgrid/s4u/Engine.hpp" #include "src/smpi/include/smpi_actor.hpp" //attempt to do a quick autotuning version of the collective, @@ -29,16 +30,16 @@ \ std::string cont_name = std::string("rank-" + std::to_string(simgrid::s4u::this_actor::get_pid())); \ type->add_entity_value(desc->name, "1.0 1.0 1.0"); \ - new simgrid::instr::NewEvent(SIMIX_get_clock(), simgrid::instr::Container::by_name(cont_name), type, \ - type->get_entity_value(desc->name)); \ + new simgrid::instr::NewEvent(simgrid::s4u::Engine::get_clock(), simgrid::instr::Container::by_name(cont_name), \ + type, type->get_entity_value(desc->name)); \ } \ - time1 = SIMIX_get_clock(); \ + time1 = simgrid::s4u::Engine::get_clock(); \ try { \ ((int(*) args)desc->coll) args2; \ } catch (std::exception & ex) { \ continue; \ } \ - time2 = SIMIX_get_clock(); \ + time2 = simgrid::s4u::Engine::get_clock(); \ buf_out = time2 - time1; \ reduce__default((void*)&buf_out, (void*)&buf_in, 1, MPI_DOUBLE, MPI_MAX, 0, comm); \ if (time2 - time1 < time_min) { \ diff --git a/src/smpi/internals/smpi_actor.cpp b/src/smpi/internals/smpi_actor.cpp index f18b4768ae..bdb72ce3d9 100644 --- a/src/smpi/internals/smpi_actor.cpp +++ b/src/smpi/internals/smpi_actor.cpp @@ -5,11 +5,12 @@ #include "src/smpi/include/smpi_actor.hpp" #include "mc/mc.h" +#include "simgrid/s4u/Engine.hpp" +#include "simgrid/s4u/Mutex.hpp" #include "smpi_comm.hpp" #include "smpi_info.hpp" #include "src/mc/mc_replay.hpp" #include "src/simix/smx_private.hpp" -#include "simgrid/s4u/Mutex.hpp" #if HAVE_PAPI #include "papi.h" @@ -164,12 +165,12 @@ xbt_os_timer_t ActorExt::timer() void ActorExt::simulated_start() { - simulated_ = SIMIX_get_clock(); + simulated_ = s4u::Engine::get_clock(); } double ActorExt::simulated_elapsed() const { - return SIMIX_get_clock() - simulated_; + return s4u::Engine::get_clock() - simulated_; } MPI_Comm ActorExt::comm_self() diff --git a/src/smpi/internals/smpi_bench.cpp b/src/smpi/internals/smpi_bench.cpp index 277da718d0..d05db4da1b 100644 --- a/src/smpi/internals/smpi_bench.cpp +++ b/src/smpi/internals/smpi_bench.cpp @@ -7,6 +7,7 @@ #include "private.hpp" #include "simgrid/host.h" #include "simgrid/modelchecker.h" +#include "simgrid/s4u/Engine.hpp" #include "simgrid/s4u/Exec.hpp" #include "smpi_comm.hpp" #include "smpi_utils.hpp" @@ -156,7 +157,7 @@ void smpi_bench_end() const papi_counter_t& counter_data = smpi_process()->papi_counters(); for (auto const& pair : counter_data) { - container->get_variable(pair.first)->set_event(SIMIX_get_clock(), pair.second); + container->get_variable(pair.first)->set_event(simgrid::s4u::Engine::get_clock(), pair.second); } } #endif @@ -210,7 +211,7 @@ int smpi_gettimeofday(struct timeval* tv, struct timezone* tz) return gettimeofday(tv, tz); smpi_bench_end(); - double now = SIMIX_get_clock(); + double now = simgrid::s4u::Engine::get_clock(); if (tv) { tv->tv_sec = static_cast(now); #ifdef WIN32 @@ -236,7 +237,7 @@ int smpi_clock_gettime(clockid_t clk_id, struct timespec* tp) return clock_gettime(clk_id, tp); //there is only one time in SMPI, so clk_id is ignored. smpi_bench_end(); - double now = SIMIX_get_clock(); + double now = simgrid::s4u::Engine::get_clock(); tp->tv_sec = static_cast(now); tp->tv_nsec = static_cast((now - tp->tv_sec) * 1e9); if (smpi_wtime_sleep > 0) @@ -251,12 +252,12 @@ double smpi_mpi_wtime() double time; if (smpi_process()->initialized() && not smpi_process()->finalized() && not smpi_process()->sampling()) { smpi_bench_end(); - time = SIMIX_get_clock(); + time = simgrid::s4u::Engine::get_clock(); if (smpi_wtime_sleep > 0) simgrid::s4u::this_actor::sleep_for(smpi_wtime_sleep); smpi_bench_begin(); } else { - time = SIMIX_get_clock(); + time = simgrid::s4u::Engine::get_clock(); } return time; } @@ -273,7 +274,7 @@ unsigned long long smpi_rastro_resolution () unsigned long long smpi_rastro_timestamp () { smpi_bench_end(); - double now = SIMIX_get_clock(); + double now = simgrid::s4u::Engine::get_clock(); auto sec = static_cast(now); unsigned long long pre = (now - sec) * smpi_rastro_resolution(); diff --git a/src/smpi/internals/smpi_utils.cpp b/src/smpi/internals/smpi_utils.cpp index 012988f84d..aec528f32b 100644 --- a/src/smpi/internals/smpi_utils.cpp +++ b/src/smpi/internals/smpi_utils.cpp @@ -144,9 +144,9 @@ void account_shared_size(size_t size){ void print_time_analysis(double global_time){ if (simgrid::config::get_value("smpi/display-timing")) { XBT_INFO("Simulated time: %g seconds. \n\n" - "The simulation took %g seconds (after parsing and platform setup)\n" - "%g seconds were actual computation of the application", - SIMIX_get_clock(), global_time , total_benched_time); + "The simulation took %g seconds (after parsing and platform setup)\n" + "%g seconds were actual computation of the application", + simgrid_get_clock(), global_time, total_benched_time); if (total_benched_time/global_time>=0.75) XBT_INFO("More than 75%% of the time was spent inside the application code.\n" "You may want to use sampling functions or trace replay to reduce this."); diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index ca490824aa..8cebc8f8e6 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -495,7 +495,7 @@ void sg_platf_new_actor(simgrid::kernel::routing::ActorCreationArgs* actor) host->get_impl()->add_actor_at_boot(arg); - if (start_time > SIMIX_get_clock()) { + if (start_time > simgrid::s4u::Engine::get_clock()) { arg = new simgrid::kernel::actor::ProcessArg(actor_name, code, nullptr, host, kill_time, actor->properties, auto_restart); @@ -510,7 +510,7 @@ void sg_platf_new_actor(simgrid::kernel::routing::ActorCreationArgs* actor) new_actor->set_auto_restart(auto_restart); delete arg; }); - } else { // start_time <= SIMIX_get_clock() + } else { // start_time <= simgrid::s4u::Engine::get_clock() XBT_DEBUG("Starting Process %s(%s) right now", arg->name.c_str(), host->get_cname()); try { diff --git a/teshsuite/kernel/stack-overflow/stack-overflow.cpp b/teshsuite/kernel/stack-overflow/stack-overflow.cpp index ef98226ecd..3b3f015fd3 100644 --- a/teshsuite/kernel/stack-overflow/stack-overflow.cpp +++ b/teshsuite/kernel/stack-overflow/stack-overflow.cpp @@ -7,6 +7,7 @@ #include "simgrid/s4u/Actor.hpp" #include "simgrid/s4u/Engine.hpp" +#include "xbt/asserts.h" #include "xbt/log.h" #include -- 2.20.1