Logo AND Algorithmique Numérique Distribuée

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