Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
new function SD_task_dotty(task,FILE*) writing to file the info about the task in...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 6 Oct 2009 16:59:15 +0000 (16:59 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 6 Oct 2009 16:59:15 +0000 (16:59 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6730 48e7efb5-ca39-0410-a469-dd3cf9ba447f

ChangeLog
include/simdag/simdag.h
src/simdag/sd_task.c

index b6903c8..77c6c1e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -54,12 +54,8 @@ SimGrid (3.3.4) unstable; urgency=low
    synchronous communication. 
    
  SimDag:
    synchronous communication. 
    
  SimDag:
- * new function SD_task_dump() for debuging display
  * new function SD_daxload(char*) to load a DAX file 
    (see http://vtcpc.isi.edu/pegasus/index.php/WorkflowGenerator)
  * new function SD_daxload(char*) to load a DAX file 
    (see http://vtcpc.isi.edu/pegasus/index.php/WorkflowGenerator)
- * SD_task_dependency_exists() can now cope with having one of its
-   arguments NULL. If so, it tests whether the other argument has any 
-   dependency.
  * Introduce typed tasks. Specify its kind and cost at creation. 
    At scheduling, just give where it should be placed, and the cost
    for each involved resource is automatically computed.
  * Introduce typed tasks. Specify its kind and cost at creation. 
    At scheduling, just give where it should be placed, and the cost
    for each involved resource is automatically computed.
@@ -67,6 +63,12 @@ SimGrid (3.3.4) unstable; urgency=low
     - SD_task_create_comm_e2e() for end-to-end communication
     - SD_task_create_comp_seq() for sequential computation
    Use SD_task_schedulev() / SD_task_schedulel() to schedule them.
     - SD_task_create_comm_e2e() for end-to-end communication
     - SD_task_create_comp_seq() for sequential computation
    Use SD_task_schedulev() / SD_task_schedulel() to schedule them.
+ * new function SD_task_dump() for debuging display
+ * new function SD_task_dotty(task,FILE*) writing to file the info
+   about the task in dotty format
+ * SD_task_dependency_exists() can now cope with having one of its
+   arguments NULL. If so, it tests whether the other argument has any 
+   dependency.
  * Add getters on list of preceding/following tasks:
     SD_task_get_parents(task) and SD_task_get_children(task)
  * Add getters on amount of workstations and list:
  * Add getters on list of preceding/following tasks:
     SD_task_get_parents(task) and SD_task_get_children(task)
  * Add getters on amount of workstations and list:
index 8ef3b96..9d98ad9 100644 (file)
@@ -138,6 +138,7 @@ XBT_PUBLIC(int) SD_task_get_workstation_count(SD_task_t task);
 XBT_PUBLIC(SD_workstation_t*) SD_task_get_workstation_list(SD_task_t task);
 XBT_PUBLIC(void) SD_task_destroy(SD_task_t task);
 XBT_PUBLIC(void) SD_task_dump(SD_task_t task);
 XBT_PUBLIC(SD_workstation_t*) SD_task_get_workstation_list(SD_task_t task);
 XBT_PUBLIC(void) SD_task_destroy(SD_task_t task);
 XBT_PUBLIC(void) SD_task_dump(SD_task_t task);
+XBT_PUBLIC(void) SD_task_dotty(SD_task_t task,void* out_FILE);
 
 XBT_PUBLIC(SD_task_t) SD_task_create_comp_seq(const char*name,void *data,double amount);
 XBT_PUBLIC(SD_task_t) SD_task_create_comm_e2e(const char*name,void *data,double amount);
 
 XBT_PUBLIC(SD_task_t) SD_task_create_comp_seq(const char*name,void *data,double amount);
 XBT_PUBLIC(SD_task_t) SD_task_create_comm_e2e(const char*name,void *data,double amount);
index 101c92c..7f8aa30 100644 (file)
@@ -271,7 +271,7 @@ double SD_task_get_remaining_amount(SD_task_t task)
     return task->remains;
 }
 
     return task->remains;
 }
 
-/* temporary function for debbuging */
+/** @brief Displays debugging informations about a task */
 void SD_task_dump(SD_task_t task)
 {
   unsigned int counter;
 void SD_task_dump(SD_task_t task)
 {
   unsigned int counter;
@@ -304,6 +304,24 @@ void SD_task_dump(SD_task_t task)
     }
   }
 }
     }
   }
 }
+/** @brief Dumps the task in dotty formalism into the FILE* passed as second argument */
+void SD_task_dotty(SD_task_t task,void* out) {
+  unsigned int counter;
+  SD_dependency_t dependency;
+  fprintf(out, "  T%d [label=\"%.10s\"",(unsigned int)task,task->name);
+  switch(task->kind){
+    case SD_TASK_COMM_E2E:
+      fprintf(out,", shape=box");
+      break;
+    case SD_TASK_COMP_SEQ:
+      fprintf(out,", shape=circle");
+      break;
+  }
+  fprintf(out,"];\n");
+  xbt_dynar_foreach(task->tasks_before,counter,dependency) {
+    fprintf(out," T%d -> T%d;\n",(unsigned int)dependency->src,(unsigned int)dependency->dst);
+  }
+}
 
 /* Destroys a dependency between two tasks.
  */
 
 /* Destroys a dependency between two tasks.
  */