+void print_TICreateContainer(paje_event_t event)
+{
+ //if we are in the mode with only one file
+ static FILE *temp = NULL;
+
+ if (tracing_files == NULL) {
+ tracing_files = xbt_dict_new_homogeneous(NULL);
+ //generate unique run id with time
+ prefix = xbt_os_time();
+ }
+
+ if (!xbt_cfg_get_boolean(_sg_cfg_set, "tracing/smpi/format/ti_one_file")
+ || temp == NULL) {
+ char *folder_name = bprintf("%s_files", TRACE_get_filename());
+ char *filename = bprintf("%s/%f_%s.txt", folder_name, prefix,
+ ((createContainer_t) event->data)->container->name);
+#ifdef WIN32
+ mkdir(folder_name);
+#else
+ mkdir(folder_name, S_IRWXU | S_IRWXG | S_IRWXO);
+#endif
+ temp = fopen(filename, "w");
+ if (temp == NULL)
+ xbt_die("Tracefile %s could not be opened for writing: %s",
+ filename, strerror(errno));
+ fprintf(tracing_file, "%s\n", filename);
+
+ xbt_free(folder_name);
+ xbt_free(filename);
+ }
+
+ xbt_dict_set(tracing_files,
+ ((createContainer_t) event->data)->container->name,
+ (void *) temp, NULL);
+}
+
+void print_TIDestroyContainer(paje_event_t event)
+{
+ if (!xbt_cfg_get_boolean(_sg_cfg_set, "tracing/smpi/format/ti_one_file")||
+ xbt_dict_length(tracing_files) == 1) {
+ FILE* f = xbt_dict_get_or_null(tracing_files,
+ ((destroyContainer_t) event->data)->container->name);
+ fclose(f);
+ }
+ xbt_dict_remove(tracing_files, ((destroyContainer_t) event->data)->container->name);
+}
+
+