Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
simplify some msg examples
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 26 Feb 2016 20:48:10 +0000 (21:48 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 26 Feb 2016 20:48:10 +0000 (21:48 +0100)
test_all is from another age

examples/msg/properties/msg_prop.c
examples/msg/start_kill_time/sk_time.c
examples/msg/suspend/CMakeLists.txt
examples/msg/suspend/deployment_suspend.xml [deleted file]
examples/msg/suspend/suspend.c
examples/msg/suspend/suspend.tesh
examples/msg/token_ring/ring_call.c

index 15d2ee0..8e05705 100644 (file)
@@ -4,37 +4,18 @@
 /* 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. */
 
 /* 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"            /* Yeah! If you want to use msg, you need to include simgrid/msg.h */
-#include "xbt/sysdep.h"         /* calloc, printf */
-
-/* Create a log channel to have nice outputs. */
-#include "xbt/log.h"
-#include "xbt/asserts.h"
-
-#include <stdio.h>
-#include <stdlib.h>
+#include "simgrid/msg.h"
 
 /** @addtogroup MSG_examples
  * 
 
 /** @addtogroup MSG_examples
  * 
- * - <b>properties/msg_prop.c</b> Attaching arbitrary informations to
- *   host, processes and such, and retrieving them with @ref
- *   MSG_host_get_properties, @ref MSG_host_get_property_value, @ref
- *   MSG_process_get_properties and @ref
- *   MSG_process_get_property_value. Also make sure to read the
- *   platform and deployment XML files to see how to declare these
- *   data.
- * 
+ * - <b>properties/msg_prop.c</b> Attaching arbitrary informations to host, processes and such, and retrieving them
+ *   with @ref MSG_host_get_properties, @ref MSG_host_get_property_value, @ref MSG_process_get_properties and
+ *   @ref MSG_process_get_property_value. Also make sure to read the platform and deployment XML files to see how to
+ *   declare these data.
  */
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Property test");
 
  */
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Property test");
 
-int alice(int argc, char *argv[]);
-int bob(int argc, char *argv[]);
-int carole(int argc, char *argv[]);
-int david(int argc, char *argv[]);
-msg_error_t test_all(const char *platform_file,
-                     const char *application_file);
-
 static void test_host(const char*hostname) 
 {
   msg_host_t thehost = MSG_host_by_name(hostname);
 static void test_host(const char*hostname) 
 {
   msg_host_t thehost = MSG_host_by_name(hostname);
@@ -47,7 +28,7 @@ static void test_host(const char*hostname)
 
   XBT_INFO("== Print the properties of the host '%s'", hostname);
   xbt_dict_foreach(props, cursor, key, data)
 
   XBT_INFO("== Print the properties of the host '%s'", hostname);
   xbt_dict_foreach(props, cursor, key, data)
-      XBT_INFO("  Host property: '%s' -> '%s'", key, data);
+    XBT_INFO("  Host property: '%s' -> '%s'", key, data);
 
   XBT_INFO("== Try to get a host property that does not exist");
   value = MSG_host_get_property_value(thehost, noexist);
 
   XBT_INFO("== Try to get a host property that does not exist");
   value = MSG_host_get_property_value(thehost, noexist);
@@ -55,11 +36,8 @@ static void test_host(const char*hostname)
 
   XBT_INFO("== Try to get a host property that does exist");
   value = MSG_host_get_property_value(thehost, exist);
 
   XBT_INFO("== Try to get a host property that does exist");
   value = MSG_host_get_property_value(thehost, exist);
-  xbt_assert(value, "\tProperty %s is undefined (where it should)",
-              exist);
-  xbt_assert(!strcmp(value, "180"),
-              "\tValue of property %s is defined to %s (where it should be 180)",
-              exist, value);
+  xbt_assert(value, "\tProperty %s is undefined (where it should)", exist);
+  xbt_assert(!strcmp(value, "180"), "\tValue of property %s is defined to %s (where it should be 180)", exist, value);
   XBT_INFO("   Property: %s old value: %s", exist, value);
 
   XBT_INFO("== Trying to modify a host property");
   XBT_INFO("   Property: %s old value: %s", exist, value);
 
   XBT_INFO("== Trying to modify a host property");
@@ -68,31 +46,31 @@ static void test_host(const char*hostname)
   /* Test if we have changed the value */
   value = MSG_host_get_property_value(thehost, exist);
   xbt_assert(value, "Property %s is undefined (where it should)", exist);
   /* Test if we have changed the value */
   value = MSG_host_get_property_value(thehost, exist);
   xbt_assert(value, "Property %s is undefined (where it should)", exist);
-  xbt_assert(!strcmp(value, "250"),
-              "Value of property %s is defined to %s (where it should be 250)",
-              exist, value);
+  xbt_assert(!strcmp(value, "250"), "Value of property %s is defined to %s (where it should be 250)", exist, value);
   XBT_INFO("   Property: %s old value: %s", exist, value);
 
   /* Restore the value for the next test */
   MSG_host_set_property_value(thehost, exist, xbt_strdup("180"), xbt_free_f);
 }
 
   XBT_INFO("   Property: %s old value: %s", exist, value);
 
   /* Restore the value for the next test */
   MSG_host_set_property_value(thehost, exist, xbt_strdup("180"), xbt_free_f);
 }
 
-int alice(int argc, char *argv[]) { /* Dump what we have on the current host */
+static int alice(int argc, char *argv[]) { /* Dump what we have on the current host */
   test_host("host1");
   return 0;
 }
   test_host("host1");
   return 0;
 }
-int carole(int argc, char *argv[]) {/* Dump what we have on a remote host */
+
+static int carole(int argc, char *argv[]) {/* Dump what we have on a remote host */
   MSG_process_sleep(1); // Wait for alice to be done with its experiment
   test_host("host1");
   return 0;
 }
   MSG_process_sleep(1); // Wait for alice to be done with its experiment
   test_host("host1");
   return 0;
 }
-int david(int argc, char *argv[]) {/* Dump what we have on a remote host */
+
+static int david(int argc, char *argv[]) {/* Dump what we have on a remote host */
   MSG_process_sleep(2); // Wait for alice and carole to be done with its experiment
   test_host("node-0.acme.org");
   return 0;
 }
 
   MSG_process_sleep(2); // Wait for alice and carole to be done with its experiment
   test_host("node-0.acme.org");
   return 0;
 }
 
-int bob(int argc, char *argv[])
+static int bob(int argc, char *argv[])
 {
   /* Get the property list of current bob process */
   xbt_dict_t props = MSG_process_get_properties(MSG_process_self());
 {
   /* Get the property list of current bob process */
   xbt_dict_t props = MSG_process_get_properties(MSG_process_self());
@@ -103,7 +81,7 @@ int bob(int argc, char *argv[])
 
   XBT_INFO("== Print the properties of the process");
   xbt_dict_foreach(props, cursor, key, data)
 
   XBT_INFO("== Print the properties of the process");
   xbt_dict_foreach(props, cursor, key, data)
-      XBT_INFO("   Process property: %s -> %s", key, data);
+    XBT_INFO("   Process property: %s -> %s", key, data);
 
   XBT_INFO("== Try to get a process property that does not exist");
 
 
   XBT_INFO("== Try to get a process property that does not exist");
 
@@ -113,54 +91,37 @@ int bob(int argc, char *argv[])
   return 0;
 }
 
   return 0;
 }
 
-/** Test function */
-msg_error_t test_all(const char *platform_file,
-                     const char *application_file)
+int main(int argc, char *argv[])
 {
 {
-  int host_number;
+  msg_error_t res = MSG_OK;
   unsigned int i;
   xbt_dynar_t hosts;
   msg_host_t host;
   unsigned int i;
   xbt_dynar_t hosts;
   msg_host_t host;
-  msg_error_t ret;
+
+  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]);
 
   MSG_function_register("alice", alice);
   MSG_function_register("bob", bob);
   MSG_function_register("carole", carole);
   MSG_function_register("david", david);
 
 
   MSG_function_register("alice", alice);
   MSG_function_register("bob", bob);
   MSG_function_register("carole", carole);
   MSG_function_register("david", david);
 
-  MSG_create_environment(platform_file);
+  MSG_create_environment(argv[1]);
 
 
-  host_number = MSG_get_host_number();
-  XBT_INFO("There are %d hosts in the environment", host_number);
+  XBT_INFO("There are %d hosts in the environment", MSG_get_host_number());
 
   hosts = MSG_hosts_as_dynar();
 
   xbt_dynar_foreach(hosts, i, host){
 
   hosts = MSG_hosts_as_dynar();
 
   xbt_dynar_foreach(hosts, i, host){
-    XBT_INFO("Host '%s' runs at %.0f flops/s",MSG_host_get_name(host),
-       MSG_get_host_speed(host));
+    XBT_INFO("Host '%s' runs at %.0f flops/s",MSG_host_get_name(host), MSG_get_host_speed(host));
   }
 
   }
 
-  MSG_launch_application(application_file);
+  MSG_launch_application(argv[2]);
 
 
-  ret = MSG_main();
+  res = MSG_main();
 
   xbt_dynar_free(&hosts);
 
 
   xbt_dynar_free(&hosts);
 
-  return ret;
-}                               /* end_of_test_all */
-
-
-/** Main function */
-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]);
-   res = test_all(argv[1], argv[2]);
-
-  return res != MSG_OK;
+  return res!=MSG_OK;
 }
 }
