Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Code cleanup
authorMaximiliano Geier <maximiliano.geier@loria.fr>
Wed, 28 Nov 2012 12:31:20 +0000 (13:31 +0100)
committerMaximiliano Geier <maximiliano.geier@loria.fr>
Wed, 28 Nov 2012 12:31:20 +0000 (13:31 +0100)
examples/msg/chainsend/broadcaster.c
examples/msg/chainsend/broadcaster.h
examples/msg/chainsend/iterator.c

index 2d0b1c0..5e3819c 100644 (file)
@@ -13,37 +13,12 @@ xbt_dynar_t build_hostlist_from_hostcount(int hostcount)
   for (; i < hostcount+1; i++) {
     hostname = xbt_new(char, HOSTNAME_LENGTH);
     snprintf(hostname, HOSTNAME_LENGTH, "host%d", i);
-    //XBT_INFO("%s", hostname);
-    /*h = MSG_get_host_by_name(hostname);
-    if (h == NULL) {
-      XBT_INFO("Unknown host %s. Stopping Now! ", hostname);
-      abort();
-    } else {*/
-      xbt_dynar_push(host_list, &hostname);
-    /*}*/
+    XBT_DEBUG("%s", hostname);
+    xbt_dynar_push(host_list, &hostname);
   }
   return host_list;
 }
 
-/*xbt_dynar_t build_hostlist_from_argv(int argc, char *argv[])
-{
-  xbt_dynar_t host_list = xbt_dynar_new(sizeof(char*), NULL);
-  msg_host_t h = NULL;
-  int i = 1;
-  
-  for (; i < argc; i++) {
-    XBT_INFO("host%d = %s", i, argv[i]);
-    h = MSG_get_host_by_name(argv[i]);
-    if (h == NULL) {
-      XBT_INFO("Unknown host %s. Stopping Now! ", argv[i]);
-      abort();
-    } else {
-      xbt_dynar_push(host_list, &(argv[i]));
-    }
-  }
-  return host_list;
-}*/
-
 void delete_hostlist(xbt_dynar_t h)
 {
   xbt_dynar_free(&h);
@@ -76,7 +51,7 @@ int broadcaster_build_chain(const char **first, xbt_dynar_t host_list, xbt_dynar
         next = *cur;
       else
         next = NULL;
-      //XBT_INFO("Building chain -- broadcaster:\"%s\" dest:\"%s\" prev:\"%s\" next:\"%s\"", me, current_host, prev, next);
+      XBT_DEBUG("Building chain -- broadcaster:\"%s\" dest:\"%s\" prev:\"%s\" next:\"%s\"", me, current_host, prev, next);
     
       /* Send message to current peer */
       task = task_message_chain_new(me, current_host, prev, next);
index b20cee6..7d69cea 100644 (file)
@@ -15,7 +15,6 @@
 #define PIECE_COUNT 50
 
 xbt_dynar_t build_hostlist_from_hostcount(int hostcount); 
-/*xbt_dynar_t build_hostlist_from_argv(int argc, char *argv[]);*/
 
 /* Broadcaster: helper functions */
 int broadcaster_build_chain(const char **first, xbt_dynar_t host_list, xbt_dynar_iterator_t it);
index a4788bc..d9d46f2 100644 (file)
@@ -53,9 +53,7 @@ void xbt_dynar_iterator_seek(xbt_dynar_iterator_t it, int pos)
 void *xbt_dynar_iterator_next(xbt_dynar_iterator_t it)
 {
   int *next;
-  //XBT_INFO("%d current\n", next);
   if (it->current >= it->length) {
-    //XBT_INFO("Nothing to return!\n");
     return NULL;
   } else {
     next = xbt_dynar_get_ptr(it->indices_list, it->current);