Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
revisit pingpong in s4u
[simgrid.git] / examples / msg / app-pingpong / app-pingpong.c
index bd5d39b..3e12e81 100644 (file)
@@ -1,11 +1,11 @@
-/* Copyright (c) 2007-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2017. 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. */
 
 #include "simgrid/msg.h"
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(mag_app_pingpong,"Messages specific for this msg example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(msg_app_pingpong, "Messages specific for this msg example");
 
 static int pinger(int argc, char *argv[])
 {
@@ -30,7 +30,7 @@ static int pinger(int argc, char *argv[])
   XBT_INFO("Task received : %s", pong_task->name);
   xbt_free(pong_task->data);
   MSG_task_destroy(pong_task);
-  XBT_INFO("Pong time (bandwidth bound): %e", communication_time);
+  XBT_INFO("Pong time (bandwidth bound): %.3f", communication_time);
 
   return 0;
 }
@@ -51,14 +51,14 @@ static int ponger(int argc, char *argv[])
   XBT_INFO("Task received : %s", ping_task->name);
   xbt_free(ping_task->data);
   MSG_task_destroy(ping_task);
-  XBT_INFO(" Ping time (latency bound) %e", communication_time);
+  XBT_INFO(" Ping time (latency bound) %f", communication_time);
 
   /*  - ... Then send a 1GB pong back (bandwidth bound) */
   double now = MSG_get_clock();
   msg_task_t pong_task = MSG_task_create("large communication (bandwidth bound)", 0.0, 1e9, NULL);
   pong_task->data = xbt_new(double, 1);
   *(double *) pong_task->data = now;
-  XBT_INFO("task_bw->data = %e", *((double *) pong_task->data));
+  XBT_INFO("task_bw->data = %.3f", *((double*)pong_task->data));
   MSG_task_send(pong_task, argv[1]);
 
   return 0;
@@ -69,7 +69,7 @@ int main(int argc, char *argv[])
   MSG_init(&argc, argv);
 
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
-             "\tExample: %s ../../platform/small_platform.xml app-pingpong_d.xml\n", argv[0], argv[0]);
+             "\tExample: %s ../../platforms/small_platform.xml app-pingpong_d.xml\n", argv[0], argv[0]);
 
   MSG_create_environment(argv[1]);          /* - Load the platform description */
 
@@ -80,6 +80,6 @@ int main(int argc, char *argv[])
 
   msg_error_t res = MSG_main();             /* - Run the simulation */
 
-  XBT_INFO("Total simulation time: %e", MSG_get_clock());
+  XBT_INFO("Total simulation time: %.3f", MSG_get_clock());
   return res!=MSG_OK;
 }