index 8442325..820cc7e 100644 (file)
@@ -4,13 +4,9 @@
 /* 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. */
 
 /* 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"        /* Yeah! If you want to use msg, you need to include simgrid/msg.h */
-#include "xbt/sysdep.h"         /* calloc */
+#include "simgrid/msg.h"
 
 
-/* Create a log channel to have nice outputs. */
-#include "xbt/log.h"
-XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
-                             "Messages specific for this msg example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
 static int my_onexit(void* ignored1, void *ignored2) {
   XBT_INFO("Exiting now (done sleeping or got killed).");
 
 static int my_onexit(void* ignored1, void *ignored2) {
   XBT_INFO("Exiting now (done sleeping or got killed).");
@@ -27,34 +23,19 @@ static int sleeper(int argc, char *argv[])
   return 0;
 }
 
   return 0;
 }
 
-/** Test function */
-static msg_error_t test_all(const char *platform_file,
-                            const char *application_file)
+int main(int argc, char *argv[])
 {
   msg_error_t res = MSG_OK;
 
 {
   msg_error_t res = MSG_OK;
 
-  MSG_create_environment(platform_file);
+  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]);
+
+  MSG_create_environment(argv[1]);
   MSG_function_register("sleeper", sleeper);
   MSG_function_register("sleeper", sleeper);
