Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a TODO file with my ideas to make splay work.
[simgrid.git] / examples / msg / chord / chord.c
index 51cf97c..15d3423 100644 (file)
@@ -272,7 +272,7 @@ int node(int argc, char *argv[])
   double next_check_predecessor_date = init_time + periodic_check_predecessor_delay;
   double next_lookup_date = init_time + periodic_lookup_delay;
 
-  xbt_assert0(argc == 3 || argc == 5, "Wrong number of arguments for this node");
+  xbt_assert(argc == 3 || argc == 5, "Wrong number of arguments for this node");
 
   // initialize my node
   s_node_t node = {0};
@@ -394,7 +394,6 @@ int node(int argc, char *argv[])
 
   // stop the simulation
   xbt_free(node.fingers);
-  XBT_INFO("Messages created: %lu", smx_total_comms);
   return 0;
 }
 
@@ -507,10 +506,12 @@ static int join(node_t node, int known_id)
   XBT_INFO("Joining the ring with id %d, knowing node %d", node->id, known_id);
   set_predecessor(node, -1); // no predecessor (yet)
 
+  /*
   int i;
   for (i = 0; i < nb_bits; i++) {
     set_finger(node, i, known_id);
   }
+  */
 
   int successor_id = remote_find_successor(node, known_id, node->id);
   if (successor_id == -1) {
@@ -889,8 +890,6 @@ static void random_lookup(node_t node)
  */
 int main(int argc, char *argv[])
 {
-  xbt_os_timer_t timer = xbt_os_timer_new();
-
   if (argc < 3) {
     printf("Usage: %s [-nb_bits=n] [-timeout=t] platform_file deployment_file\n", argv[0]);
     printf("example: %s ../msg_platform.xml chord.xml\n", argv[0]);
@@ -915,7 +914,7 @@ int main(int argc, char *argv[])
        XBT_DEBUG("Set timeout to %d", timeout);
       }
       else {
-       xbt_assert1(0, "Invalid chord option '%s'", options[0]);
+       xbt_die("Invalid chord option '%s'", options[0]);
       }
     }
     options++;
@@ -932,10 +931,8 @@ int main(int argc, char *argv[])
   MSG_function_register("node", node);
   MSG_launch_application(application_file);
 
-  xbt_os_timer_start(timer);
   MSG_error_t res = MSG_main();
-  xbt_os_timer_stop(timer);
-  XBT_CRITICAL("Simulation time %lf", xbt_os_timer_elapsed(timer));
+  XBT_CRITICAL("Messages created: %ld", smx_total_comms);
   XBT_INFO("Simulated time: %g", MSG_get_clock());
 
   MSG_clean();