1 /* Copyright (c) 2008-2015. The SimGrid Team.
2 * All rights reserved. */
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. */
7 #ifndef SIMGRID_MC_BASE_H
8 #define SIMGRID_MC_BASE_H
16 typedef struct s_smx_simcall s_smx_simcall_t;
17 typedef struct s_smx_simcall* smx_simcall_t;
24 /** Can this requests can be executed?
26 * Most requests are always enabled but WAIT and WAITANY
27 * are not always enabled: a WAIT where the communication does not
28 * have both a source and a destination yet is not enabled
29 * (unless timeout is enabled in the wait and enabeld in SimGridMC).
31 XBT_PRIVATE bool request_is_enabled(smx_simcall_t req);
33 /** Execute everything which is invisible
35 * Execute all the processes that are ready to run and all invisible simcalls
36 * iteratively until there doesn't remain any. At this point, the function
37 * returns to the caller which can handle the visible (and ready) simcalls.
39 XBT_PRIVATE void wait_for_requests(void);
41 XBT_PRIVATE extern std::vector<double> processes_time;
43 /** Execute a given simcall */
44 XBT_PRIVATE void handle_simcall(smx_simcall_t req, int req_num);
46 /** Check if the given simcall is visible
48 * \return `TRUE` or `FALSE`
50 XBT_PRIVATE bool request_is_visible(smx_simcall_t req);