-  MSG_launch_application(application_file);
+  MSG_launch_application(argv[2]);
 
   res = MSG_main();
 
   res = MSG_main();
-
   XBT_INFO("Simulation time %g", MSG_get_clock());
   XBT_INFO("Simulation time %g", MSG_get_clock());
-  return res;
-}                               /* end_of_test_all */
-
-
-/** Main function */
-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]);
-  
-  test_all(argv[1], argv[2]);
-
   return res != MSG_OK;
 }
   return res != MSG_OK;
 }
index 119df72..f34c90a 100644 (file)
@@ -5,10 +5,6 @@ set(tesh_files
   ${tesh_files}
   ${CMAKE_CURRENT_SOURCE_DIR}/suspend.tesh
   PARENT_SCOPE)
   ${tesh_files}
   ${CMAKE_CURRENT_SOURCE_DIR}/suspend.tesh
   PARENT_SCOPE)
-set(xml_files
-  ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/deployment_suspend.xml
-  PARENT_SCOPE)
 set(examples_src
   ${examples_src}
   ${CMAKE_CURRENT_SOURCE_DIR}/suspend.c
 set(examples_src
   ${examples_src}
   ${CMAKE_CURRENT_SOURCE_DIR}/suspend.c
diff --git a/examples/msg/suspend/deployment_suspend.xml b/examples/msg/suspend/deployment_suspend.xml
deleted file mode 100644 (file)
index 07fc567..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
-<platform version="4">
-  <process host="Jacquelin" function="dream_master"/>
-</platform>
index a36254a..13db39f 100644 (file)
@@ -4,23 +4,18 @@
 /* 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. */
 
 /* 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"            /* Yeah! If you want to use msg, you need to include simgrid/msg.h */
-#include "xbt/sysdep.h"         /* calloc */
+#include "simgrid/msg.h"
 
 
-/* Create a log channel to have nice outputs. */
-#include "xbt/log.h"
-XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
-                             "Messages specific for this msg example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
 #define SLEEP(duration)                                 \
   if (MSG_process_sleep(duration) != MSG_OK)            \
 
 #define SLEEP(duration)                                 \
   if (MSG_process_sleep(duration) != MSG_OK)            \
-    xbt_die("What's going on??? I failed to sleep!");   \
-  else                                                  \
-    (void)0
+    xbt_die("What's going on??? I failed to sleep!");
 
 /** @addtogroup MSG_examples
  * 
 
 /** @addtogroup MSG_examples
  * 
- * - <b>suspend/suspend.c</b>: Demonstrates how to suspend and resume processes using @ref MSG_process_suspend and @ref MSG_process_resume.
+ * - <b>suspend/suspend.c</b>: Demonstrates how to suspend and resume processes using
+ *   @ref MSG_process_suspend and @ref MSG_process_resume.
  */
 
 /** Lazy guy function. This process suspends itself asap.  */
  */
 
 /** Lazy guy function. This process suspends itself asap.  */
@@ -42,8 +37,7 @@ static int lazy_guy(int argc, char *argv[])
   return 0;
 }                               /* end_of_lazy_guy */
 
   return 0;
 }                               /* end_of_lazy_guy */
 
