Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill dead code
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 21 Nov 2015 15:01:24 +0000 (16:01 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 21 Nov 2015 15:01:32 +0000 (16:01 +0100)
examples/msg/cloud/scale.c

index 94b96c8..338b75f 100644 (file)
@@ -23,8 +23,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
  * 2. kcachegrind
  **/
 
  * 2. kcachegrind
  **/
 
-static double time_precise(void)
-{
+static double time_precise(void) {
        struct timeval tv;
        int ret = gettimeofday(&tv, NULL);
   if (ret < 0)
        struct timeval tv;
        int ret = gettimeofday(&tv, NULL);
   if (ret < 0)
@@ -35,8 +34,7 @@ static double time_precise(void)
        return now;
 }
 
        return now;
 }
 
-static int computation_fun(int argc, char *argv[])
-{
+static int computation_fun(int argc, char *argv[]) {
   for (;;) {
     // double clock_sta = time_precise();
 
   for (;;) {
     // double clock_sta = time_precise();
 
@@ -53,92 +51,10 @@ static int computation_fun(int argc, char *argv[])
   return 0;
 }
 
   return 0;
 }
 
-static void launch_computation_worker(msg_host_t host)
-{
+static void launch_computation_worker(msg_host_t host) {
   MSG_process_create("compute", computation_fun, NULL, host);
 }
 
   MSG_process_create("compute", computation_fun, NULL, host);
 }
 
-#if 0
-struct task_priv {
-  msg_host_t tx_host;
-  msg_process_t tx_proc;
-  double clock_sta;
-};
-
-static int communication_tx_fun(int argc, char *argv[])
-{
-  xbt_assert(argc == 2);
-  const char *mbox = argv[1];
-
-  msg_task_t task = MSG_task_create("Task", 1000000, 1000000, NULL);
-
-  struct task_priv *priv = xbt_new(struct task_priv, 1);
-  priv->tx_proc = MSG_process_self();
-  priv->tx_host = MSG_host_self();
-  priv->clock_sta = MSG_get_clock();
-
-  MSG_task_set_data(task, priv);
-
-  MSG_task_send(task, mbox);
-
-  return 0;
-}
-
-static int communication_rx_fun(int argc, char *argv[])
-{
-  const char *pr_name = MSG_process_get_name(MSG_process_self());
-  const char *host_name = MSG_host_get_name(MSG_host_self());
-  xbt_assert(argc == 2);
-  const char *mbox = argv[1];
-
-  msg_task_t task = NULL;
-  MSG_task_recv(&task, mbox);
-
-  struct task_priv *priv = MSG_task_get_data(task);
-  double clock_end = MSG_get_clock();
-
-  XBT_INFO("%s:%s to %s:%s => %g sec",
-      MSG_host_get_name(priv->tx_host),
-      MSG_process_get_name(priv->tx_proc),
-      host_name, pr_name, clock_end - priv->clock_sta);
-
-  MSG_task_destroy(task);
-
-  return 0;
-}
-
-static void launch_communication_worker(msg_host_t tx_host, msg_host_t rx_host)
-{
-  char *mbox = bprintf("MBOX:%s-%s",
-      MSG_host_get_name(tx_host),
-      MSG_host_get_name(rx_host));
-  char **argv = NULL;
-  
-  const char *pr_name_tx =  "comm_tx";
-  argv = xbt_new(char *, 3);
-  argv[0] = xbt_strdup(pr_name_tx);
-  argv[1] = xbt_strdup(mbox);
-  argv[2] = NULL;
-
-  MSG_process_create_with_arguments(pr_name_tx, communication_tx_fun, NULL, tx_host, 2, argv);
-
-  const char *pr_name_rx =  "comm_rx";  
-  argv = xbt_new(char *, 3);
-  argv[0] = xbt_strdup(pr_name_rx);
-  argv[1] = xbt_strdup(mbox);
-  argv[2] = NULL;
-
-  MSG_process_create_with_arguments(pr_name_rx, communication_rx_fun, NULL, rx_host, 2, argv);
-
-  xbt_free(mbox);
-}
-#endif
-
-
-
-
-
-
 static int master_main(int argc, char *argv[])
 {
   xbt_dynar_t hosts_dynar = MSG_hosts_as_dynar();
 static int master_main(int argc, char *argv[])
 {
   xbt_dynar_t hosts_dynar = MSG_hosts_as_dynar();