Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
c3a63c1bf1b19c5cb0eb81ab86c81d839c214b4a
[simgrid.git] / src / mc / mc_base.h
1 /* Copyright (c) 2008-2014. 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 MC_BASE_H
8 #define MC_BASE_H
9
10 #include <xbt/misc.h>
11 #include <simgrid/simix.h>
12 #include "simgrid_config.h"
13 #include "internal_config.h"
14 #include "../simix/smx_private.h"
15
16 // Marker for symbols which should be defined as XBT_PRIVATE but are used in
17 // unit tests:
18 #define MC_SHOULD_BE_INTERNAL
19
20 SG_BEGIN_DECL()
21
22 /** Check if the given simcall can be resolved
23  *
24  *  \return `TRUE` or `FALSE`
25  */
26 int MC_request_is_enabled(smx_simcall_t req);
27
28 /** Check if the given simcall is visible
29  *
30  *  \return `TRUE` or `FALSE`
31  */
32 int MC_request_is_visible(smx_simcall_t req);
33
34 /** Execute everything which is invisible
35  *
36  *  Execute all the processes that are ready to run and all invisible simcalls
37  *  iteratively until there doesn't remain any. At this point, the function
38  *  returns to the caller which can handle the visible (and ready) simcalls.
39  */
40 void MC_wait_for_requests(void);
41
42 XBT_INTERNAL extern double *mc_time;
43
44 SG_END_DECL()
45
46 #endif