-/** Dream master function. This process creates a lazy_guy process and
-    resumes it 10 seconds later. */
+/** Dream master function. This process creates a lazy_guy process and resumes it 10 seconds later. */
 static int dream_master(int argc, char *argv[])
 {
   msg_process_t lazy = NULL;
 static int dream_master(int argc, char *argv[])
 {
   msg_process_t lazy = NULL;
@@ -73,39 +67,20 @@ static int dream_master(int argc, char *argv[])
 
   XBT_INFO("OK, goodbye now.");
   return 0;
 
   XBT_INFO("OK, goodbye now.");
   return 0;
-}                               /* end_of_dram_master */
+}                               /* end_of_dream_master */
 
 
-/** Test function */
-static msg_error_t test_all(const char *platform_file,
-                            const char *application_file)
-{
-  msg_error_t res = MSG_OK;
-
-  {                             /*  Simulation setting */
-    MSG_create_environment(platform_file);
-  }
-  {                             /*   Application deployment */
-    MSG_function_register("dream_master", dream_master);
-    MSG_launch_application(application_file);
-  }
-  res = MSG_main();
-
-  XBT_INFO("Simulation time %g", MSG_get_clock());
-  return res;
-}                               /* end_of_test_all */
-
-
-/** Main function */
 int main(int argc, char *argv[])
 {
   msg_error_t res = MSG_OK;
 
   MSG_init(&argc, argv);
 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_suspend.xml\n", 
-            argv[0], argv[0]);
+  xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
 
 
-  test_all(argv[1], argv[2]);
+  MSG_create_environment(argv[1]);
+  MSG_function_register("dream_master", dream_master);
+  MSG_process_create("dream_master", dream_master, NULL, xbt_dynar_getfirst_as(MSG_hosts_as_dynar(), msg_host_t));
+  res = MSG_main();
 
 
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   return res != MSG_OK;
 }
   return res != MSG_OK;
 }
index 22766aa..72b8178 100644 (file)
@@ -3,7 +3,7 @@
 p Testing the suspend/resume feature of MSG
 
 ! output sort 19
 p Testing the suspend/resume feature of MSG
 
 ! output sort 19
-$ $SG_TEST_EXENV suspend/suspend ${srcdir:=.}/../platforms/platform.xml ${srcdir:=.}/suspend/deployment_suspend.xml  "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ $SG_TEST_EXENV suspend/suspend ${srcdir:=.}/../platforms/platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:dream_master@Jacquelin) Let's create a lazy guy.
 > [  0.000000] (1:dream_master@Jacquelin) Let's wait a little bit...
 > [  0.000000] (2:Lazy@Jacquelin) Nobody's watching me ? Let's go to sleep.
 > [  0.000000] (1:dream_master@Jacquelin) Let's create a lazy guy.
 > [  0.000000] (1:dream_master@Jacquelin) Let's wait a little bit...
 > [  0.000000] (2:Lazy@Jacquelin) Nobody's watching me ? Let's go to sleep.
