1 /* Copyright (c) 2008-2022. 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"
12 namespace simgrid::mc {
14 /** Execute everything which is invisible
16 * Execute all the processes that are ready to run and all invisible simcalls
17 * iteratively until there doesn't remain any. At this point, the function
18 * returns to the caller which can handle the visible (and ready) simcalls.
20 XBT_PRIVATE void execute_actors();
22 XBT_PRIVATE extern std::vector<double> processes_time;
24 /** Execute a given simcall */
25 XBT_PRIVATE void handle_simcall(kernel::actor::Simcall* req, int req_num);
27 /** Is the process ready to execute its simcall?
29 * This is true if the request associated with the process is ready.
31 * Most requests are always enabled but WAIT and WAITANY
32 * are not always enabled: a WAIT where the communication does not
33 * have both a source and a destination yet is not enabled
34 * (unless timeout is enabled in the wait and enabled in SimGridMC).
36 XBT_PRIVATE bool actor_is_enabled(kernel::actor::ActorImpl* process);
38 /** Check if the given simcall is visible */
39 XBT_PRIVATE bool request_is_visible(const kernel::actor::Simcall* req);
40 } // namespace simgrid::mc