Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Move mc_model_checker in its own .c file
[simgrid.git] / src / mc / mc_model_checker.h
1 /* Copyright (c) 2007-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_MODEL_CHECKER_H
8 #define MC_MODEL_CHECKER_H
9
10 #include <sys/types.h>
11
12 #include <simgrid_config.h>
13
14 #include "mc_forward.h"
15 #include "mc_process.h"
16 #include "mc_page_store.h"
17
18 SG_BEGIN_DECL()
19
20 typedef enum {
21   MC_MODE_NONE = 0,
22   MC_MODE_STANDALONE,
23   MC_MODE_CLIENT,
24   MC_MODE_SERVER
25 } e_mc_mode_t;
26
27 extern e_mc_mode_t mc_mode;
28
29 /** @brief State of the model-checker (global variables for the model checker)
30  *
31  *  Each part of the state of the model chercker represented as a global
32  *  variable prevents some sharing between snapshots and must be ignored.
33  *  By moving as much state as possible in this structure allocated
34  *  on the model-chercker heap, we avoid those issues.
35  */
36 struct s_mc_model_checker {
37   // This is the parent snapshot of the current state:
38   mc_snapshot_t parent_snapshot;
39   mc_pages_store_t pages;
40   int fd_clear_refs;
41   int fd_pagemap;
42   xbt_dynar_t record;
43   s_mc_process_t process;
44 };
45
46 mc_model_checker_t MC_model_checker_new(pid_t pid, int socket);
47 void MC_model_checker_delete(mc_model_checker_t mc);
48
49 SG_END_DECL()
50
51 #endif