Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
tracing option to trace uncategorized resource utilization
[simgrid.git] / src / instr / instr_config.c
index 57a9ee9..87f1540 100644 (file)
 #ifdef HAVE_TRACING
 
 #define OPT_TRACING_SMPI          "tracing/smpi"
+#define OPT_TRACING_SMPI_GROUP    "tracing/smpi/group"
 #define OPT_TRACING_PLATFORM      "tracing/platform"
+#define OPT_TRACING_UNCATEGORIZED "tracing/uncategorized"
 #define OPT_TRACING_MSG_TASK      "tracing/msg/task"
 #define OPT_TRACING_MSG_PROCESS   "tracing/msg/process"
 #define OPT_TRACING_MSG_VOLUME    "tracing/msg/volume"
 #define OPT_TRACING_FILENAME      "tracing/filename"
+#define OPT_TRACING_PLATFORM_METHOD "tracing/platform/method"
 
-int _TRACE_smpi_enabled (void)
+static int trace_configured = 0;
+
+int TRACE_is_configured(void)
+{
+  return trace_configured;
+}
+
+int TRACE_smpi_is_enabled(void)
 {
   return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_SMPI);
 }
 
-int _TRACE_platform_enabled (void)
+int TRACE_smpi_is_grouped(void)
+{
+  return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_SMPI_GROUP);
+}
+
+int TRACE_platform_is_enabled(void)
 {
   return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_PLATFORM);
 }
 
-int _TRACE_msg_task_enabled (void)
+int TRACE_uncategorized (void)
+{
+  return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_UNCATEGORIZED);
+}
+
+int TRACE_msg_task_is_enabled(void)
 {
   return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_MSG_TASK);
 }
 
-int _TRACE_msg_process_enabled (void)
+int TRACE_msg_process_is_enabled(void)
 {
   return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_MSG_PROCESS);
 }
 
-int _TRACE_msg_volume_enabled (void)
+int TRACE_msg_volume_is_enabled(void)
 {
   return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_MSG_VOLUME);
 }
 
-char *_TRACE_filename (void)
+char *TRACE_get_filename(void)
 {
-  return xbt_cfg_get_string (_surf_cfg_set, OPT_TRACING_FILENAME);
+  return xbt_cfg_get_string(_surf_cfg_set, OPT_TRACING_FILENAME);
+}
+
+char *TRACE_get_platform_method(void)
+{
+  return xbt_cfg_get_string(_surf_cfg_set, OPT_TRACING_PLATFORM_METHOD);
 }
 
 void TRACE_global_init(int *argc, char **argv)
@@ -51,9 +76,9 @@ void TRACE_global_init(int *argc, char **argv)
   /* name of the tracefile */
   char *default_tracing_filename = xbt_strdup("simgrid.trace");
   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_FILENAME,
-                    "Trace file created by the instrumented SimGrid.",
-                    xbt_cfgelm_string, &default_tracing_filename, 1, 1,
-                    NULL, NULL);
+                   "Trace file created by the instrumented SimGrid.",
+                   xbt_cfgelm_string, &default_tracing_filename, 1, 1,
+                   NULL, NULL);
 
   /* smpi */
   int default_tracing_smpi = 0;
@@ -62,6 +87,14 @@ void TRACE_global_init(int *argc, char **argv)
                    xbt_cfgelm_int, &default_tracing_smpi, 0, 1,
                    NULL, NULL);
 
+  /* smpi grouped */
+  int default_tracing_smpi_grouped = 0;
+  xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_SMPI_GROUP,
+                   "Group MPI processes by host.",
+                   xbt_cfgelm_int, &default_tracing_smpi_grouped, 0, 1,
+                   NULL, NULL);
+
+
   /* platform */
   int default_tracing_platform = 0;
   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_PLATFORM,
@@ -69,6 +102,20 @@ void TRACE_global_init(int *argc, char **argv)
                    xbt_cfgelm_int, &default_tracing_platform, 0, 1,
                    NULL, NULL);
 
+  /* tracing uncategorized resource utilization */
+  int default_tracing_uncategorized = 0;
+  xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_UNCATEGORIZED,
+                   "Tracing of uncategorized resource (host and link) utilization.",
+                   xbt_cfgelm_int, &default_tracing_uncategorized, 0, 1,
+                   NULL, NULL);
+
+  /* platform method */
+  char *default_tracing_platform_method = xbt_strdup("b");
+  xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_PLATFORM_METHOD,
+                   "Tracing method used to register categorized resource behavior.",
+                   xbt_cfgelm_string, &default_tracing_platform_method, 1,
+                   1, NULL, NULL);
+
   /* msg task */
   int default_tracing_msg_task = 0;
   xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_MSG_TASK,
@@ -89,6 +136,9 @@ void TRACE_global_init(int *argc, char **argv)
                    "Tracing of MSG communication volume (experimental).",
                    xbt_cfgelm_int, &default_tracing_msg_volume, 0, 1,
                    NULL, NULL);
+
+  /* instrumentation can be considered configured now */
+  trace_configured = 1;
 }
 
 #endif