Logo AND Algorithmique Numérique Distribuée

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