*/
void MSG_global_init(void)
{
- if (!msg_global) {
- int argc=0;
- char **argv=NULL;
+ int argc=0;
+ char **argv=NULL;
+
+ CRITICAL0("Please stop using this function. Use MSG_global_init_args instead.");
+ DIE_IMPOSSIBLE;
+ MSG_global_init_args(&argc,argv);
+}
+void MSG_global_init_args(int *argc, char **argv)
+{
+ if (!msg_global) {
msg_global = xbt_new0(s_MSG_Global_t,1);
- surf_init(&argc, argv); /* Initialize some common structures */
+ surf_init(argc, argv); /* Initialize some common structures */
xbt_context_init();
msg_global->host = xbt_fifo_new();
msg_global->process_to_run = xbt_fifo_new();
*/
MSG_error_t MSG_set_channel_number(int number)
{
- MSG_global_init();
-
- xbt_assert0((msg_global->max_channel == 0), "Channel number already set!");
+ xbt_assert0((msg_global) && (msg_global->max_channel == 0), "Channel number already set!");
msg_global->max_channel = number;
*/
int MSG_get_channel_number(void)
{
- MSG_global_init();
-
- xbt_assert0((msg_global->max_channel != 0), "Channel number not set yet!");
+ xbt_assert0((msg_global)&&(msg_global->max_channel != 0), "Channel number not set yet!");
return msg_global->max_channel;
}