Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
no need for a lib to store the netcards. A dict is easier
[simgrid.git] / src / mc / mc_smx.h
1 /* Copyright (c) 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_SMX_H
8 #define SIMGRID_MC_SMX_H
9
10 #include <stddef.h>
11
12 #include <xbt/base.h>
13 #include <xbt/log.h>
14
15 #include <simgrid/simix.h>
16
17 #include "src/smpi/private.h"
18
19 #include "src/mc/Process.hpp"
20 #include "src/mc/mc_protocol.h"
21
22 /** @file
23  *  @brief (Cross-process, MCer/MCed) Access to SMX structures
24  *
25  *  We copy some C data structure from the MCed process in the MCer process.
26  *  This is implemented by:
27  *
28  *   - `model_checker->process.smx_process_infos`
29  *      (copy of `simix_global->process_list`);
30  *
31  *   - `model_checker->process.smx_old_process_infos`
32  *      (copy of `simix_global->process_to_destroy`);
33  *
34  *   - `model_checker->hostnames`.
35  *
36  * The process lists are currently refreshed each time MCed code is executed.
37  * We don't try to give a persistent MCer address for a given MCed process.
38  * For this reason, a MCer simgrid::mc::Process* is currently not reusable after
39  * MCed code.
40  */
41
42 SG_BEGIN_DECL()
43
44 /** Get the issuer of  a simcall (`req->issuer`)
45  *
46  *  In split-process mode, it does the black magic necessary to get an address
47  *  of a (shallow) copy of the data structure the issuer SIMIX process in the local
48  *  address space.
49  *
50  *  @param process the MCed process
51  *  @param req     the simcall (copied in the local process)
52  */
53 XBT_PRIVATE smx_actor_t MC_smx_simcall_get_issuer(s_smx_simcall_t const* req);
54
55 XBT_PRIVATE const char* MC_smx_process_get_name(smx_actor_t p);
56 XBT_PRIVATE const char* MC_smx_process_get_host_name(smx_actor_t p);
57
58 XBT_PRIVATE int MC_smpi_process_count(void);
59
60 XBT_PRIVATE unsigned long MC_smx_get_maxpid(void);
61
62 SG_END_DECL()
63
64 #endif