Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cleanups: there is no random in the platforms since a while
[simgrid.git] / src / mc / mc_request.h
1 /* Copyright (c) 2007-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_REQUEST_H
8 #define SIMGRID_MC_REQUEST_H
9
10 #include <xbt/base.h>
11
12 #include <simgrid_config.h>
13
14 #include "src/simix/smx_private.h"
15
16 SG_BEGIN_DECL()
17
18 typedef enum e_mc_request_type {
19   MC_REQUEST_SIMIX,
20   MC_REQUEST_EXECUTED,
21   MC_REQUEST_INTERNAL,
22 } e_mc_request_type_t;
23
24 XBT_PRIVATE int MC_request_depend(smx_simcall_t req1, smx_simcall_t req2);
25 XBT_PRIVATE char* MC_request_to_string(smx_simcall_t req, int value, e_mc_request_type_t type);
26 XBT_PRIVATE unsigned int MC_request_testany_fail(smx_simcall_t req);
27 /* XBT_PRIVATE int MC_waitany_is_enabled_by_comm(smx_req_t req, unsigned int comm);*/
28 XBT_PRIVATE int MC_request_is_visible(smx_simcall_t req);
29
30 /** Can this requests can be executed.
31  *
32  *  Most requests are always enabled but WAIT and WAITANY
33  *  are not always enabled: a WAIT where the communication does not
34  *  have both a source and a destination yet is not enabled
35  *  (unless timeout is enabled in the wait and enabeld in SimGridMC).
36  */
37 XBT_PRIVATE int MC_request_is_enabled(smx_simcall_t req);
38 XBT_PRIVATE int MC_request_is_enabled_by_idx(smx_simcall_t req, unsigned int idx);
39
40 /** Is the process ready to execute its simcall?
41  *
42  *  This is true if the request associated with the process is ready.
43  */
44 XBT_PRIVATE int MC_process_is_enabled(smx_process_t process);
45
46 XBT_PRIVATE char *MC_request_get_dot_output(smx_simcall_t req, int value);
47
48 SG_END_DECL()
49
50 #endif