Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
ActivityImpl::register_simcall does not need to be 'virtual'.
[simgrid.git] / src / simix / smx_global.cpp
1 /* Copyright (c) 2007-2021. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #include "mc/mc.h"
7 #include "simgrid/s4u/Engine.hpp"
8 #include "simgrid/s4u/Host.hpp"
9 #include "src/smpi/include/smpi_actor.hpp"
10
11 #include "simgrid/sg_config.hpp"
12 #include "src/kernel/EngineImpl.hpp"
13 #include "src/kernel/activity/ExecImpl.hpp"
14 #include "src/kernel/activity/IoImpl.hpp"
15 #include "src/kernel/activity/MailboxImpl.hpp"
16 #include "src/kernel/activity/SleepImpl.hpp"
17 #include "src/kernel/activity/SynchroRaw.hpp"
18 #include "src/mc/mc_record.hpp"
19 #include "src/mc/mc_replay.hpp"
20 #include "src/simix/smx_private.hpp"
21 #include "src/surf/xml/platf.hpp"
22
23 #include "simgrid/kernel/resource/Model.hpp"
24
25 #if SIMGRID_HAVE_MC
26 #include "src/mc/remote/AppSide.hpp"
27 #endif
28
29 #include <memory>
30
31 XBT_LOG_NEW_CATEGORY(simix, "All SIMIX categories");
32 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_kernel, simix, "Logging specific to SIMIX (kernel)");
33
34 std::unique_ptr<simgrid::simix::Global> simix_global;
35
36 void (*SMPI_switch_data_segment)(simgrid::s4u::ActorPtr) = nullptr;
37
38 namespace simgrid {
39 namespace simix {
40 config::Flag<bool> cfg_verbose_exit{"debug/verbose-exit", "Display the actor status at exit", true};
41
42 void* simix_global_get_actors_addr()
43 {
44 #if SIMGRID_HAVE_MC
45   return simix_global->actors_vector;
46 #else
47   xbt_die("This function is intended to be used when compiling with MC");
48 #endif
49 }
50 void* simix_global_get_dead_actors_addr()
51 {
52 #if SIMGRID_HAVE_MC
53   return simix_global->dead_actors_vector;
54 #else
55   xbt_die("This function is intended to be used when compiling with MC");
56 #endif
57 }
58
59 } // namespace simix
60 } // namespace simgrid
61
62 XBT_ATTRIB_NORETURN static void inthandler(int)
63 {
64   if (simgrid::simix::cfg_verbose_exit) {
65     XBT_INFO("CTRL-C pressed. The current status will be displayed before exit (disable that behavior with option "
66              "'debug/verbose-exit').");
67     simix_global->display_all_actor_status();
68   } else {
69     XBT_INFO("CTRL-C pressed, exiting. Hiding the current process status since 'debug/verbose-exit' is set to false.");
70   }
71   exit(1);
72 }
73
74 #ifndef _WIN32
75 static void segvhandler(int signum, siginfo_t* siginfo, void* /*context*/)
76 {
77   if ((siginfo->si_signo == SIGSEGV && siginfo->si_code == SEGV_ACCERR) || siginfo->si_signo == SIGBUS) {
78     fprintf(stderr,
79             "Access violation or Bus error detected.\n"
80             "This probably comes from a programming error in your code, or from a stack\n"
81             "overflow. If you are certain of your code, try increasing the stack size\n"
82             "   --cfg=contexts/stack-size=XXX (current size is %u KiB).\n"
83             "\n"
84             "If it does not help, this may have one of the following causes:\n"
85             "a bug in SimGrid, a bug in the OS or a bug in a third-party libraries.\n"
86             "Failing hardware can sometimes generate such errors too.\n"
87             "\n"
88             "If you think you've found a bug in SimGrid, please report it along with a\n"
89             "Minimal Working Example (MWE) reproducing your problem and a full backtrace\n"
90             "of the fault captured with gdb or valgrind.\n",
91             smx_context_stack_size / 1024);
92   } else if (siginfo->si_signo == SIGSEGV) {
93     fprintf(stderr, "Segmentation fault.\n");
94 #if HAVE_SMPI
95     if (smpi_enabled() && smpi_cfg_privatization() == SmpiPrivStrategies::NONE) {
96 #if HAVE_PRIVATIZATION
97       fprintf(stderr, "Try to enable SMPI variable privatization with --cfg=smpi/privatization:yes.\n");
98 #else
99       fprintf(stderr, "Sadly, your system does not support --cfg=smpi/privatization:yes (yet).\n");
100 #endif /* HAVE_PRIVATIZATION */
101     }
102 #endif /* HAVE_SMPI */
103   }
104   std::raise(signum);
105 }
106
107 /**
108  * Install signal handler for SIGSEGV.  Check that nobody has already installed
109  * its own handler.  For example, the Java VM does this.
110  */
111 static void install_segvhandler()
112 {
113   stack_t old_stack;
114
115   if (simgrid::kernel::context::Context::install_sigsegv_stack(&old_stack, true) == -1) {
116     XBT_WARN("Failed to register alternate signal stack: %s", strerror(errno));
117     return;
118   }
119   if (not(old_stack.ss_flags & SS_DISABLE)) {
120     XBT_DEBUG("An alternate stack was already installed (sp=%p, size=%zu, flags=%x). Restore it.", old_stack.ss_sp,
121               old_stack.ss_size, (unsigned)old_stack.ss_flags);
122     sigaltstack(&old_stack, nullptr);
123   }
124
125   struct sigaction action;
126   struct sigaction old_action;
127   action.sa_sigaction = &segvhandler;
128   action.sa_flags     = SA_ONSTACK | SA_RESETHAND | SA_SIGINFO;
129   sigemptyset(&action.sa_mask);
130
131   /* Linux tend to raise only SIGSEGV where other systems also raise SIGBUS on severe error */
132   for (int sig : {SIGSEGV, SIGBUS}) {
133     if (sigaction(sig, &action, &old_action) == -1) {
134       XBT_WARN("Failed to register signal handler for signal %d: %s", sig, strerror(errno));
135       continue;
136     }
137     if ((old_action.sa_flags & SA_SIGINFO) || old_action.sa_handler != SIG_DFL) {
138       XBT_DEBUG("A signal handler was already installed for signal %d (%p). Restore it.", sig,
139                 (old_action.sa_flags & SA_SIGINFO) ? (void*)old_action.sa_sigaction : (void*)old_action.sa_handler);
140       sigaction(sig, &old_action, nullptr);
141     }
142   }
143 }
144
145 #endif /* _WIN32 */
146
147 /********************************* SIMIX **************************************/
148 namespace simgrid {
149 namespace simix {
150
151 Timer* Timer::set(double date, xbt::Task<void()>&& callback)
152 {
153   auto* timer    = new Timer(date, std::move(callback));
154   timer->handle_ = simix_timers().emplace(std::make_pair(date, timer));
155   return timer;
156 }
157
158 /** @brief cancels a timer that was added earlier */
159 void Timer::remove()
160 {
161   simix_timers().erase(handle_);
162   delete this;
163 }
164
165 /** Execute all the tasks that are queued, e.g. `.then()` callbacks of futures. */
166 bool Global::execute_tasks()
167 {
168   xbt_assert(tasksTemp.empty());
169
170   if (tasks.empty())
171     return false;
172
173   do {
174     // We don't want the callbacks to modify the vector we are iterating over:
175     tasks.swap(tasksTemp);
176
177     // Execute all the queued tasks:
178     for (auto& task : tasksTemp)
179       task();
180
181     tasksTemp.clear();
182   } while (not tasks.empty());
183
184   return true;
185 }
186
187 void Global::empty_trash()
188 {
189   while (not actors_to_destroy.empty()) {
190     kernel::actor::ActorImpl* actor = &actors_to_destroy.front();
191     actors_to_destroy.pop_front();
192     XBT_DEBUG("Getting rid of %s (refcount: %d)", actor->get_cname(), actor->get_refcount());
193     intrusive_ptr_release(actor);
194   }
195 #if SIMGRID_HAVE_MC
196   xbt_dynar_reset(dead_actors_vector);
197 #endif
198 }
199 /**
200  * @brief Executes the actors in actors_to_run.
201  *
202  * The actors in actors_to_run are run (in parallel if possible). On exit, actors_to_run is empty, and actors_that_ran
203  * contains the list of actors that just ran.  The two lists are swapped so, be careful when using them before and after
204  * a call to this function.
205  */
206 void Global::run_all_actors()
207 {
208   simix_global->context_factory->run_all();
209
210   actors_to_run.swap(actors_that_ran);
211   actors_to_run.clear();
212 }
213
214 /** Wake up all actors waiting for a Surf action to finish */
215 void Global::wake_all_waiting_actors() const
216 {
217   for (auto const& model : simgrid::kernel::EngineImpl::get_instance()->get_all_models()) {
218     kernel::resource::Action* action;
219
220     XBT_DEBUG("Handling the failed actions (if any)");
221     while ((action = model->extract_failed_action())) {
222       XBT_DEBUG("   Handling Action %p", action);
223       if (action->get_activity() != nullptr)
224         kernel::activity::ActivityImplPtr(action->get_activity())->post();
225     }
226     XBT_DEBUG("Handling the terminated actions (if any)");
227     while ((action = model->extract_done_action())) {
228       XBT_DEBUG("   Handling Action %p", action);
229       if (action->get_activity() == nullptr)
230         XBT_DEBUG("probably vcpu's action %p, skip", action);
231       else
232         kernel::activity::ActivityImplPtr(action->get_activity())->post();
233     }
234   }
235 }
236
237 void Global::display_all_actor_status() const
238 {
239   XBT_INFO("%zu actors are still running, waiting for something.", process_list.size());
240   /*  List the actors and their state */
241   XBT_INFO("Legend of the following listing: \"Actor <pid> (<name>@<host>): <status>\"");
242   for (auto const& kv : process_list) {
243     kernel::actor::ActorImpl* actor = kv.second;
244
245     if (actor->waiting_synchro_) {
246       const char* synchro_description = "unknown";
247
248       if (boost::dynamic_pointer_cast<kernel::activity::ExecImpl>(actor->waiting_synchro_) != nullptr)
249         synchro_description = "execution";
250
251       if (boost::dynamic_pointer_cast<kernel::activity::CommImpl>(actor->waiting_synchro_) != nullptr)
252         synchro_description = "communication";
253
254       if (boost::dynamic_pointer_cast<kernel::activity::SleepImpl>(actor->waiting_synchro_) != nullptr)
255         synchro_description = "sleeping";
256
257       if (boost::dynamic_pointer_cast<kernel::activity::RawImpl>(actor->waiting_synchro_) != nullptr)
258         synchro_description = "synchronization";
259
260       if (boost::dynamic_pointer_cast<kernel::activity::IoImpl>(actor->waiting_synchro_) != nullptr)
261         synchro_description = "I/O";
262
263       XBT_INFO("Actor %ld (%s@%s): waiting for %s activity %#zx (%s) in state %d to finish", actor->get_pid(),
264                actor->get_cname(), actor->get_host()->get_cname(), synchro_description,
265                (xbt_log_no_loc ? (size_t)0xDEADBEEF : (size_t)actor->waiting_synchro_.get()),
266                actor->waiting_synchro_->get_cname(), (int)actor->waiting_synchro_->state_);
267     } else {
268       XBT_INFO("Actor %ld (%s@%s) simcall %s", actor->get_pid(), actor->get_cname(), actor->get_host()->get_cname(), SIMIX_simcall_name(actor->simcall_.call_));
269
270     }
271   }
272 }
273
274 config::Flag<double> cfg_breakpoint{"debug/breakpoint",
275                                     "When non-negative, raise a SIGTRAP after given (simulated) time", -1.0};
276 } // namespace simix
277 } // namespace simgrid
278
279 static simgrid::kernel::actor::ActorCode maestro_code;
280 void SIMIX_set_maestro(void (*code)(void*), void* data)
281 {
282 #ifdef _WIN32
283   XBT_INFO("WARNING, SIMIX_set_maestro is believed to not work on windows. Please help us investigating this issue if "
284            "you need that feature");
285 #endif
286   maestro_code = std::bind(code, data);
287 }
288
289 void SIMIX_global_init(int* argc, char** argv)
290 {
291   if (simix_global == nullptr) {
292     simix_global = std::make_unique<simgrid::simix::Global>();
293
294 #if SIMGRID_HAVE_MC
295     // The communication initialization is done ASAP, as we need to get some init parameters from the MC for different layers.
296     // But simix_global needs to be created, as we send the address of some of its fields to the MC that wants to read them directly.
297     simgrid::mc::AppSide::initialize();
298 #endif
299
300     surf_init(argc, argv); /* Initialize SURF structures */
301
302     simix_global->maestro_ = nullptr;
303     SIMIX_context_mod_init();
304
305     // Either create a new context with maestro or create
306     // a context object with the current context maestro):
307     simgrid::kernel::actor::create_maestro(maestro_code);
308
309     /* Prepare to display some more info when dying on Ctrl-C pressing */
310     std::signal(SIGINT, inthandler);
311
312 #ifndef _WIN32
313     install_segvhandler();
314 #endif
315     /* register a function to be called by SURF after the environment creation */
316     sg_platf_init();
317     simgrid::s4u::Engine::on_platform_created.connect(surf_presolve);
318   }
319
320   if (simgrid::config::get_value<bool>("debug/clean-atexit"))
321     atexit(SIMIX_clean);
322 }
323
324 /**
325  * @ingroup SIMIX_API
326  * @brief Clean the SIMIX simulation
327  *
328  * This functions remove the memory used by SIMIX
329  */
330 void SIMIX_clean()
331 {
332   static bool smx_cleaned = false;
333   if (smx_cleaned)
334     return; // to avoid double cleaning by java and C
335
336   smx_cleaned = true;
337   XBT_DEBUG("SIMIX_clean called. Simulation's over.");
338   if (not simix_global->actors_to_run.empty() && SIMIX_get_clock() <= 0.0) {
339     XBT_CRITICAL("   ");
340     XBT_CRITICAL("The time is still 0, and you still have processes ready to run.");
341     XBT_CRITICAL("It seems that you forgot to run the simulation that you setup.");
342     xbt_die("Bailing out to avoid that stop-before-start madness. Please fix your code.");
343   }
344
345 #if HAVE_SMPI
346   if (not simix_global->process_list.empty()) {
347     if (smpi_process()->initialized()) {
348       xbt_die("Process exited without calling MPI_Finalize - Killing simulation");
349     } else {
350       XBT_WARN("Process called exit when leaving - Skipping cleanups");
351       return;
352     }
353   }
354 #endif
355
356   /* Kill all processes (but maestro) */
357   simix_global->maestro_->kill_all();
358   simix_global->run_all_actors();
359   simix_global->empty_trash();
360
361   /* Exit the SIMIX network module */
362   SIMIX_mailbox_exit();
363
364   while (not simgrid::simix::simix_timers().empty()) {
365     delete simgrid::simix::simix_timers().top().second;
366     simgrid::simix::simix_timers().pop();
367   }
368   /* Free the remaining data structures */
369   simix_global->actors_to_run.clear();
370   simix_global->actors_that_ran.clear();
371   simix_global->actors_to_destroy.clear();
372   simix_global->process_list.clear();
373
374 #if SIMGRID_HAVE_MC
375   xbt_dynar_free(&simix_global->actors_vector);
376   xbt_dynar_free(&simix_global->dead_actors_vector);
377 #endif
378
379   /* Let's free maestro now */
380   delete simix_global->maestro_;
381   simix_global->maestro_ = nullptr;
382
383   /* Finish context module and SURF */
384   SIMIX_context_mod_exit();
385
386   surf_exit();
387
388   simix_global = nullptr;
389 }
390
391 /**
392  * @ingroup SIMIX_API
393  * @brief A clock (in second).
394  *
395  * @return Return the clock.
396  */
397 double SIMIX_get_clock()
398 {
399   if (MC_is_active() || MC_record_replay_is_active()) {
400     return MC_process_clock_get(SIMIX_process_self());
401   } else {
402     return surf_get_clock();
403   }
404 }
405
406 /** Handle any pending timer. Returns if something was actually run. */
407 static bool SIMIX_execute_timers()
408 {
409   bool result = false;
410   while (not simgrid::simix::simix_timers().empty() &&
411          SIMIX_get_clock() >= simgrid::simix::simix_timers().top().first) {
412     result = true;
413     // FIXME: make the timers being real callbacks (i.e. provide dispatchers that read and expand the args)
414     smx_timer_t timer = simgrid::simix::simix_timers().top().second;
415     simgrid::simix::simix_timers().pop();
416     timer->callback();
417     delete timer;
418   }
419   return result;
420 }
421
422 /**
423  * @ingroup SIMIX_API
424  * @brief Run the main simulation loop.
425  */
426 void SIMIX_run()
427 {
428   if (MC_record_replay_is_active()) {
429     simgrid::mc::replay(MC_record_path());
430     return;
431   }
432
433   double time = 0;
434
435   do {
436     XBT_DEBUG("New Schedule Round; size(queue)=%zu", simix_global->actors_to_run.size());
437
438     if (simgrid::simix::cfg_breakpoint >= 0.0 && surf_get_clock() >= simgrid::simix::cfg_breakpoint) {
439       XBT_DEBUG("Breakpoint reached (%g)", simgrid::simix::cfg_breakpoint.get());
440       simgrid::simix::cfg_breakpoint = -1.0;
441 #ifdef SIGTRAP
442       std::raise(SIGTRAP);
443 #else
444       std::raise(SIGABRT);
445 #endif
446     }
447
448     simix_global->execute_tasks();
449
450     while (not simix_global->actors_to_run.empty()) {
451       XBT_DEBUG("New Sub-Schedule Round; size(queue)=%zu", simix_global->actors_to_run.size());
452
453       /* Run all processes that are ready to run, possibly in parallel */
454       simix_global->run_all_actors();
455
456       /* answer sequentially and in a fixed arbitrary order all the simcalls that were issued during that sub-round */
457
458       /* WARNING, the order *must* be fixed or you'll jeopardize the simulation reproducibility (see RR-7653) */
459
460       /* Here, the order is ok because:
461        *
462        *   Short proof: only maestro adds stuff to the actors_to_run array, so the execution order of user contexts do
463        *   not impact its order.
464        *
465        *   Long proof: actors remain sorted through an arbitrary (implicit, complex but fixed) order in all cases.
466        *
467        *   - if there is no kill during the simulation, actors remain sorted according by their PID.
468        *     Rationale: This can be proved inductively.
469        *        Assume that actors_to_run is sorted at a beginning of one round (it is at round 0: the deployment file
470        *        is parsed linearly).
471        *        Let's show that it is still so at the end of this round.
472        *        - if an actor is added when being created, that's from maestro. It can be either at startup
473        *          time (and then in PID order), or in response to a process_create simcall. Since simcalls are handled
474        *          in arbitrary order (inductive hypothesis), we are fine.
475        *        - If an actor is added because it's getting killed, its subsequent actions shouldn't matter
476        *        - If an actor gets added to actors_to_run because one of their blocking action constituting the meat
477        *          of a simcall terminates, we're still good. Proof:
478        *          - You are added from ActorImpl::simcall_answer() only. When this function is called depends on the
479        *            resource kind (network, cpu, disk, whatever), but the same arguments hold. Let's take communications
480        *            as an example.
481        *          - For communications, this function is called from SIMIX_comm_finish().
482        *            This function itself don't mess with the order since simcalls are handled in FIFO order.
483        *            The function is called:
484        *            - before the comm starts (invalid parameters, or resource already dead or whatever).
485        *              The order then trivial holds since maestro didn't interrupt its handling of the simcall yet
486        *            - because the communication failed or were canceled after startup. In this case, it's called from
487        *              the function we are in, by the chunk:
488        *                       set = model->states.failed_action_set;
489        *                       while ((synchro = extract(set)))
490        *                          SIMIX_simcall_post((smx_synchro_t) synchro->data);
491        *              This order is also fixed because it depends of the order in which the surf actions were
492        *              added to the system, and only maestro can add stuff this way, through simcalls.
493        *              We thus use the inductive hypothesis once again to conclude that the order in which synchros are
494        *              popped out of the set does not depend on the user code's execution order.
495        *            - because the communication terminated. In this case, synchros are served in the order given by
496        *                       set = model->states.done_action_set;
497        *                       while ((synchro = extract(set)))
498        *                          SIMIX_simcall_post((smx_synchro_t) synchro->data);
499        *              and the argument is very similar to the previous one.
500        *            So, in any case, the orders of calls to CommImpl::finish() do not depend on the order in which user
501        *            actors are executed.
502        *          So, in any cases, the orders of actors within actors_to_run do not depend on the order in which
503        *          user actors were executed previously.
504        *     So, if there is no killing in the simulation, the simulation reproducibility is not jeopardized.
505        *   - If there is some actor killings, the order is changed by this decision that comes from user-land
506        *     But this decision may not have been motivated by a situation that were different because the simulation is
507        *     not reproducible.
508        *     So, even the order change induced by the actor killing is perfectly reproducible.
509        *
510        *   So science works, bitches [http://xkcd.com/54/].
511        *
512        *   We could sort the actors_that_ran array completely so that we can describe the order in which simcalls are
513        *   handled (like "according to the PID of issuer"), but it's not mandatory (order is fixed already even if
514        *   unfriendly).
515        *   That would thus be a pure waste of time.
516        */
517
518       for (auto const& actor : simix_global->actors_that_ran) {
519         if (actor->simcall_.call_ != simgrid::simix::Simcall::NONE) {
520           actor->simcall_handle(0);
521         }
522       }
523
524       simix_global->execute_tasks();
525       do {
526         simix_global->wake_all_waiting_actors();
527       } while (simix_global->execute_tasks());
528
529       /* If only daemon processes remain, cancel their actions, mark them to die and reschedule them */
530       if (simix_global->process_list.size() == simix_global->daemons.size())
531         for (auto const& dmon : simix_global->daemons) {
532           XBT_DEBUG("Kill %s", dmon->get_cname());
533           simix_global->maestro_->kill(dmon);
534         }
535     }
536
537     time = simgrid::simix::Timer::next();
538     if (time > -1.0 || not simix_global->process_list.empty()) {
539       XBT_DEBUG("Calling surf_solve");
540       time = surf_solve(time);
541       XBT_DEBUG("Moving time ahead : %g", time);
542     }
543
544     /* Notify all the hosts that have failed */
545     /* FIXME: iterate through the list of failed host and mark each of them */
546     /* as failed. On each host, signal all the running processes with host_fail */
547
548     // Execute timers and tasks until there isn't anything to be done:
549     bool again = false;
550     do {
551       again = SIMIX_execute_timers();
552       if (simix_global->execute_tasks())
553         again = true;
554       simix_global->wake_all_waiting_actors();
555     } while (again);
556
557     /* Clean actors to destroy */
558     simix_global->empty_trash();
559
560     XBT_DEBUG("### time %f, #processes %zu, #to_run %zu", time, simix_global->process_list.size(),
561               simix_global->actors_to_run.size());
562
563     if (time < 0. && simix_global->actors_to_run.empty() && not simix_global->process_list.empty()) {
564       if (simix_global->process_list.size() <= simix_global->daemons.size()) {
565         XBT_CRITICAL("Oops! Daemon actors cannot do any blocking activity (communications, synchronization, etc) "
566                      "once the simulation is over. Please fix your on_exit() functions.");
567       } else {
568         XBT_CRITICAL("Oops! Deadlock or code not perfectly clean.");
569       }
570       simix_global->display_all_actor_status();
571       simgrid::s4u::Engine::on_deadlock();
572       for (auto const& kv : simix_global->process_list) {
573         XBT_DEBUG("Kill %s", kv.second->get_cname());
574         simix_global->maestro_->kill(kv.second);
575       }
576     }
577   } while (time > -1.0 || not simix_global->actors_to_run.empty());
578
579   if (not simix_global->process_list.empty())
580     THROW_IMPOSSIBLE;
581
582   simgrid::s4u::Engine::on_simulation_end();
583 }
584
585 double SIMIX_timer_next() // XBT_ATTRIB_DEPRECATED_v329
586 {
587   return simgrid::simix::Timer::next();
588 }
589
590 smx_timer_t SIMIX_timer_set(double date, void (*callback)(void*), void* arg) // XBT_ATTRIB_DEPRECATED_v329
591 {
592   return simgrid::simix::Timer::set(date, std::bind(callback, arg));
593 }
594
595 /** @brief cancels a timer that was added earlier */
596 void SIMIX_timer_remove(smx_timer_t timer) // XBT_ATTRIB_DEPRECATED_v329
597 {
598   timer->remove();
599 }
600
601 /** @brief Returns the date at which the timer will trigger (or 0 if nullptr timer) */
602 double SIMIX_timer_get_date(smx_timer_t timer) // XBT_ATTRIB_DEPRECATED_v329
603 {
604   return timer ? timer->date : 0.0;
605 }
606
607 void SIMIX_display_process_status() // XBT_ATTRIB_DEPRECATED_v329
608 {
609   simix_global->display_all_actor_status();
610 }
611
612 int SIMIX_is_maestro()
613 {
614   if (simix_global == nullptr) // SimDag
615     return true;
616   const simgrid::kernel::actor::ActorImpl* self = SIMIX_process_self();
617   return self == nullptr || self == simix_global->maestro_;
618 }