From 5391e6b0fad0842c9c69f13d14a4fb4527268848 Mon Sep 17 00:00:00 2001 From: schnorr Date: Wed, 15 Sep 2010 15:58:22 +0000 Subject: [PATCH] trace: new interface function for tracing resource categorized utilization with SMPI 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 | 2 ++ src/instr/interface.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/instr/instr.h b/include/instr/instr.h index d1ef918410..74deeed5e0 100644 --- a/include/instr/instr.h +++ b/include/instr/instr.h @@ -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 */ diff --git a/src/instr/interface.c b/src/instr/interface.c index 8b1d08ca55..7c42143468 100644 --- a/src/instr/interface.c +++ b/src/instr/interface.c @@ -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 */ -- 2.20.1