void MSG_global_init(int *argc, char **argv)
{
#ifdef HAVE_TRACING
- TRACE_global_init (argc, argv);
+ TRACE_global_init(argc, argv);
#endif
xbt_getpid = MSG_process_self_PID;
msg_global->PID = 1;
msg_global->sent_msg = 0;
- /* initialization of the mailbox module */
- MSG_mailbox_mod_init();
-
/* initialization of the action module */
_MSG_action_init();
SIMIX_function_register_process_cleanup(__MSG_process_cleanup);
SIMIX_function_register_process_kill(_MSG_process_kill_from_SIMIX);
}
+#ifdef HAVE_TRACING
+ TRACE_start();
+#endif
}
/** \defgroup m_channel_management Understanding channels
/* Clean IO before the run */
fflush(stdout);
fflush(stderr);
- SIMIX_init();
-#ifdef HAVE_MC
- if (_surf_do_model_check)
- MC_modelcheck(1);
- else
-#endif
- while (SIMIX_solve(NULL, NULL) != -1.0);
-
+ if (MC_IS_ENABLED) {
+ MC_modelcheck();
+ }
+ else {
+ SIMIX_run();
+ }
return MSG_OK;
}
m_process_t p = NULL;
#ifdef HAVE_TRACING
- TRACE_surf_finalize();
+ TRACE_surf_release();
#endif
while ((p = xbt_fifo_pop(msg_global->process_list))) {
free(msg_global);
msg_global = NULL;
- /* cleanup all resources in the mailbox module */
- MSG_mailbox_mod_exit();
-
/* initialization of the action module */
_MSG_action_exit();
+#ifdef HAVE_TRACING
+ TRACE_end();
+#endif
+
SIMIX_clean();
return MSG_OK;
/** \ingroup msg_easier_life
* \brief A clock (in second).
*/
-double MSG_get_clock(void)
+XBT_INLINE double MSG_get_clock(void)
{
return SIMIX_get_clock();
}