- if (argc < 3) {
- XBT_CRITICAL("Usage: %s platform_file deployment_file\n", argv[0]);
- XBT_CRITICAL("example: %s msg_platform.xml msg_deployment_suspend.xml\n",
- argv[0]);
- exit(1);
- }
- test_all(argv[1], argv[2]);
-
- if (res == MSG_OK)
- return 0;
- else
- return 1;
-} /* end_of_main */
+ xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
+
+ MSG_create_environment(argv[1]);
+ MSG_function_register("dream_master", dream_master);
+ xbt_dynar_t hosts = MSG_hosts_as_dynar();
+ MSG_process_create("dream_master", dream_master, NULL, xbt_dynar_getfirst_as(hosts, msg_host_t));
+ xbt_dynar_free(&hosts);
+ res = MSG_main();
+
+ XBT_INFO("Simulation time %g", MSG_get_clock());
+ return res != MSG_OK;
+}