Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
5fcffaa33e98fa893aadf772cad5c536f4c95d2e
[simgrid.git] / src / mc / mc_base.h
1 /* Copyright (c) 2008-2017. 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
10 #include <xbt/base.h>
11 #include <simgrid/forward.h>
12
13 #ifdef __cplusplus
14
15 #include <vector>
16
17 namespace simgrid {
18 namespace mc {
19
20 /** Can this requests can be executed?
21  *
22  *  Most requests are always enabled but WAIT and WAITANY
23  *  are not always enabled: a WAIT where the communication does not
24  *  have both a source and a destination yet is not enabled
25  *  (unless timeout is enabled in the wait and enabeld in SimGridMC).
26  */
27 XBT_PRIVATE bool request_is_enabled(smx_simcall_t req);
28
29 /** Execute everything which is invisible
30  *
31  *  Execute all the processes that are ready to run and all invisible simcalls
32  *  iteratively until there doesn't remain any. At this point, the function
33  *  returns to the caller which can handle the visible (and ready) simcalls.
34  */
35 XBT_PRIVATE void wait_for_requests();
36
37 XBT_PRIVATE extern std::vector<double> processes_time;
38
39 /** Execute a given simcall */
40 XBT_PRIVATE void handle_simcall(smx_simcall_t req, int req_num);
41
42 /** Check if the given simcall is visible
43  *
44  *  \return `TRUE` or `FALSE`
45  */
46 XBT_PRIVATE bool request_is_visible(smx_simcall_t req);
47
48 }
49 }
50
51 #endif
52
53 #endif