Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
instrumentation of the dax loader and its example
authorschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 10 Nov 2010 13:22:29 +0000 (13:22 +0000)
committerschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 10 Nov 2010 13:22:29 +0000 (13:22 +0000)
details:
- tasks are categorized by their names
- comm tasks are categorized according to the
category of the origin task
- code isolated with ifdef's

todo:
- use the type of file between the tasks as comm categories

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8520 48e7efb5-ca39-0410-a469-dd3cf9ba447f

examples/simdag/dax/dax_test.c
src/simdag/sd_daxloader.c

index 8ae9424..741f5a1 100644 (file)
@@ -33,6 +33,9 @@ int main(int argc, char **argv)
 
   /* initialisation of SD */
   SD_init(&argc, argv);
+#ifdef HAVE_TRACING
+  TRACE_start ();
+#endif
 
   /* Check our arguments */
   if (argc < 3) {
@@ -136,5 +139,8 @@ int main(int argc, char **argv)
 
   /* exit */
   SD_exit();
+#ifdef HAVE_TRACING
+  TRACE_end();
+#endif
   return 0;
 }
index d1f79c1..c8778b9 100644 (file)
@@ -144,6 +144,13 @@ xbt_dynar_t SD_daxload(const char *filename)
             SD_task_create_comm_e2e(file->name, NULL, file->amount);
         SD_task_dependency_add(NULL, NULL, root_task, newfile);
         SD_task_dependency_add(NULL, NULL, newfile, depafter->dst);
+#ifdef HAVE_TRACING
+        const char *category = depbefore->src->category;
+        if (category){
+          TRACE_category (category);
+          TRACE_sd_set_task_category (newfile, category);
+        }
+#endif
         xbt_dynar_push(result, &newfile);
       }
     } else if (xbt_dynar_length(file->tasks_after) == 0) {
@@ -152,6 +159,13 @@ xbt_dynar_t SD_daxload(const char *filename)
             SD_task_create_comm_e2e(file->name, NULL, file->amount);
         SD_task_dependency_add(NULL, NULL, depbefore->src, newfile);
         SD_task_dependency_add(NULL, NULL, newfile, end_task);
+#ifdef HAVE_TRACING
+        const char *category = depbefore->src->category;
+        if (category){
+          TRACE_category (category);
+          TRACE_sd_set_task_category (newfile, category);
+        }
+#endif
         xbt_dynar_push(result, &newfile);
       }
     } else {
@@ -166,6 +180,13 @@ xbt_dynar_t SD_daxload(const char *filename)
               SD_task_create_comm_e2e(file->name, NULL, file->amount);
           SD_task_dependency_add(NULL, NULL, depbefore->src, newfile);
           SD_task_dependency_add(NULL, NULL, newfile, depafter->dst);
+#ifdef HAVE_TRACING
+          const char *category = depbefore->src->category;
+          if (category){
+            TRACE_category (category);
+            TRACE_sd_set_task_category (newfile, category);
+          }
+#endif
           xbt_dynar_push(result, &newfile);
         }
       }
@@ -203,6 +224,13 @@ void STag_dax__job(void)
   runtime *= 4200000000.;       /* Assume that timings were done on a 4.2GFlops machine. I mean, why not? */
 //  INFO3("See <job id=%s runtime=%s %.0f>",A_dax__job_id,A_dax__job_runtime,runtime);
   current_job = SD_task_create_comp_seq(name, NULL, runtime);
+#ifdef HAVE_TRACING
+  char *category = A_dax__job_name;
+  if (category){
+    TRACE_category (category);
+    TRACE_sd_set_task_category(current_job, category);
+  }
+#endif
   xbt_dict_set(jobs, A_dax__job_id, current_job, NULL);
   free(name);
   xbt_dynar_push(result, &current_job);