Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Move collective algorithms to separate folders
[simgrid.git] / src / mc / mc_smx.h
1 /* Copyright (c) 2015-2017. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef SIMGRID_MC_SMX_H
7 #define SIMGRID_MC_SMX_H
8
9 #include <stddef.h>
10
11 #include <xbt/base.h>
12 #include <xbt/log.h>
13
14 #include <simgrid/simix.h>
15
16 #include "src/smpi/private.h"
17
18 #include "src/mc/Process.hpp"
19 #include "src/mc/remote/mc_protocol.h"
20
21 /** @file
22  *  @brief (Cross-process, MCer/MCed) Access to SMX structures
23  *
24  *  We copy some C data structure from the MCed process in the MCer process.
25  *  This is implemented by:
26  *
27  *   - `model_checker->process.smx_process_infos`
28  *      (copy of `simix_global->process_list`);
29  *
30  *   - `model_checker->process.smx_old_process_infos`
31  *      (copy of `simix_global->process_to_destroy`);
32  *
33  *   - `model_checker->hostnames`.
34  *
35  * The process lists are currently refreshed each time MCed code is executed.
36  * We don't try to give a persistent MCer address for a given MCed process.
37  * For this reason, a MCer simgrid::mc::Process* is currently not reusable after
38  * MCed code.
39  */
40
41 SG_BEGIN_DECL()
42
43 /** Get the issuer of  a simcall (`req->issuer`)
44  *
45  *  In split-process mode, it does the black magic necessary to get an address
46  *  of a (shallow) copy of the data structure the issuer SIMIX process in the local
47  *  address space.
48  *
49  *  @param process the MCed process
50  *  @param req     the simcall (copied in the local process)
51  */
52 XBT_PRIVATE smx_actor_t MC_smx_simcall_get_issuer(s_smx_simcall_t const* req);
53
54 XBT_PRIVATE const char* MC_smx_actor_get_name(smx_actor_t p);
55 XBT_PRIVATE const char* MC_smx_actor_get_host_name(smx_actor_t p);
56
57 XBT_PRIVATE int MC_smpi_process_count(void);
58
59 XBT_PRIVATE unsigned long MC_smx_get_maxpid(void);
60
61 SG_END_DECL()
62
63 #endif