Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Remove useless bits
[simgrid.git] / src / mc / mc_base.h
1 /* Copyright (c) 2008-2015. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef SIMGRID_MC_BASE_H
8 #define SIMGRID_MC_BASE_H
9
10 #include <xbt/base.h>
11 #include "src/simix/popping_private.h" // smx_simcall_t
12
13 #ifdef __cplusplus
14
15 namespace simgrid {
16 namespace mc {
17
18 /** Can this requests can be executed?
19  *
20  *  Most requests are always enabled but WAIT and WAITANY
21  *  are not always enabled: a WAIT where the communication does not
22  *  have both a source and a destination yet is not enabled
23  *  (unless timeout is enabled in the wait and enabeld in SimGridMC).
24  */
25 XBT_PRIVATE bool request_is_enabled(smx_simcall_t req);
26
27 /** Execute everything which is invisible
28  *
29  *  Execute all the processes that are ready to run and all invisible simcalls
30  *  iteratively until there doesn't remain any. At this point, the function
31  *  returns to the caller which can handle the visible (and ready) simcalls.
32  */
33 XBT_PRIVATE void wait_for_requests(void);
34
35 XBT_PRIVATE extern std::vector<double> processes_time;
36
37 /** Execute a given simcall */
38 XBT_PRIVATE void handle_simcall(smx_simcall_t req, int req_num);
39
40 /** Check if the given simcall is visible
41  *
42  *  \return `TRUE` or `FALSE`
43  */
44 XBT_PRIVATE bool request_is_visible(smx_simcall_t req);
45
46 }
47 }
48
49 #endif
50
51 #endif