Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
trace: new interface function for tracing resource categorized utilization with SMPI
authorschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 15 Sep 2010 15:58:22 +0000 (15:58 +0000)
committerschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 15 Sep 2010 15:58:22 +0000 (15:58 +0000)
details:
- still experimental
- include "instr/instr.h" in your code MPI
- put TRACE_smpi_set_category ("name_of_your_cat") somewhere
in the code that all processes execute. example:
Do this:
{
  ...
  TRACE_smpi_set_category (...);
  if (rank == 0){
  }else{
  }
  ...
}
instead of this:
{
  ...
  if (rank == 0){
    TRACE_smpi_set_category (...);
  }else{
  }
  ...
}
- call TRACE_smpi_set_category (NULL) to de-activate
the tracing of the platform utilization according to
a category
- all this only works if the smpi simulation is launched with
the option --cfg=tracing/platform:1 (next commits will have
an additional option in smpirun to handle that)

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

include/instr/instr.h
src/instr/interface.c

index d1ef918..74deeed 100644 (file)
@@ -34,6 +34,7 @@ XBT_PUBLIC(void) __TRACE_host_variable (double time, const char *variable, doubl
 XBT_PUBLIC(void) __TRACE_link_variable (double time, const char *src, const char *dst, const char *variable, double value, const char *what);
 XBT_PUBLIC(void) TRACE_declare_mark (const char *mark_type);
 XBT_PUBLIC(void) TRACE_mark (const char *mark_type, const char *mark_value);
+XBT_PUBLIC(int) TRACE_smpi_set_category (const char *category);
 
 #define TRACE_host_variable_declare(var) \
        __TRACE_host_variable(0,var,0,"declare");
@@ -104,6 +105,7 @@ XBT_PUBLIC(void) TRACE_mark (const char *mark_type, const char *mark_value);
 #define TRACE_link_variable_sub(src,dst,var,value)
 #define TRACE_declare_mark(type)
 #define TRACE_mark(type,value)
+#define TRACE_smpi_set_category(cat)
 
 #endif /* HAVE_TRACING */
 
index 8b1d08c..7c42143 100644 (file)
@@ -196,4 +196,18 @@ void TRACE_mark (const char *mark_type, const char *mark_value)
   pajeNewEvent (MSG_get_clock(), mark_type, "0", mark_value);
 }
 
+int TRACE_smpi_set_category (const char *category)
+{
+  //if category is NULL, trace of platform is disabled
+  if (!IS_TRACING) return 1;
+  if (category != NULL){
+    int ret = TRACE_category (category);
+    __TRACE_category_set (SIMIX_process_self(), category);
+    return ret;
+  }else{
+    __TRACE_category_unset (SIMIX_process_self());
+    return 0;
+  }
+}
+
 #endif /* HAVE_TRACING */