Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix: missing undef
[simgrid.git] / src / instr / instr_config.c
1 /* Copyright (c) 2010. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5   * under the terms of the license (GNU LGPL) which comes with this package. */
6
7
8 #include "instr/instr_private.h"
9
10 #ifdef HAVE_TRACING
11
12 XBT_LOG_NEW_CATEGORY(instr, "Logging the behavior of the tracing system (used for Visualization/Analysis of simulations)");
13 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_config, instr, "Configuration");
14
15 #define OPT_TRACING               "tracing"
16 #define OPT_TRACING_PLATFORM      "tracing/platform"
17 #define OPT_TRACING_SMPI          "tracing/smpi"
18 #define OPT_TRACING_SMPI_GROUP    "tracing/smpi/group"
19 #define OPT_TRACING_SMPI_COMPUTING "tracing/smpi/computing"
20 #define OPT_TRACING_CATEGORIZED   "tracing/categorized"
21 #define OPT_TRACING_UNCATEGORIZED "tracing/uncategorized"
22 #define OPT_TRACING_MSG_PROCESS   "tracing/msg/process"
23 #define OPT_TRACING_FILENAME      "tracing/filename"
24 #define OPT_TRACING_BUFFER        "tracing/buffer"
25 #define OPT_TRACING_ONELINK_ONLY  "tracing/onelink_only"
26 #define OPT_TRACING_DISABLE_DESTROY "tracing/disable_destroy"
27 #define OPT_TRACING_BASIC         "tracing/basic"
28 #define OPT_TRIVA_UNCAT_CONF      "triva/uncategorized"
29 #define OPT_TRIVA_CAT_CONF        "triva/categorized"
30 #define OPT_VIVA_UNCAT_CONF      "viva/uncategorized"
31 #define OPT_VIVA_CAT_CONF        "viva/categorized"
32
33 static int trace_enabled;
34 static int trace_platform;
35 static int trace_smpi_enabled;
36 static int trace_smpi_grouped;
37 static int trace_smpi_computing;
38 static int trace_categorized;
39 static int trace_uncategorized;
40 static int trace_msg_process_enabled;
41 static int trace_buffer;
42 static int trace_onelink_only;
43 static int trace_disable_destroy;
44 static int trace_basic;
45
46 static int trace_configured = 0;
47 static int trace_active = 0;
48
49 static void TRACE_getopts(void)
50 {
51   trace_enabled = xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING);
52   trace_platform = xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_PLATFORM);
53   trace_smpi_enabled = xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_SMPI);
54   trace_smpi_grouped = xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_SMPI_GROUP);
55   trace_smpi_computing = xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_SMPI_COMPUTING);
56   trace_categorized = xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_CATEGORIZED);
57   trace_uncategorized = xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_UNCATEGORIZED);
58   trace_msg_process_enabled = xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_MSG_PROCESS);
59   trace_buffer = xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_BUFFER);
60   trace_onelink_only = xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_ONELINK_ONLY);
61   trace_disable_destroy = xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_DISABLE_DESTROY);
62   trace_basic = xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_BASIC);
63 }
64
65 int TRACE_start()
66 {
67   TRACE_getopts();
68
69   // tracing system must be:
70   //    - enabled (with --cfg=tracing:1)
71   //    - already configured (TRACE_global_init already called)
72   if (!(TRACE_is_enabled() && TRACE_is_configured())){
73     return 0;
74   }
75
76   XBT_DEBUG("Tracing starts");
77
78   /* open the trace file */
79   TRACE_paje_start();
80
81   /* activate trace */
82   if (trace_active == 1){
83     THROWF (tracing_error, 0, "Tracing is already active");
84   }
85   trace_active = 1;
86   XBT_DEBUG ("Tracing is on");
87
88   /* other trace initialization */
89   created_categories = xbt_dict_new_homogeneous(xbt_free);
90   declared_marks = xbt_dict_new_homogeneous (xbt_free);
91   user_host_variables = xbt_dict_new_homogeneous (xbt_free);
92   user_link_variables = xbt_dict_new_homogeneous (xbt_free);
93   TRACE_surf_alloc();
94   TRACE_smpi_alloc();
95   return 0;
96 }
97
98 int TRACE_end()
99 {
100   if (!trace_active)
101     return 1;
102
103   TRACE_generate_triva_uncat_conf();
104   TRACE_generate_triva_cat_conf();
105   TRACE_generate_viva_uncat_conf();
106   TRACE_generate_viva_cat_conf();
107
108   /* dump trace buffer */
109   TRACE_last_timestamp_to_dump = surf_get_clock();
110   TRACE_paje_dump_buffer(1);
111
112   /* destroy all data structures of tracing (and free) */
113   PJ_container_free_all();
114   PJ_type_free_all();
115   PJ_container_release();
116   PJ_type_release();
117   TRACE_smpi_release();
118   TRACE_surf_release();
119   xbt_dict_free(&user_link_variables);
120   xbt_dict_free(&user_host_variables);
121   xbt_dict_free(&declared_marks);
122   xbt_dict_free(&created_categories);
123
124   /* close the trace file */
125   TRACE_paje_end();
126
127   /* de-activate trace */
128   trace_active = 0;
129   XBT_DEBUG ("Tracing is off");
130   XBT_DEBUG("Tracing system is shutdown");
131   return 0;
132 }
133
134 int TRACE_needs_platform (void)
135 {
136   return TRACE_msg_process_is_enabled() ||
137          TRACE_categorized() ||
138          TRACE_uncategorized() ||
139          TRACE_platform () ||
140          (TRACE_smpi_is_enabled() && TRACE_smpi_is_grouped());
141 }
142
143 int TRACE_is_enabled(void)
144 {
145   return trace_enabled;
146 }
147
148 int TRACE_platform(void)
149 {
150   return trace_platform;
151 }
152
153 int TRACE_is_configured(void)
154 {
155   return trace_configured;
156 }
157
158 int TRACE_smpi_is_enabled(void)
159 {
160   return (trace_smpi_enabled || TRACE_smpi_is_grouped())
161     && TRACE_is_enabled();
162 }
163
164 int TRACE_smpi_is_grouped(void)
165 {
166   return trace_smpi_grouped;
167 }
168
169 int TRACE_smpi_is_computing(void)
170 {
171   return trace_smpi_computing;
172 }
173
174
175 int TRACE_categorized (void)
176 {
177   return trace_categorized;
178 }
179
180 int TRACE_uncategorized (void)
181 {
182   return trace_uncategorized;
183 }
184
185 int TRACE_msg_process_is_enabled(void)
186 {
187   return trace_msg_process_enabled && TRACE_is_enabled();
188 }
189
190 int TRACE_buffer (void)
191 {
192   return trace_buffer && TRACE_is_enabled();
193 }
194
195 int TRACE_onelink_only (void)
196 {
197   return trace_onelink_only && TRACE_is_enabled();
198 }
199
200 int TRACE_disable_destroy (void)
201 {
202   return trace_disable_destroy && TRACE_is_enabled();
203 }
204
205 int TRACE_basic (void)
206 {
207   return trace_basic && TRACE_is_enabled();
208 }
209
210
211 char *TRACE_get_filename(void)
212 {
213   return xbt_cfg_get_string(_surf_cfg_set, OPT_TRACING_FILENAME);
214 }
215
216 char *TRACE_get_triva_uncat_conf (void)
217 {
218   return xbt_cfg_get_string(_surf_cfg_set, OPT_TRIVA_UNCAT_CONF);
219 }
220
221 char *TRACE_get_triva_cat_conf (void)
222 {
223   return xbt_cfg_get_string(_surf_cfg_set, OPT_TRIVA_CAT_CONF);
224 }
225
226 char *TRACE_get_viva_uncat_conf (void)
227 {
228   return xbt_cfg_get_string(_surf_cfg_set, OPT_VIVA_UNCAT_CONF);
229 }
230
231 char *TRACE_get_viva_cat_conf (void)
232 {
233   return xbt_cfg_get_string(_surf_cfg_set, OPT_VIVA_CAT_CONF);
234 }
235
236 void TRACE_global_init(int *argc, char **argv)
237 {
238   /* name of the tracefile */
239   char *default_tracing_filename = xbt_strdup("simgrid.trace");
240   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_FILENAME,
241                    "Trace file created by the instrumented SimGrid.",
242                    xbt_cfgelm_string, &default_tracing_filename, 1, 1,
243                    NULL, NULL);
244
245   /* tracing */
246   int default_tracing = 0;
247   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING,
248                    "Enable Tracing.",
249                    xbt_cfgelm_int, &default_tracing, 0, 1,
250                    NULL, NULL);
251
252   /* register platform in the trace */
253   int default_tracing_platform = 0;
254   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_PLATFORM,
255                    "Register the platform in the trace as a graph.",
256                    xbt_cfgelm_int, &default_tracing_platform, 0, 1,
257                    NULL, NULL);
258
259   /* smpi */
260   int default_tracing_smpi = 0;
261   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_SMPI,
262                    "Tracing of the SMPI interface.",
263                    xbt_cfgelm_int, &default_tracing_smpi, 0, 1,
264                    NULL, NULL);
265
266   /* smpi grouped */
267   int default_tracing_smpi_grouped = 0;
268   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_SMPI_GROUP,
269                    "Group MPI processes by host.",
270                    xbt_cfgelm_int, &default_tracing_smpi_grouped, 0, 1,
271                    NULL, NULL);
272
273   /* smpi computing */
274   int default_tracing_smpi_computing = 0;
275   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_SMPI_COMPUTING,
276                    "Generate states for timing out of SMPI parts of the application",
277                    xbt_cfgelm_int, &default_tracing_smpi_computing, 0, 1,
278                    NULL, NULL);
279
280   /* tracing categorized resource utilization traces */
281   int default_tracing_categorized = 0;
282   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_CATEGORIZED,
283                    "Tracing categorized resource utilization of hosts and links.",
284                    xbt_cfgelm_int, &default_tracing_categorized, 0, 1,
285                    NULL, NULL);
286
287   /* tracing uncategorized resource utilization */
288   int default_tracing_uncategorized = 0;
289   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_UNCATEGORIZED,
290                    "Tracing uncategorized resource utilization of hosts and links.",
291                    xbt_cfgelm_int, &default_tracing_uncategorized, 0, 1,
292                    NULL, NULL);
293
294   /* msg process */
295   int default_tracing_msg_process = 0;
296   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_MSG_PROCESS,
297                    "Tracing of MSG process behavior.",
298                    xbt_cfgelm_int, &default_tracing_msg_process, 0, 1,
299                    NULL, NULL);
300
301   /* tracing buffer */
302   int default_buffer = 1;
303   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_BUFFER,
304                    "Buffer trace events to put them in temporal order.",
305                    xbt_cfgelm_int, &default_buffer, 0, 1,
306                    NULL, NULL);
307
308   /* tracing one link only */
309   int default_onelink_only = 0;
310   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_ONELINK_ONLY,
311                    "Use only routes with one link to trace platform.",
312                    xbt_cfgelm_int, &default_onelink_only, 0, 1,
313                    NULL, NULL);
314
315   /* disable destroy */
316   int default_disable_destroy = 0;
317   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_DISABLE_DESTROY,
318                    "Disable platform containers destruction.",
319                    xbt_cfgelm_int, &default_disable_destroy, 0, 1,
320                    NULL, NULL);
321
322   /* basic -- Avoid extended events (impoverished trace file) */
323   int default_basic = 0;
324   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_BASIC,
325                    "Avoid extended events (impoverished trace file).",
326                    xbt_cfgelm_int, &default_basic, 0, 1,
327                    NULL, NULL);
328
329   /* Triva graph configuration for uncategorized tracing */
330   char *default_triva_uncat_conf_file = xbt_strdup ("");
331   xbt_cfg_register(&_surf_cfg_set, OPT_TRIVA_UNCAT_CONF,
332                    "Triva Graph configuration file for uncategorized resource utilization traces.",
333                    xbt_cfgelm_string, &default_triva_uncat_conf_file, 1, 1,
334                    NULL, NULL);
335
336   /* Triva graph configuration for uncategorized tracing */
337   char *default_triva_cat_conf_file = xbt_strdup ("");
338   xbt_cfg_register(&_surf_cfg_set, OPT_TRIVA_CAT_CONF,
339                    "Triva Graph configuration file for categorized resource utilization traces.",
340                    xbt_cfgelm_string, &default_triva_cat_conf_file, 1, 1,
341                    NULL, NULL);
342
343   /* Viva graph configuration for uncategorized tracing */
344   char *default_viva_uncat_conf_file = xbt_strdup ("");
345   xbt_cfg_register(&_surf_cfg_set, OPT_VIVA_UNCAT_CONF,
346                    "Viva Graph configuration file for uncategorized resource utilization traces.",
347                    xbt_cfgelm_string, &default_viva_uncat_conf_file, 1, 1,
348                    NULL, NULL);
349
350   /* Viva graph configuration for uncategorized tracing */
351   char *default_viva_cat_conf_file = xbt_strdup ("");
352   xbt_cfg_register(&_surf_cfg_set, OPT_VIVA_CAT_CONF,
353                    "Viva Graph configuration file for categorized resource utilization traces.",
354                    xbt_cfgelm_string, &default_viva_cat_conf_file, 1, 1,
355                    NULL, NULL);
356
357   /* instrumentation can be considered configured now */
358   trace_configured = 1;
359 }
360
361 static void print_line (const char *option, const char *desc, const char *longdesc, int detailed)
362 {
363   char str[INSTR_DEFAULT_STR_SIZE];
364   snprintf (str, INSTR_DEFAULT_STR_SIZE, "--cfg=%s ", option);
365
366   int len = strlen (str);
367   printf ("%s%*.*s %s\n", str, 30-len, 30-len, "", desc);
368   if (!!longdesc && detailed){
369     printf ("%s\n\n", longdesc);
370   }
371 }
372
373 void TRACE_help (int detailed)
374 {
375   printf(
376       "Description of the tracing options accepted by this simulator:\n\n");
377   print_line (OPT_TRACING, "Enable the tracing system",
378       "  It activates the tracing system and register the simulation platform\n"
379       "  in the trace file. You have to enable this option to others take effect.",
380       detailed);
381   print_line (OPT_TRACING_CATEGORIZED, "Trace categorized resource utilization",
382       "  It activates the categorized resource utilization tracing. It should\n"
383       "  be enabled if tracing categories are used by this simulator.",
384       detailed);
385   print_line (OPT_TRACING_UNCATEGORIZED, "Trace uncategorized resource utilization",
386       "  It activates the uncategorized resource utilization tracing. Use it if\n"
387       "  this simulator do not use tracing categories and resource use have to be\n"
388       "  traced.",
389       detailed);
390   print_line (OPT_TRACING_FILENAME, "Filename to register traces",
391       "  A file with this name will be created to register the simulation. The file\n"
392       "  is in the Paje format and can be analyzed using Triva or Paje visualization\n"
393       "  tools. More information can be found in these webpages:\n"
394       "     http://triva.gforge.inria.fr/\n"
395       "     http://paje.sourceforge.net/",
396       detailed);
397   print_line (OPT_TRACING_SMPI, "Trace the MPI Interface (SMPI)",
398       "  This option only has effect if this simulator is SMPI-based. Traces the MPI\n"
399       "  interface and generates a trace that can be analyzed using Gantt-like\n"
400       "  visualizations. Every MPI function (implemented by SMPI) is transformed in a\n"
401       "  state, and point-to-point communications can be analyzed with arrows.",
402       detailed);
403   print_line (OPT_TRACING_SMPI_GROUP, "Group MPI processes by host (SMPI)",
404       "  This option only has effect if this simulator is SMPI-based. The processes\n"
405       "  are grouped by the hosts where they were executed.",
406       detailed);
407   print_line (OPT_TRACING_SMPI_COMPUTING, "Generates a \" Computing \" State",
408           "  This option aims at tracing computations in the application, outside SMPI\n"
409       "  to allow further study of simulated or real computation time",
410       detailed);
411   print_line (OPT_TRACING_MSG_PROCESS, "Trace processes behavior (MSG)",
412       "  This option only has effect if this simulator is MSG-based. It traces the\n"
413       "  behavior of all categorized MSG processes, grouping them by hosts. This option\n"
414       "  can be used to track process location if this simulator has process migration.",
415       detailed);
416   print_line (OPT_TRACING_BUFFER, "Buffer events to put them in temporal order",
417       "  This option put some events in a time-ordered buffer using the insertion\n"
418       "  sort algorithm. The process of acquiring and releasing locks to access this\n"
419       "  buffer and the cost of the sorting algorithm make this process slow. The\n"
420       "  simulator performance can be severely impacted if this option is activated,\n"
421       "  but you are sure to get a trace file with events sorted.",
422       detailed);
423   print_line (OPT_TRACING_ONELINK_ONLY, "Consider only one link routes to trace platform",
424       "  This option changes the way SimGrid register its platform on the trace file.\n"
425       "  Normally, the tracing considers all routes (no matter their size) on the\n"
426       "  platform file to re-create the resource topology. If this option is activated,\n"
427       "  only the routes with one link are used to register the topology within an AS.\n"
428       "  Routes among AS continue to be traced as usual.",
429       detailed);
430   print_line (OPT_TRACING_DISABLE_DESTROY, "Disable platform containers destruction",
431       "  Disable the destruction of containers at the end of simulation. This can be\n"
432       "  used with simulators that have a different notion of time (different from\n"
433       "  the simulated time).",
434       detailed);
435   print_line (OPT_TRACING_BASIC, "Avoid extended events (impoverished trace file).",
436       "  Some visualization tools are not able to parse correctly the Paje file format.\n"
437       "  Use this option if you are using one of these tools to visualize the simulation\n"
438       "  trace. Keep in mind that the trace might be incomplete, without all the\n"
439       "  information that would be registered otherwise.",
440       detailed);
441   print_line (OPT_TRIVA_UNCAT_CONF, "Generate graph configuration for Triva",
442       "  This option can be used in all types of simulators build with SimGrid\n"
443       "  to generate a uncategorized resource utilization graph to be used as\n"
444       "  configuration for the Triva visualization analysis. This option\n"
445       "  can be used with tracing/categorized:1 and tracing:1 options to\n"
446       "  analyze an unmodified simulator before changing it to contain\n"
447       "  categories.",
448       detailed);
449   print_line (OPT_TRIVA_CAT_CONF, "generate uncategorized graph configuration for Triva",
450       "  This option can be used if this simulator uses tracing categories\n"
451       "  in its code. The file specified by this option holds a graph configuration\n"
452       "  file for the Triva visualization tool that can be used to analyze a categorized\n"
453       "  resource utilization.",
454       detailed);
455   print_line (OPT_VIVA_UNCAT_CONF, "Generate a graph configuration for Viva",
456       "  This option can be used in all types of simulators build with SimGrid\n"
457       "  to generate a uncategorized resource utilization graph to be used as\n"
458       "  configuration for the Viva visualization tool. This option\n"
459       "  can be used with tracing/categorized:1 and tracing:1 options to\n"
460       "  analyze an unmodified simulator before changing it to contain\n"
461       "  categories.",
462       detailed);
463   print_line (OPT_VIVA_CAT_CONF, "Generate an uncategorized graph configuration for Viva",
464       "  This option can be used if this simulator uses tracing categories\n"
465       "  in its code. The file specified by this option holds a graph configuration\n"
466       "  file for the Viva visualization tool that can be used to analyze a categorized\n"
467       "  resource utilization.",
468       detailed);
469 }
470
471 static void output_types (const char *name, xbt_dynar_t types, FILE *file)
472 {
473   unsigned int i;
474   fprintf (file, "  %s = (", name);
475   for (i = xbt_dynar_length(types); i > 0; i--) {
476     char *type = *(char**)xbt_dynar_get_ptr(types, i - 1);
477     fprintf (file, "\"%s\"", type);
478     if (i - 1 > 0){
479       fprintf (file, ",");
480     }else{
481       fprintf (file, ");\n");
482     }
483   }
484   xbt_dynar_free (&types);
485 }
486
487 static void output_categories (const char *name, xbt_dynar_t cats, FILE *file)
488 {
489   unsigned int i;
490   fprintf (file, "    values = (");
491   for (i = xbt_dynar_length(cats); i > 0; i--) {
492     char *cat = *(char**)xbt_dynar_get_ptr(cats, i - 1);
493     fprintf (file, "\"%s%s\"", name, cat);
494     if (i - 1 > 0){
495       fprintf (file, ",");
496     }else{
497       fprintf (file, ");\n");
498     }
499   }
500   xbt_dynar_free (&cats);
501 }
502
503 static void uncat_configuration (FILE *file)
504 {
505   //register NODE and EDGE types
506   output_types ("node", TRACE_get_node_types(), file);
507   output_types ("edge", TRACE_get_edge_types(), file);
508   fprintf (file, "\n");
509
510   //configuration for all nodes
511   fprintf (file,
512       "  host = {\n"
513       "    type = \"square\";\n"
514       "    size = \"power\";\n"
515       "    values = (\"power_used\");\n"
516       "  };\n"
517       "  link = {\n"
518       "    type = \"rhombus\";\n"
519       "    size = \"bandwidth\";\n"
520       "    values = (\"bandwidth_used\");\n"
521       "  };\n");
522   //close
523 }
524
525 static void cat_configuration (FILE *file)
526 {
527   //register NODE and EDGE types
528   output_types ("node", TRACE_get_node_types(), file);
529   output_types ("edge", TRACE_get_edge_types(), file);
530   fprintf (file, "\n");
531
532   //configuration for all nodes
533   fprintf (file,
534            "  host = {\n"
535            "    type = \"square\";\n"
536            "    size = \"power\";\n");
537   output_categories ("p", TRACE_get_categories(), file);
538   fprintf (file,
539            "  };\n"
540            "  link = {\n"
541            "    type = \"rhombus\";\n"
542            "    size = \"bandwidth\";\n");
543   output_categories ("b", TRACE_get_categories(), file);
544   fprintf (file, "  };\n");
545   //close
546 }
547
548 static void generate_uncat_configuration (const char *output, const char *name, int brackets)
549 {
550   if (output && strlen(output) > 0){
551     FILE *file = fopen (output, "w");
552     if (file == NULL){
553       THROWF (system_error, 1, "Unable to open file (%s) for writing %s graph "
554           "configuration (uncategorized).", output, name);
555     }
556
557     if (brackets) fprintf (file, "{\n");
558     uncat_configuration (file);
559     if (brackets) fprintf (file, "}\n");
560     fclose (file);
561   }
562 }
563
564 static void generate_cat_configuration (const char *output, const char *name, int brackets)
565 {
566   if (output && strlen(output) > 0){
567     //check if we do have categories declared
568     if (xbt_dict_is_empty(created_categories)){
569       XBT_INFO("No categories declared, ignoring generation of %s graph configuration", name);
570       return;
571     }
572
573     FILE *file = fopen (output, "w");
574     if (file == NULL){
575       THROWF (system_error, 1, "Unable to open file (%s) for writing %s graph "
576           "configuration (categorized).", output, name);
577     }
578
579     if (brackets) fprintf (file, "{\n");
580     cat_configuration (file);
581     if (brackets) fprintf (file, "}\n");
582     fclose (file);
583   }
584 }
585
586 void TRACE_generate_triva_uncat_conf (void)
587 {
588   generate_uncat_configuration (TRACE_get_triva_uncat_conf (), "triva", 1);
589 }
590
591 void TRACE_generate_triva_cat_conf (void)
592 {
593   generate_cat_configuration (TRACE_get_triva_cat_conf(), "triva", 1);
594 }
595
596 void TRACE_generate_viva_uncat_conf (void)
597 {
598   generate_uncat_configuration (TRACE_get_viva_uncat_conf (), "viva", 0);
599 }
600
601 void TRACE_generate_viva_cat_conf (void)
602 {
603   generate_cat_configuration (TRACE_get_viva_cat_conf(), "viva", 0);
604 }
605
606 #undef OPT_TRACING
607 #undef OPT_TRACING_PLATFORM
608 #undef OPT_TRACING_SMPI
609 #undef OPT_TRACING_SMPI_GROUP
610 #undef OPT_TRACING_CATEGORIZED
611 #undef OPT_TRACING_UNCATEGORIZED
612 #undef OPT_TRACING_MSG_PROCESS
613 #undef OPT_TRACING_FILENAME
614 #undef OPT_TRACING_BUFFER
615 #undef OPT_TRACING_ONELINK_ONLY
616 #undef OPT_TRACING_DISABLE_DESTROY
617 #undef OPT_TRACING_BASIC
618 #undef OPT_TRIVA_UNCAT_CONF
619 #undef OPT_TRIVA_CAT_CONF
620 #undef OPT_VIVA_UNCAT_CONF
621 #undef OPT_VIVA_CAT_CONF
622
623 #endif /* HAVE_TRACING */