Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill useless test+simplifications
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 23 Mar 2016 12:01:37 +0000 (13:01 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 23 Mar 2016 12:01:37 +0000 (13:01 +0100)
.gitignore
examples/simdag/dot/CMakeLists.txt
examples/simdag/dot/dot_test2.c [deleted file]
examples/simdag/dot/ptg_test.c
examples/simdag/dot/simulate_dot.c

index 00b7c7d..ff4d9ff 100644 (file)
@@ -209,7 +209,6 @@ examples/s4u/basic/s4u_basic
 examples/s4u/io/s4u_io
 examples/simdag/dax/sd_dax
 examples/simdag/dot/dot_test
 examples/s4u/io/s4u_io
 examples/simdag/dax/sd_dax
 examples/simdag/dot/dot_test
-examples/simdag/dot/dot_test2
 examples/simdag/dot/simulate_dot
 examples/simdag/goal/goal_test
 examples/simdag/io/sd_io
 examples/simdag/dot/simulate_dot
 examples/simdag/goal/goal_test
 examples/simdag/io/sd_io
index c4fabb3..5371f27 100644 (file)
@@ -1,5 +1,5 @@
 if(HAVE_GRAPHVIZ)
 if(HAVE_GRAPHVIZ)
-  foreach(x dot_test ptg_test simulate_dot dot_test2)
+  foreach(x dot_test ptg_test simulate_dot)
     add_executable       (${x}     ${x}.c)
     target_link_libraries(${x}     simgrid)
     set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}.c)
     add_executable       (${x}     ${x}.c)
     target_link_libraries(${x}     simgrid)
     set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}.c)
diff --git a/examples/simdag/dot/dot_test2.c b/examples/simdag/dot/dot_test2.c
deleted file mode 100644 (file)
index a9b9c68..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/* simple test trying to load a DOT file.                                   */
-
-/* Copyright (c) 2010-2016. 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/simdag.h"
-#include <stdio.h>
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Logging specific to this SimDag example");
-
-int main(int argc, char **argv)
-{
-  xbt_dynar_t dot;
-  unsigned int cursor;
-  SD_task_t task, *dot_as_array=NULL;
-
-  /* SD initialization */
-  SD_init(&argc, argv);
-
-  /* Check our arguments */
-  xbt_assert(argc > 1, "Usage: %s dot_file", argv[0]);
-
-  /* load the DOT file */
-  dot = SD_dotload(argv[1]);
-
-  /* Display all the tasks */
-  XBT_INFO("------------------- Display all tasks of the loaded DAG ---------------------------");
-  xbt_dynar_foreach(dot, cursor, task) {
-      SD_task_dump(task);
-    }
-
-  XBT_INFO("--------------------- Transform the dynar into an array ---------------------------");
-  cursor=0;
-  dot_as_array = (SD_task_t*) xbt_dynar_to_array(dot);
-  XBT_INFO("----------------------------- dump tasks again ------------------------------------");
-  while ((task=dot_as_array[cursor++])){
-    SD_task_dump(task);
-  }
-
-  cursor=0;
-  while ((task=dot_as_array[cursor++])){
-    SD_task_destroy(task);
-  }
-
-  free(dot_as_array);
-
-  /* exit */
-  SD_exit();
-  return 0;
-}
index aa0c2c4..8b30e0c 100644 (file)
@@ -38,21 +38,13 @@ int main(int argc, char **argv){
     SD_task_dump(task);
   }
 
     SD_task_dump(task);
   }
 
-  FILE *dotout = fopen("dot.dot", "w");
-  fprintf(dotout, "digraph A {\n");
-  xbt_dynar_foreach(dot, cursor, task) {
-    SD_task_dotty(task, dotout);
-  }
-  fprintf(dotout, "}\n");
-  fclose(dotout);
-
-  /* Schedule them all on all the first workstation */
+  /* Schedule them all on all the first host*/
   XBT_INFO("------------------- Schedule tasks ---------------------------");
   XBT_INFO("------------------- Schedule tasks ---------------------------");
-  const sg_host_t *ws_list = sg_host_list();
+  const sg_host_t *hosts = sg_host_list();
   int count = sg_host_count();
   xbt_dynar_foreach(dot, cursor, task) {
     if (SD_task_get_kind(task) == SD_TASK_COMP_PAR_AMDAHL) {
   int count = sg_host_count();
   xbt_dynar_foreach(dot, cursor, task) {
     if (SD_task_get_kind(task) == SD_TASK_COMP_PAR_AMDAHL) {
-        SD_task_schedulev(task, count, ws_list);
+        SD_task_schedulev(task, count, hosts);
     }
   }
 
     }
   }
 
index 22cc242..67a2793 100644 (file)
@@ -32,7 +32,8 @@ int main(int argc, char **argv)
   /* load the DOT file  and schedule tasks */
   dot = SD_dotload_with_sched(argv[2]);
   if(!dot){
   /* load the DOT file  and schedule tasks */
   dot = SD_dotload_with_sched(argv[2]);
   if(!dot){
-    XBT_CRITICAL("The dot file with the provided scheduling is wrong, more information with the option : --log=sd_dotparse.thres:verbose");
+    XBT_CRITICAL("The dot file with the provided scheduling is wrong,"
+                 " more information with the option : --log=sd_dotparse.thres:verbose");
     SD_exit();
     exit(2);
   }
     SD_exit();
     exit(2);
   }
@@ -40,9 +41,8 @@ int main(int argc, char **argv)
   char *tracefilename;
   char *last = strrchr(argv[2], '.');
   tracefilename = bprintf("%.*s.trace", (int) (last == NULL ? strlen(argv[2]) : last - argv[2]),argv[2]);
   char *tracefilename;
   char *last = strrchr(argv[2], '.');
   tracefilename = bprintf("%.*s.trace", (int) (last == NULL ? strlen(argv[2]) : last - argv[2]),argv[2]);
-  if (argc == 4) 
+  if (argc == 4)
     tracefilename = xbt_strdup(argv[3]);
     tracefilename = xbt_strdup(argv[3]);
-  
 
   /* Display all the tasks */
   XBT_INFO("------------------- Display all tasks of the loaded DAG ---------------------------");
 
   /* Display all the tasks */
   XBT_INFO("------------------- Display all tasks of the loaded DAG ---------------------------");
@@ -50,14 +50,6 @@ int main(int argc, char **argv)
     SD_task_dump(task);
   }
 
     SD_task_dump(task);
   }
 
-  FILE *dotout = fopen("dot.dot", "w");
-  fprintf(dotout, "digraph A {\n");
-  xbt_dynar_foreach(dot, cursor, task) {
-    SD_task_dotty(task, dotout);
-  }
-  fprintf(dotout, "}\n");
-  fclose(dotout);
-
   XBT_INFO("------------------- Run the schedule ---------------------------");
   SD_simulate(-1);
 
   XBT_INFO("------------------- Run the schedule ---------------------------");
   SD_simulate(-1);