X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b9625f82f86db0674e911887addce45dca31b57f..35a644bdf9d0c5603c9483f03f913e4a649638d6:/examples/c/comm-wait/comm-wait.c diff --git a/examples/c/comm-wait/comm-wait.c b/examples/c/comm-wait/comm-wait.c index 142dcf7b85..8a1eb80cc4 100644 --- a/examples/c/comm-wait/comm-wait.c +++ b/examples/c/comm-wait/comm-wait.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2020. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2010-2023. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -8,9 +8,9 @@ #include "simgrid/engine.h" #include "simgrid/mailbox.h" -#include "xbt/asserts.h" #include "xbt/log.h" #include "xbt/str.h" +#include "xbt/sysdep.h" #include @@ -20,10 +20,10 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(comm_wait, "Messages specific for this example"); static void sender(int argc, char* argv[]) { xbt_assert(argc == 5, "The sender function expects 4 arguments from the XML deployment file"); - long messages_count = xbt_str_parse_int(argv[1], "Invalid amount of messages: %s"); /* - number of messages */ - long message_size = xbt_str_parse_int(argv[2], "Invalid message size: %s"); /* - communication cost */ - double sleep_start_time = xbt_str_parse_double(argv[3], "Invalid sleep start time: %s"); /* - start time */ - double sleep_test_time = xbt_str_parse_double(argv[4], "Invalid test time: %s"); /* - test time */ + long messages_count = xbt_str_parse_int(argv[1], "Invalid amount of messages"); /* - number of messages */ + long message_size = xbt_str_parse_int(argv[2], "Invalid message size"); /* - communication cost */ + double sleep_start_time = xbt_str_parse_double(argv[3], "Invalid sleep start time"); /* - start time */ + double sleep_test_time = xbt_str_parse_double(argv[4], "Invalid test time"); /* - test time */ XBT_INFO("sleep_start_time : %f , sleep_test_time : %f", sleep_start_time, sleep_test_time); sg_mailbox_t mailbox = sg_mailbox_by_name("receiver"); @@ -53,8 +53,8 @@ static void sender(int argc, char* argv[]) static void receiver(int argc, char* argv[]) { xbt_assert(argc == 3, "The relay_runner function does not accept any parameter from the XML deployment file"); - double sleep_start_time = xbt_str_parse_double(argv[1], "Invalid sleep start parameter: %s"); /* - start time */ - double sleep_test_time = xbt_str_parse_double(argv[2], "Invalid sleep test parameter: %s"); /* - test time */ + double sleep_start_time = xbt_str_parse_double(argv[1], "Invalid sleep start parameter"); /* - start time */ + double sleep_test_time = xbt_str_parse_double(argv[2], "Invalid sleep test parameter"); /* - test time */ XBT_INFO("sleep_start_time : %f , sleep_test_time : %f", sleep_start_time, sleep_test_time); sg_actor_sleep_for(sleep_start_time); /* This actor first sleeps for "start time" seconds. */ @@ -89,7 +89,7 @@ int main(int argc, char* argv[]) simgrid_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", + "\tExample: %s platform.xml deployment.xml\n", argv[0], argv[0]); simgrid_load_platform(argv[1]); /* - Load the platform description */