X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4a6b0a991a67e6f2f67c03fed43529e078da7115..48eccb2c1532e35819830ca56fad7cf89887359f:/examples/msg/exception/exception.c diff --git a/examples/msg/exception/exception.c b/examples/msg/exception/exception.c index 18d5c1027f..e505e7595b 100644 --- a/examples/msg/exception/exception.c +++ b/examples/msg/exception/exception.c @@ -5,10 +5,8 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "simgrid/msg.h" -#include "xbt.h" -XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test_exception, - "Messages specific for this msg example"); +XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test_exception, "Messages specific for this msg example"); /** @addtogroup MSG_examples * @@ -17,7 +15,6 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test_exception, /** Victim. This process gets a lot of remote exceptions */ static int victim(int argc, char *argv[]) { - xbt_ex_t e; msg_error_t res = MSG_OK; @@ -36,7 +33,6 @@ static int victim(int argc, char *argv[]) { xbt_ex_free(e); } - XBT_INFO("Let's get suspended."); int gotit = 0; TRY { @@ -51,7 +47,7 @@ static int victim(int argc, char *argv[]) { if(!gotit) { xbt_die("I was expecting an exception during my suspension!"); } - + XBT_INFO("Let's sleep for 10 seconds."); TRY { res = MSG_process_sleep(10); @@ -71,7 +67,6 @@ static int victim(int argc, char *argv[]) { MSG_process_sleep(10); XBT_INFO("That's enough now. I quit."); - return 0; } @@ -89,7 +84,6 @@ static int terrorist(int argc, char *argv[]) XBT_INFO("Send a first exception (host failure)"); SIMIX_process_throw(victim_process, host_error, 0, "First Trick: Let's pretend that the host failed"); - XBT_INFO("Sweet, let's prepare a second trick!"); XBT_INFO("Going to sleep for 2 seconds"); @@ -114,14 +108,10 @@ int main(int argc, char *argv[]) { msg_error_t res = MSG_OK; MSG_init(&argc, argv); - xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", - argv[0], argv[0]); + xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]); - MSG_function_register("terrorist", terrorist); MSG_create_environment(argv[1]); - MSG_launch_application(argv[2]); - + MSG_process_create("terrorist", terrorist, NULL, MSG_get_host_by_name("Jacquelin")); // Launch the simulation res = MSG_main();