Logo AND Algorithmique Numérique Distribuée

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