1 /* Copyright (c) 2008-2018. The SimGrid Team. All rights reserved. */
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. */
6 #ifndef SIMGRID_MC_BASE_H
7 #define SIMGRID_MC_BASE_H
9 #include "simgrid/forward.h"
18 /** Execute everything which is invisible
20 * Execute all the processes that are ready to run and all invisible simcalls
21 * iteratively until there doesn't remain any. At this point, the function
22 * returns to the caller which can handle the visible (and ready) simcalls.
24 XBT_PRIVATE void wait_for_requests();
26 XBT_PRIVATE extern std::vector<double> processes_time;
28 /** Execute a given simcall */
29 XBT_PRIVATE void handle_simcall(smx_simcall_t req, int req_num);
31 /** Is the process ready to execute its simcall?
33 * This is true if the request associated with the process is ready.
35 * Most requests are always enabled but WAIT and WAITANY
36 * are not always enabled: a WAIT where the communication does not
37 * have both a source and a destination yet is not enabled
38 * (unless timeout is enabled in the wait and enabeld in SimGridMC).
40 XBT_PRIVATE bool actor_is_enabled(smx_actor_t process);
42 /** Check if the given simcall is visible */
43 XBT_PRIVATE bool request_is_visible(smx_simcall_t req);