Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make Simcall a real class.
[simgrid.git] / src / mc / mc_base.hpp
1 /* Copyright (c) 2008-2022. 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 #ifndef SIMGRID_MC_BASE_HPP
7 #define SIMGRID_MC_BASE_HPP
8
9 #include "simgrid/forward.h"
10 #include <vector>
11
12 namespace simgrid {
13 namespace mc {
14
15 /** Execute everything which is invisible
16  *
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.
20  */
21 XBT_PRIVATE void execute_actors();
22
23 XBT_PRIVATE extern std::vector<double> processes_time;
24
25 /** Execute a given simcall */
26 XBT_PRIVATE void handle_simcall(simix::Simcall* req, int req_num);
27
28 /** Is the process ready to execute its simcall?
29  *
30  *  This is true if the request associated with the process is ready.
31  *
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).
36  */
37 XBT_PRIVATE bool actor_is_enabled(smx_actor_t process);
38
39 /** Check if the given simcall is visible */
40 XBT_PRIVATE bool request_is_visible(const simix::Simcall* req);
41 } // namespace mc
42 } // namespace simgrid
43
44 #endif