1 /* Copyright (c) 2008-2021. 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_HPP
7 #define SIMGRID_MC_BASE_HPP
9 #include "simgrid/forward.h"
15 /** Execute everything which is invisible
17 * Execute all the processes that are ready to run and all invisible simcalls
18 * iteratively until there doesn't remain any. At this point, the function
19 * returns to the caller which can handle the visible (and ready) simcalls.
21 XBT_PRIVATE void execute_actors();
23 XBT_PRIVATE extern std::vector<double> processes_time;
25 /** Execute a given simcall */
26 XBT_PRIVATE void handle_simcall(smx_simcall_t req, int req_num);
28 /** Is the process ready to execute its simcall?
30 * This is true if the request associated with the process is ready.
32 * Most requests are always enabled but WAIT and WAITANY
33 * are not always enabled: a WAIT where the communication does not
34 * have both a source and a destination yet is not enabled
35 * (unless timeout is enabled in the wait and enabled in SimGridMC).
37 XBT_PRIVATE bool actor_is_enabled(smx_actor_t process);
39 /** Check if the given simcall is visible */
40 XBT_PRIVATE bool request_is_visible(const s_smx_simcall* req);
42 } // namespace simgrid