Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics around surf traces
[simgrid.git] / src / surf / trace_mgr.cpp
index bc84964..1515321 100644 (file)
@@ -312,8 +312,6 @@ tmgr_trace_t tmgr_trace_new_from_string(const char *id, const char *input,
 
 tmgr_trace_t tmgr_trace_new_from_file(const char *filename)
 {
-  char *tstr = NULL;
-  FILE *f = NULL;
   tmgr_trace_t trace = NULL;
 
   if ((!filename) || (strcmp(filename, "") == 0))
@@ -327,12 +325,11 @@ tmgr_trace_t tmgr_trace_new_from_file(const char *filename)
     }
   }
 
-  f = surf_fopen(filename, "r");
-  if (f == NULL)
-    xbt_die("Cannot open file '%s' (path=%s)", filename,
-            xbt_str_join(surf_path, ":"));
+  FILE *f = surf_fopen(filename, "r");
+  xbt_assert(f != NULL,
+      "Cannot open file '%s' (path=%s)", filename, xbt_str_join(surf_path, ":"));
 
-  tstr = xbt_str_from_file(f);
+  char *tstr = xbt_str_from_file(f);
   fclose(f);
   trace = tmgr_trace_new_from_string(filename, tstr, 0.);
   xbt_free(tstr);
@@ -372,6 +369,7 @@ void tmgr_trace_free(tmgr_trace_t trace)
   free(trace);
 }
 
+/** Register a new trace into the future event set, and get an iterator over the integrated trace  */
 tmgr_trace_iterator_t simgrid::trace_mgr::future_evt_set::add_trace(
     tmgr_trace_t trace,
     double start_time,