+ print_line (OPT_TRACING_DISABLE_DESTROY, "Disable platform containers destruction",
+ " Disable the destruction of containers at the end of simulation. This can be\n"
+ " used with simulators that have a different notion of time (different from\n"
+ " the simulated time).",
+ detailed);
+ print_line (OPT_TRIVA_UNCAT_CONF, "Generate graph configuration for Triva",
+ " This option can be used in all types of simulators build with SimGrid\n"
+ " to generate a uncategorized resource utilization graph to be used as\n"
+ " configuration for the Triva visualization analysis. This option\n"
+ " can be used with tracing/categorized:1 and tracing:1 options to\n"
+ " analyze an unmodified simulator before changing it to contain\n"
+ " categories.",
+ detailed);
+ print_line (OPT_TRIVA_CAT_CONF, "generate uncategorized graph configuration for Triva",
+ " This option can be used if this simulator uses tracing categories\n"
+ " in its code. The file specified by this option holds a graph configuration\n"
+ " file for the Triva visualization tool that can be used to analyze a categorized\n"
+ " resource utilization.",
+ detailed);
+}
+
+void TRACE_generate_triva_uncat_conf (void)
+{
+ char *output = TRACE_get_triva_uncat_conf ();
+ if (output && strlen(output) > 0){
+ xbt_dict_cursor_t cursor=NULL;
+ char *name, *value;
+
+ FILE *file = fopen (output, "w");
+ if (file == NULL){
+ THROWF (system_error, 1, "Unable to open file (%s) for writing triva graph "
+ "configuration (uncategorized).", output);
+ }
+
+ //open
+ fprintf (file, "{\n");
+
+ //register NODE types
+ fprintf (file, " node = (");
+ xbt_dict_foreach(trivaNodeTypes, cursor, name, value) {
+ fprintf (file, "%s, ", name);
+ }
+
+ //register EDGE types
+ fprintf (file,
+ ");\n"
+ " edge = (");
+ xbt_dict_foreach(trivaEdgeTypes, cursor, name, value) {
+ fprintf (file, "%s, ", name);
+ }
+ fprintf (file,
+ ");\n"
+ "\n");
+
+ //configuration for all nodes
+ fprintf (file,
+ " host = {\n"
+ " type = square;\n"
+ " size = power;\n"
+ " values = (power_used);\n"
+ " };\n"
+ " link = {\n"
+ " type = rhombus;\n"
+ " size = bandwidth;\n"
+ " values = (bandwidth_used);\n"
+ " };\n");
+ //close
+ fprintf (file, "}\n");
+ fclose (file);
+ }
+}
+
+void TRACE_generate_triva_cat_conf (void)
+{
+ char *output = TRACE_get_triva_cat_conf();
+ if (output && strlen(output) > 0){
+ xbt_dict_cursor_t cursor=NULL, cursor2=NULL;
+ char *name, *name2, *value, *value2;
+
+ //check if we do have categories declared
+ if (xbt_dict_is_empty(created_categories)){
+ XBT_INFO("No categories declared, ignoring generation of triva graph configuration");
+ return;
+ }
+
+ FILE *file = fopen (output, "w");
+ if (file == NULL){
+ THROWF (system_error, 1, "Unable to open file (%s) for writing triva graph "
+ "configuration (categorized).", output);
+ }
+
+ //open
+ fprintf (file, "{\n");
+
+ //register NODE types
+ fprintf (file, " node = (");
+ xbt_dict_foreach(trivaNodeTypes, cursor, name, value) {
+ fprintf (file, "%s, ", name);
+ }
+
+ //register EDGE types
+ fprintf (file,
+ ");\n"
+ " edge = (");
+ xbt_dict_foreach(trivaEdgeTypes, cursor, name, value) {
+ fprintf (file, "%s, ", name);
+ }
+ fprintf (file,
+ ");\n"
+ "\n");
+
+ //configuration for all nodes
+ fprintf (file,
+ " host = {\n"
+ " type = square;\n"
+ " size = power;\n"
+ " values = (");
+ xbt_dict_foreach(created_categories,cursor2,name2,value2) {
+ fprintf (file, "p%s, ", name2);
+ }
+ fprintf (file,
+ ");\n"
+ " };\n"
+ " link = {\n"
+ " type = rhombus;\n"
+ " size = bandwidth;\n"
+ " values = (");
+ xbt_dict_foreach(created_categories,cursor2,name2,value2) {
+ fprintf (file, "b%s, ", name2);
+ }
+ fprintf (file,
+ ");\n"
+ " };\n");
+ //close
+ fprintf (file, "}\n");
+ fclose (file);
+ }