+void TRACE_generate_triva_uncat_conf (void)
+{
+ char *output = TRACE_get_triva_uncat_conf ();
+ if (output && strlen(output) > 0){
+ FILE *file = fopen (output, "w");
+ if (!file){
+ THROW1(tracing_error, TRACE_ERROR_FILE_OPEN,
+ "Unable to open file (%s) for writing triva graph configuration (uncategorized).", output);
+ }
+ fprintf (file,
+ "{\n"
+ " node = (HOST);\n"
+ " edge = (LINK);\n"
+ "\n"
+ " HOST = {\n"
+ " size = power;\n"
+ " scale = global;\n"
+ " host_sep = {\n"
+ " type = separation;\n"
+ " size = power;\n"
+ " values = (power_used);\n"
+ " };\n"
+ " };\n"
+ " LINK = {\n"
+ " src = source;\n"
+ " dst = destination;\n"
+ " size = bandwidth;\n"
+ " scale = global;\n"
+ " link_sep = {\n"
+ " type = separation;\n"
+ " size = bandwidth;\n"
+ " values = (bandwidth_used);\n"
+ " };\n"
+ " };\n"
+ " graphviz-algorithm = neato;\n"
+ "}\n"
+ );
+ fclose (file);
+ }
+}
+
+void TRACE_generate_triva_cat_conf (void)
+{
+ char *output = TRACE_get_triva_cat_conf();
+ if (output && strlen(output) > 0){
+ //check if we do have categories declared
+ if (xbt_dict_length(created_categories) == 0){
+// INFO0("No categories declared, ignoring generation of triva graph configuration");
+ return;
+ }
+ xbt_dict_cursor_t cursor=NULL;
+ char *key, *data;
+ FILE *file = fopen (output, "w");
+ if (!file){
+ THROW1(tracing_error, TRACE_ERROR_FILE_OPEN,
+ "Unable to open file (%s) for writing triva graph configuration (categorized).", output);
+ }
+ fprintf (file,
+ "{\n"
+ " node = (HOST);\n"
+ " edge = (LINK);\n"
+ "\n"
+ " HOST = {\n"
+ " size = power;\n"
+ " scale = global;\n"
+ " host_sep = {\n"
+ " type = separation;\n"
+ " size = power;\n"
+ " values = (");
+ xbt_dict_foreach(created_categories,cursor,key,data) {
+ fprintf(file, "p%s, ",key);
+ }
+ fprintf (file,
+ ");\n"
+ " };\n"
+ " };\n"
+ " LINK = {\n"
+ " src = source;\n"
+ " dst = destination;\n"
+ " size = bandwidth;\n"
+ " scale = global;\n"
+ " link_sep = {\n"
+ " type = separation;\n"
+ " size = bandwidth;\n"
+ " values = (");
+ xbt_dict_foreach(created_categories,cursor,key,data) {
+ fprintf(file, "b%s, ",key);
+ }
+ fprintf (file,
+ ");\n"
+ " };\n"
+ " };\n"
+ " graphviz-algorithm = neato;\n"
+ "}\n"
+ );
+ fclose(file);
+ }
+}
+