Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] be more strict about errors
authorLucas Schnorr <Lucas.Schnorr@imag.fr>
Sun, 22 Jan 2012 23:34:52 +0000 (00:34 +0100)
committerLucas Schnorr <Lucas.Schnorr@imag.fr>
Sun, 22 Jan 2012 23:55:25 +0000 (00:55 +0100)
src/instr/instr_config.c
src/instr/instr_paje_trace.c

index e91a964..d987722 100644 (file)
@@ -73,7 +73,9 @@ int TRACE_start()
   TRACE_paje_start();
 
   /* activate trace */
-  xbt_assert (trace_active==0, "Tracing is already active.");
+  if (trace_active == 1){
+    THROWF (tracing_error, 0, "Tracing is already active");
+  }
   trace_active = 1;
   XBT_DEBUG ("Tracing is on");
 
@@ -395,9 +397,10 @@ void TRACE_generate_triva_uncat_conf (void)
     char *name, *value;
 
     FILE *file = fopen (output, "w");
-    xbt_assert (file != NULL,
-       "Unable to open file (%s) for writing triva graph "
-       "configuration (uncategorized).", output);
+    if (file == NULL){
+      THROWF (system_error, 1, "Unable to open file (%s) for writing triva graph "
+          "configuration (uncategorized).", output);
+    }
 
     //open
     fprintf (file, "{\n");
@@ -451,9 +454,10 @@ void TRACE_generate_triva_cat_conf (void)
     }
 
     FILE *file = fopen (output, "w");
-    xbt_assert (file != NULL,
-       "Unable to open file (%s) for writing triva graph "
-       "configuration (categorized).", output);
+    if (file == NULL){
+      THROWF (system_error, 1, "Unable to open file (%s) for writing triva graph "
+          "configuration (categorized).", output);
+    }
 
     //open
     fprintf (file, "{\n");
index c4a7cbe..b994510 100644 (file)
@@ -155,7 +155,9 @@ void TRACE_paje_start(void)
 {
   char *filename = TRACE_get_filename();
   tracing_file = fopen(filename, "w");
-  xbt_assert (tracing_file != NULL, "Tracefile %s could not be opened for writing.", filename);
+  if (tracing_file == NULL){
+    THROWF (system_error, 1, "Tracefile %s could not be opened for writing.", filename);
+  }
 
   XBT_DEBUG("Filename %s is open for writing", filename);