Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Python: Add Comm.wait_any
[simgrid.git] / src / mc / mc_base.h
1 /* Copyright (c) 2008-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 #ifndef SIMGRID_MC_BASE_H
7 #define SIMGRID_MC_BASE_H
8
9 #include "simgrid/forward.h"
10
11 #ifdef __cplusplus
12
13 #include <vector>
14
15 namespace simgrid {
16 namespace mc {
17
18 /** Execute everything which is invisible
19  *
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.
23  */
24 XBT_PRIVATE void wait_for_requests();
25
26 XBT_PRIVATE extern std::vector<double> processes_time;
27
28 /** Execute a given simcall */
29 XBT_PRIVATE void handle_simcall(smx_simcall_t req, int req_num);
30
31 /** Is the process ready to execute its simcall?
32  *
33  *  This is true if the request associated with the process is ready.
34  *
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).
39  */
40 XBT_PRIVATE bool actor_is_enabled(smx_actor_t process);
41
42 /** Check if the given simcall is visible */
43 XBT_PRIVATE bool request_is_visible(smx_simcall_t req);
44
45 }
46 }
47
48 #endif
49
50 #endif