Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] mc_comm_pattern.c containing all communication pattern functions
[simgrid.git] / src / mc / mc_model_checker.c
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 #include "mc_model_checker.h"
8 #include "mc_page_store.h"
9
10 mc_model_checker_t mc_model_checker = NULL;
11
12 mc_model_checker_t MC_model_checker_new(pid_t pid, int socket)
13 {
14   mc_model_checker_t mc = xbt_new0(s_mc_model_checker_t, 1);
15   mc->pages = mc_pages_store_new();
16   mc->fd_clear_refs = -1;
17   mc->fd_pagemap = -1;
18   MC_process_init(&mc->process, pid, socket);
19   mc->hosts = xbt_dict_new();
20   return mc;
21 }
22
23 void MC_model_checker_delete(mc_model_checker_t mc)
24 {
25   mc_pages_store_delete(mc->pages);
26   if(mc->record)
27     xbt_dynar_free(&mc->record);
28   MC_process_clear(&mc->process);
29   xbt_dict_free(&mc->hosts);
30 }