2 #include "xbt/sysdep.h"
4 #include "xbt/ex.h" /* ex_backtrace_display */
6 MSG_Global_t msg_global = NULL;
8 /* static void MarkAsFailed(m_task_t t, TBX_HashTable_t failedProcessList); */
9 /* static xbt_fifo_t MSG_buildFailedHostList(double a, double b); */
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
18 /********************************* MSG **************************************/
20 /** \ingroup msg_simulation
21 * \brief Initialize some MSG internal data.
23 void MSG_global_init_args(int *argc, char **argv)
25 MSG_global_init(argc,argv);
28 /** \ingroup msg_simulation
29 * \brief Initialize some MSG internal data.
31 void MSG_global_init(int *argc, char **argv)
37 /** \ingroup msg_easier_life
38 * \brief Traces MSG events in the Paje format.
40 void MSG_paje_output(const char *filename)
45 /** \defgroup m_channel_management Understanding channels
46 * \brief This section briefly describes the channel notion of MSG
48 * \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Channels" --> \endhtmlonly
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.
58 /** \ingroup m_channel_management
59 * \brief Set the number of channel in the simulation.
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
66 * \param number the number of channel in the simulation. It has to be >0
68 MSG_error_t MSG_set_channel_number(int number)
74 /** \ingroup m_channel_management
75 * \brief Return the number of channel in the simulation.
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.
81 int MSG_get_channel_number(void)
86 void __MSG_display_process_status(void)
90 /* FIXME: Yeah, I'll do it in a portable maner one day [Mt] */
93 static void _XBT_CALL inthandler(int ignored)
95 INFO0("CTRL-C pressed. Displaying status and bailing out");
96 __MSG_display_process_status();
100 /** \ingroup msg_simulation
101 * \brief Launch the MSG simulation
103 MSG_error_t MSG_main(void)
108 /** \ingroup msg_simulation
109 * \brief Kill all running process
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.
115 int MSG_process_killall(int reset_PIDs)
120 /** \ingroup msg_simulation
121 * \brief Clean the MSG simulation
123 MSG_error_t MSG_clean(void)
129 /** \ingroup msg_easier_life
130 * \brief A clock (in second).
132 double MSG_get_clock(void)