int main(int argc, char *argv[])
{
MSG_init(&argc, argv);
- if (argc != 3) {
- printf("Usage: %s platform_file deployment_file\n", argv[0]);
- printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]);
- exit(1);
- }
- const char *platform_file = argv[1];
+ xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
+
+ const char *platform_file = argv[1];
const char *application_file = argv[2];
MSG_create_environment(platform_file);
MSG_function_register("receiver", receiver);
#endif
XBT_INFO("Simulation time %g", MSG_get_clock());
- if (res == MSG_OK)
- return 0;
- else
- return 1;
+ return res != MSG_OK;
}
\ No newline at end of file
MSG_launch_application(argv[2]);
res = MSG_main();
- if (res == MSG_OK)
- return 0;
- else
- return 1;
+ return res != MSG_OK;
}
const char *application_file;
MSG_init(&argc, argv);
- if (argc != 3) {
- printf("Usage: %s platform_file deployment_file\n", argv[0]);
- printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]);
- exit(1);
- }
+ xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
+
platform_file = argv[1];
application_file = argv[2];
XBT_INFO("Simulation time %g", MSG_get_clock());
- if (res == MSG_OK)
- return 0;
- else
- return 1;
+ return res != MSG_OK;
} /* end_of_main */
const char *application_file;
MSG_init(&argc, argv);
- if (argc != 3) {
- printf("Usage: %s platform_file deployment_file\n", argv[0]);
- printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]);
- exit(1);
- }
+ xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
+
platform_file = argv[1];
application_file = argv[2];
XBT_INFO("Simulation time %g", MSG_get_clock());
- if (res == MSG_OK)
- return 0;
- else
- return 1;
+ return res != MSG_OK;
} /* end_of_main */
const char *application_file;
MSG_init(&argc, argv);
- if (argc != 3) {
- printf("Usage: %s platform_file deployment_file\n", argv[0]);
- printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]);
- exit(1);
- }
+ xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
+
platform_file = argv[1];
application_file = argv[2];
XBT_INFO("Simulation time %g", MSG_get_clock());
- if (res == MSG_OK)
- return 0;
- else
- return 1;
+ return res != MSG_OK;
} /* end_of_main */
XBT_INFO("Simulation time %g", MSG_get_clock());
- if (res == MSG_OK)
- return 0;
- else
- return 1;
+ return res != MSG_OK;
} /* end_of_main */
MSG_launch_application(argv[2]);
res = MSG_main();
- if (res == MSG_OK)
- return 0;
- else
- return 1;
+ return res != MSG_OK;
}
const char *application_file;
MSG_init(&argc, argv);
- if (argc != 3) {
- printf("Usage: %s platform_file deployment_file\n", argv[0]);
- printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]);
- exit(1);
- }
+ xbt_assert(argc == 3, "Usage: %s platform_file deployment_file\n"
+ "\n Example: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
+
platform_file = argv[1];
application_file = argv[2];
XBT_INFO("Simulation time %g", MSG_get_clock());
- if (res == MSG_OK)
- return 0;
- else
- return 1;
+ return res != MSG_OK;
} /* end_of_main */
const char *application_file;
MSG_init(&argc, argv);
- if (argc != 3) {
- printf("Usage: %s platform_file deployment_file\n", argv[0]);
- printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]);
- exit(1);
- }
+ xbt_assert(argc == 3, "Usage: %s platform_file deployment_file\n"
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
+
platform_file = argv[1];
application_file = argv[2];
XBT_INFO("Simulation time %g", MSG_get_clock());
- if (res == MSG_OK)
- return 0;
- else
- return 1;
+ return res != MSG_OK;
} /* end_of_main */
storage_info(MSG_host_by_name(xbt_strdup("host")));
XBT_INFO("Simulation time %g", MSG_get_clock());
- if (res == MSG_OK)
- return 0;
- else
- return 1;
-
+ return res != MSG_OK;
}
MSG_init(&argc, argv);
/* Check the arguments */
- if (argc < 3) {
- printf("Usage: %s platform_file deployment_file \n", argv[0]);
- return -1;
- }
+ xbt_assert(argc > 2,"Usage: %s platform_file deployment_file \n", argv[0]);
const char *platform_file = argv[1];
const char *deployment_file = argv[2];
msg_error_t res = MSG_main();
XBT_INFO("Simulated time: %g", MSG_get_clock());
- if (res == MSG_OK)
- return 0;
- else
- return 1;
+ return res != MSG_OK;
}
const char *application_file;
MSG_init(&argc, argv);
- if (argc != 3) {
- printf("Usage: %s platform_file deployment_file\n", argv[0]);
- printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]);
- exit(1);
- }
+ xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
+
platform_file = argv[1];
application_file = argv[2];
XBT_INFO("Simulation time %g", MSG_get_clock());
- if (res == MSG_OK)
- return 0;
- else
- return 1;
+ return res != MSG_OK;
} /* end_of_main */
/* Verify if the platform xml file was passed by command line. */
MSG_init(&argc, argv);
- if (argc < 2) {
- printf("Usage: %s test_trace_integration_model.xml\n", argv[0]);
- exit(1);
- }
+ xbt_assert(argc > 2, "Usage: %s test_trace_integration_model.xml deployment.xml\n", argv[0]);
/* Register SimGrid process function. */
MSG_function_register("test_trace", test_trace);
/* Run the example. */
res = MSG_main();
- if (res == MSG_OK)
- return 0;
- else
- return 1;
+ return res != MSG_OK;
}
res = MSG_main();
XBT_INFO("Simulation time %g", MSG_get_clock());
- if (res == MSG_OK)
- return 0;
- else
- return 1;
+ return res != MSG_OK;
}