Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cdd32d61e64c17aaf32ead718aec981f6f15a948
[simgrid.git] / src / msg_simix / global.c
1 #include "private.h"
2 #include "xbt/sysdep.h"
3 #include "xbt/log.h"
4 #include "xbt/ex.h" /* ex_backtrace_display */
5
6 MSG_Global_t msg_global = NULL;
7
8 /* static void MarkAsFailed(m_task_t t, TBX_HashTable_t failedProcessList); */
9 /* static xbt_fifo_t MSG_buildFailedHostList(double a, double b); */
10
11 /** \defgroup msg_simulation   MSG simulation Functions
12  *  \brief This section describes the functions you need to know to
13  *  set up a simulation. You should have a look at \ref MSG_examples 
14  *  to have an overview of their usage.
15  *    \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Simulation functions" --> \endhtmlonly
16  */
17
18 /********************************* MSG **************************************/
19
20 /** \ingroup msg_simulation
21  * \brief Initialize some MSG internal data.
22  */
23 void MSG_global_init_args(int *argc, char **argv)
24 {
25   MSG_global_init(argc,argv);
26 }
27
28 /** \ingroup msg_simulation
29  * \brief Initialize some MSG internal data.
30  */
31 void MSG_global_init(int *argc, char **argv)
32 {
33         return;
34
35 }
36
37 /** \ingroup msg_easier_life
38  * \brief Traces MSG events in the Paje format.
39  */
40 void MSG_paje_output(const char *filename)
41 {
42         return;
43 }
44
45 /** \defgroup m_channel_management    Understanding channels
46  *  \brief This section briefly describes the channel notion of MSG
47  *  (#m_channel_t).
48  *    \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Channels" --> \endhtmlonly
49  * 
50  *
51  *  For convenience, the simulator provides the notion of channel
52  *  that is close to the tag notion in MPI. A channel is not a
53  *  socket. It doesn't need to be opened neither closed. It rather
54  *  corresponds to the ports opened on the different machines.
55  */
56
57
58 /** \ingroup m_channel_management
59  * \brief Set the number of channel in the simulation.
60  *
61  * This function has to be called to fix the number of channel in the
62    simulation before creating any host. Indeed, each channel is
63    represented by a different mailbox on each #m_host_t. This
64    function can then be called only once. This function takes only one
65    parameter.
66  * \param number the number of channel in the simulation. It has to be >0
67  */
68 MSG_error_t MSG_set_channel_number(int number)
69 {
70
71   return MSG_OK;
72 }
73
74 /** \ingroup m_channel_management
75  * \brief Return the number of channel in the simulation.
76  *
77  * This function has to be called once the number of channel is fixed. I can't 
78    figure out a reason why anyone would like to call this function but nevermind.
79  * \return the number of channel in the simulation.
80  */
81 int MSG_get_channel_number(void)
82 {
83         return 0;
84 }
85
86 void __MSG_display_process_status(void)
87 {
88 }
89
90 /* FIXME: Yeah, I'll do it in a portable maner one day [Mt] */
91 #include <signal.h>
92
93 static void _XBT_CALL inthandler(int ignored)
94 {
95    INFO0("CTRL-C pressed. Displaying status and bailing out");
96    __MSG_display_process_status();
97    exit(1);
98 }
99
100 /** \ingroup msg_simulation
101  * \brief Launch the MSG simulation
102  */
103 MSG_error_t MSG_main(void)
104 {
105   return MSG_OK;
106 }
107
108 /** \ingroup msg_simulation
109  * \brief Kill all running process
110
111  * \param reset_PIDs should we reset the PID numbers. A negative
112  *   number means no reset and a positive number will be used to set the PID
113  *   of the next newly created process.
114  */
115 int MSG_process_killall(int reset_PIDs)
116 {
117   return 0;
118 }
119
120 /** \ingroup msg_simulation
121  * \brief Clean the MSG simulation
122  */
123 MSG_error_t MSG_clean(void)
124 {
125   return MSG_OK;
126 }
127
128
129 /** \ingroup msg_easier_life
130  * \brief A clock (in second).
131  */
132 double MSG_get_clock(void) 
133 {
134         return 0.0;
135 }
136