index 06a4648..bc270cd 100644 (file)
@@ -4,32 +4,24 @@
 /* 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. */
 
 /* 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 <stdio.h>
-#include <stdlib.h>
 #include "simgrid/msg.h"
 
 #include "simgrid/msg.h"
 
-int host(int argc, char *argv[]);
-unsigned int task_comp_size = 50000000;
-unsigned int task_comm_size = 1000000;
-
-int nb_hosts; /* All declared hosts */
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(ring,
-                             "Messages specific for this msg example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(ring, "Messages specific for this msg example");
 
 /** @addtogroup MSG_examples
  * 
  *  @section MSG_ex_apps Examples of full applications
  * 
 
 /** @addtogroup MSG_examples
  * 
  *  @section MSG_ex_apps Examples of full applications
  * 
- * - <b>token_ring/ring_call.c</b>: Classical token ring
- *   communication, where a token is exchanged along a ring to reach
- *   every participant.
- * 
+ * - <b>token_ring/ring_call.c</b>: Classical token ring communication, where a token is exchanged along a ring to
+ *   reach every participant.
  */
 
  */
 
-int host(int argc, char *argv[])
+static int host(int argc, char *argv[])
 {
 {
-  int host_number = xbt_str_parse_int(MSG_process_get_name(MSG_process_self()), "Process name must be an integer but is: %s");
+  unsigned int task_comp_size = 50000000;
+  unsigned int task_comm_size = 1000000;
+  int host_number =
+          xbt_str_parse_int(MSG_process_get_name(MSG_process_self()), "Process name must be an integer but is: %s");
   char mailbox[256];
   msg_task_t task = NULL;
   XBT_ATTRIB_UNUSED int res;
   char mailbox[256];
   msg_task_t task = NULL;
   XBT_ATTRIB_UNUSED int res;
@@ -43,13 +35,12 @@ int host(int argc, char *argv[])
     xbt_assert(res == MSG_OK, "MSG_task_get failed");
     XBT_INFO("Host \"%d\" received \"%s\"",host_number, MSG_task_get_name(task));
     MSG_task_destroy(task);
     xbt_assert(res == MSG_OK, "MSG_task_get failed");
     XBT_INFO("Host \"%d\" received \"%s\"",host_number, MSG_task_get_name(task));
     MSG_task_destroy(task);
-  }
-  else{ //slave receive then send
+  } else{ //slave receive then send
     res = MSG_task_receive(&(task), MSG_process_get_name(MSG_process_self()));
     xbt_assert(res == MSG_OK, "MSG_task_get failed");
     XBT_INFO("Host \"%d\" received \"%s\"",host_number, MSG_task_get_name(task));
 
     res = MSG_task_receive(&(task), MSG_process_get_name(MSG_process_self()));
     xbt_assert(res == MSG_OK, "MSG_task_get failed");
     XBT_INFO("Host \"%d\" received \"%s\"",host_number, MSG_task_get_name(task));
 
-    if(host_number+1 == nb_hosts)
+    if(host_number+1 == MSG_get_host_number())
       sprintf(mailbox, "0");
     else
       sprintf(mailbox, "%d", host_number+1);
       sprintf(mailbox, "0");
     else
       sprintf(mailbox, "%d", host_number+1);
@@ -61,23 +52,22 @@ int host(int argc, char *argv[])
 
 int main(int argc, char **argv)
 {
 
 int main(int argc, char **argv)
 {
-  int i,res;
+  unsigned int i;
   MSG_init(&argc, argv);
   MSG_create_environment(argv[1]);
   xbt_dynar_t hosts = MSG_hosts_as_dynar();
   MSG_init(&argc, argv);
   MSG_create_environment(argv[1]);
   xbt_dynar_t hosts = MSG_hosts_as_dynar();
-  nb_hosts =  xbt_dynar_length(hosts);
+  msg_host_t h;
   MSG_function_register("host", host);
 
   MSG_function_register("host", host);
 
-  XBT_INFO("Number of host '%d'",nb_hosts);
-  for(i = 0 ; i<nb_hosts; i++)
-  {
-    char* name_host = bprintf("%d",i);
-    MSG_process_create( name_host, host, NULL, xbt_dynar_get_as(hosts,i,msg_host_t) );
+  XBT_INFO("Number of host '%d'",MSG_get_host_number());
+  xbt_dynar_foreach (hosts, i, h){
+    char* name_host = bprintf("%u",i);
+    MSG_process_create(name_host, host, NULL, h);
     free(name_host);
   }
   xbt_dynar_free(&hosts);
 
     free(name_host);
   }
   xbt_dynar_free(&hosts);
 
-  res = MSG_main();
+  int res = MSG_main();
   XBT_INFO("Simulation time %g", MSG_get_clock());
   return res != MSG_OK;
 }
   XBT_INFO("Simulation time %g", MSG_get_clock());
   return res != MSG_OK;
 }