Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] declare smpi category and let instr continues if category already exists
authorschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 7 Dec 2010 09:56:27 +0000 (09:56 +0000)
committerschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 7 Dec 2010 09:56:27 +0000 (09:56 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9040 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/instr/instr_interface.c
src/instr/instr_smpi.c

index ce8d58f..ead66bb 100644 (file)
@@ -91,7 +91,7 @@ int TRACE_create_category_with_color(const char *category,
       "Category (used as parent) %s is not created", parent_category);
   //check if category is created
   char *created = xbt_dict_get_or_null(created_categories, category);
       "Category (used as parent) %s is not created", parent_category);
   //check if category is created
   char *created = xbt_dict_get_or_null(created_categories, category);
-  xbt_assert1 (created == NULL, "Category %s is already defined", category);
+  if (created) return 0;
 
   pajeCreateContainer(MSG_get_clock(), category, type, parent_category,
                       category);
 
   pajeCreateContainer(MSG_get_clock(), category, type, parent_category,
                       category);
index db64b26..a5c139d 100644 (file)
@@ -58,6 +58,9 @@ void TRACE_internal_smpi_set_category (const char *category)
 {
   if (!TRACE_smpi_is_enabled()) return;
 
 {
   if (!TRACE_smpi_is_enabled()) return;
 
+  //declare category
+  TRACE_category (category);
+
   char processid[INSTR_DEFAULT_STR_SIZE];
   snprintf (processid, INSTR_DEFAULT_STR_SIZE, "%p", SIMIX_process_self());
   if (xbt_dict_get_or_null (process_category, processid))
   char processid[INSTR_DEFAULT_STR_SIZE];
   snprintf (processid, INSTR_DEFAULT_STR_SIZE, "%p", SIMIX_process_self());
   if (xbt_dict_get_or_null (process_category, processid))