Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Replace xbt_die(bprintf(...)) with xbt_die(...).
authoragiersch <agiersch@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 22 Feb 2011 13:51:22 +0000 (13:51 +0000)
committeragiersch <agiersch@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 22 Feb 2011 13:51:22 +0000 (13:51 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9689 48e7efb5-ca39-0410-a469-dd3cf9ba447f

19 files changed:
examples/gras/replay/replay.c
examples/gras/replay/xbt_workload.c
examples/msg/chord/chord.c
examples/msg/masterslave/masterslave_failure.c
examples/simdag/dax/dax_test.c
examples/simdag/dot/dot_test.c
examples/simdag/dot/simulate_dot.c
include/xbt/sysdep.h
src/simdag/sd_task.c
src/simix/smx_network.c
src/surf/network_gtnets.c
src/surf/surf.c
src/surf/surf_routing.c
src/surf/surfxml_parse.c
src/surf/trace_mgr.c
src/xbt/config.c
teshsuite/simdag/platforms/flatifier.c
tools/graphicator/graphicator.c
tools/gras/stub_generator.c

index e47c1ba..f915360 100644 (file)
@@ -185,8 +185,7 @@ static void do_command(int rank, void *c)
     XBT_INFO("Done receiving %.f bytes from %s", cmd->d_arg, cmd->str_arg);
 
   } else {
-    xbt_die(bprintf
-            ("unknown command: %s", xbt_workload_elm_to_string(cmd)));
+    xbt_die("unknown command: %s", xbt_workload_elm_to_string(cmd));
   }
 }
 
index 769d8b5..f3a8a79 100644 (file)
@@ -56,7 +56,7 @@ xbt_workload_elm_t xbt_workload_elm_parse(char *line)
     res->action = XBT_WORKLOAD_COMPUTE;
     sscanf(words[++i], "%lg", &(res->d_arg));
   } else {
-    xbt_die(bprintf("Unparsable command: %s (in %s)", words[i], line));
+    xbt_die("Unparsable command: %s (in %s)", words[i], line);
   }
   i++;
   if (words[i] && words[i][0] == '#') {
@@ -119,7 +119,7 @@ char *xbt_workload_elm_to_string(xbt_workload_elm_t cmd)
     free(addon);
     break;
   default:
-    xbt_die(bprintf("Unknown command %d in '%s...'", cmd->action, res));
+    xbt_die("Unknown command %d in '%s...'", cmd->action, res);
   }
   if (cmd->comment) {
     addon = bprintf(" (comment: %s)", cmd->comment);
index f8ae33b..5b5a3b5 100644 (file)
@@ -917,7 +917,7 @@ int main(int argc, char *argv[])
        XBT_DEBUG("Set timeout to %d", timeout);
       }
       else {
-       xbt_die(bprintf("Invalid chord option '%s'", options[0]));
+       xbt_die("Invalid chord option '%s'", options[0]);
       }
     }
     options++;
index 604af18..bd8c4cc 100644 (file)
@@ -124,8 +124,7 @@ int master(int argc, char *argv[])
       MSG_task_destroy(task);
     } else {
       XBT_INFO("Hey ?! What's up ? ");
-      xbt_die(bprintf("Unexpected behavior with '%s': %d", slaves[i]->name,
-                  a));
+      xbt_die("Unexpected behavior with '%s': %d", slaves[i]->name, a);
     }
   }
 
index a258853..184d715 100644 (file)
@@ -126,9 +126,8 @@ int main(int argc, char **argv)
               SD_task_get_name(task));
       break;
     default:
-      xbt_die(bprintf
-              ("Task %s is of unknown kind %d", SD_task_get_name(task),
-               SD_task_get_kind(task)));
+      xbt_die("Task %s is of unknown kind %d", SD_task_get_name(task),
+              SD_task_get_kind(task));
     }
     SD_task_destroy(task);
   }
index dfc57ab..856f417 100644 (file)
@@ -116,9 +116,8 @@ int main(int argc, char **argv)
               SD_task_get_name(task));
       break;
     default:
-      xbt_die(bprintf
-              ("Task %s is of unknown kind %d", SD_task_get_name(task),
-               SD_task_get_kind(task)));
+      xbt_die("Task %s is of unknown kind %d", SD_task_get_name(task),
+              SD_task_get_kind(task));
     }
     SD_task_destroy(task);
   }
index a67ec8a..5d30002 100644 (file)
@@ -102,9 +102,8 @@ int main(int argc, char **argv)
               SD_task_get_name(task));
       break;
     default:
-      xbt_die(bprintf
-              ("Task %s is of unknown kind %d", SD_task_get_name(task),
-               SD_task_get_kind(task)));
+      xbt_die("Task %s is of unknown kind %d", SD_task_get_name(task),
+              SD_task_get_kind(task));
     }
     SD_task_destroy(task);
   }
index 282eba8..d05639b 100644 (file)
@@ -95,8 +95,7 @@ void *xbt_malloc(size_t n)
 
   res = malloc(n);
   if (!res)
-    xbt_die(bprintf("Memory allocation of %lu bytes failed",
-                    (unsigned long)n));
+    xbt_die("Memory allocation of %lu bytes failed", (unsigned long)n);
   return res;
 }
 
@@ -109,8 +108,7 @@ void *xbt_malloc0(size_t n)
   //if (n==0) xbt_die("calloc(0) is not portable");
   res = calloc(n, 1);
   if (!res)
-    xbt_die(bprintf("Memory callocation of %lu bytes failed",
-                    (unsigned long)n));
+    xbt_die("Memory callocation of %lu bytes failed", (unsigned long)n);
   return res;
 }
 
@@ -125,8 +123,7 @@ void *xbt_realloc(void *p, size_t s)
     if (p) {
       res = realloc(p, s);
       if (!res)
-        xbt_die(bprintf("memory (re)allocation of %lu bytes failed",
-                        (unsigned long)s));
+        xbt_die("memory (re)allocation of %lu bytes failed", (unsigned long)s);
     } else {
       res = xbt_malloc(s);
     }
index 57a5995..896d84b 100644 (file)
@@ -1370,8 +1370,8 @@ void SD_task_schedulev(SD_task_t task, int count,
     SD_task_do_schedule(task);
     break;
   default:
-    xbt_die(bprintf("Kind of task %s not supported by SD_task_schedulev()",
-                    SD_task_get_name(task)));
+    xbt_die("Kind of task %s not supported by SD_task_schedulev()",
+            SD_task_get_name(task));
   }
   if (task->kind == SD_TASK_COMM_E2E) {
     XBT_VERB("Schedule comm task %s between %s -> %s. It costs %.f bytes",
index e6a26c6..0023ad9 100644 (file)
@@ -197,7 +197,8 @@ void SIMIX_comm_destroy(smx_action_t action)
   XBT_DEBUG("Destroy action %p (refcount:%d)", action, action->comm.refcount);
 
   if (action->comm.refcount <= 0)
-    xbt_die(bprintf("the refcount of comm %p is already 0 before decreasing it. That's a bug!",action));
+    xbt_die("the refcount of comm %p is already 0 before decreasing it. "
+            "That's a bug!", action);
 
   action->comm.refcount--;
   if (action->comm.refcount > 0)
index dd73d52..6564fb5 100644 (file)
@@ -354,8 +354,7 @@ static surf_action_t communicate(const char *src_name,
 
   /* Add a flow to the GTNets Simulation, associated to this action */
   if (gtnets_create_flow(src, dst, size, (void *) action) < 0) {
-    xbt_die(bprintf("Not route between host %s and host %s", src_name,
-                dst_name));
+    xbt_die("Not route between host %s and host %s", src_name, dst_name);
   }
 #ifdef HAVE_TRACING
   TRACE_surf_gtnets_communicate(action, src, dst);
index 2135195..41347b7 100644 (file)
@@ -203,8 +203,7 @@ int find_model_description(s_surf_model_description_t * table,
     strcat(name_list, ", ");
     strcat(name_list, table[i].name);
   }
-  xbt_die(bprintf("Model '%s' is invalid! Valid models are: %s.", name,
-              name_list));
+  xbt_die("Model '%s' is invalid! Valid models are: %s.", name, name_list);
   return -1;
 }
 
index 8c35d2f..db11b96 100644 (file)
@@ -2504,9 +2504,8 @@ static char *remplace(char *value, const char **src_list, int src_size,
         param_list = dst_list;
         param_size = dst_size;
       } else {
-        xbt_die(bprintf(
-                    "bad string parameter, support only \"src\" and \"dst\", at offset: %d (\"%s\")",
-                    i, value));
+        xbt_die("bad string parameter, support only \"src\" and \"dst\", "
+                "at offset: %d (\"%s\")", i, value);
       }
       i = i + 3;
 
@@ -2605,8 +2604,8 @@ static route_extended_t rulebased_get_route(routing_component_t rc,
     are_processing_units = 0;
     rule_list = routing->list_ASroute;
   } else
-    xbt_die(bprintf("Ask for route \"from\"(%s)  or \"to\"(%s) no found in the local table",
-                src, dst));
+    xbt_die("Ask for route \"from\"(%s)  or \"to\"(%s) no found in "
+            "the local table", src, dst);
 
   int rc_src = -1;
   int rc_dst = -1;
index 30cc163..ad572ce 100644 (file)
@@ -553,9 +553,8 @@ static void parse_Stag_trace_connect(void)
                  xbt_strdup(A_surfxml_trace_connect_element), free);
     break;
   default:
-    xbt_die(bprintf("Cannot connect trace %s to %s: kind of trace unknown",
-                    A_surfxml_trace_connect_trace,
-                    A_surfxml_trace_connect_element));
+    xbt_die("Cannot connect trace %s to %s: kind of trace unknown",
+            A_surfxml_trace_connect_trace, A_surfxml_trace_connect_element);
   }
 }
 
index dea5183..23ccb0d 100644 (file)
@@ -69,14 +69,13 @@ tmgr_trace_t tmgr_trace_new_from_string(const char *id, const char *input,
       continue;
 
     if (sscanf(val, "%lg" " " "%lg" "\n", &event.delta, &event.value) != 2)
-      xbt_die(bprintf
-              ("%s:%d: Syntax error in trace\n%s", id, linecount, input));
+      xbt_die("%s:%d: Syntax error in trace\n%s", id, linecount, input);
 
     if (last_event) {
       if (last_event->delta > event.delta) {
-        xbt_die(bprintf
-                ("%s:%d: Invalid trace: Events must be sorted, but time %lg > time %lg.\n%s",
-                 id, linecount, last_event->delta, event.delta, input));
+        xbt_die("%s:%d: Invalid trace: Events must be sorted, "
+                "but time %lg > time %lg.\n%s",
+                id, linecount, last_event->delta, event.delta, input);
       }
       last_event->delta = event.delta - last_event->delta;
     }
index 138076c..8ecc594 100644 (file)
@@ -547,8 +547,7 @@ void xbt_cfg_set_vargs(xbt_cfg_t cfg, const char *name, va_list pa)
     break;
 
   default:
-    xbt_die(bprintf("Config element variable %s not valid (type=%d)", name,
-                type));
+    xbt_die("Config element variable %s not valid (type=%d)", name, type);
   }
 }
 
@@ -645,9 +644,8 @@ void xbt_cfg_set_parse(xbt_cfg_t cfg, const char *options)
     val = strchr(name, ':');
     if (!val) {
       free(optionlist_cpy);
-      xbt_die(bprintf(
-                  "Option '%s' badly formated. Should be of the form 'name:value'",
-                  name));
+      xbt_die("Option '%s' badly formated. Should be of the form 'name:value'",
+              name);
     }
     *(val++) = '\0';
 
@@ -679,9 +677,7 @@ void xbt_cfg_set_parse(xbt_cfg_t cfg, const char *options)
         i = strtol(val, &val, 0);
         if (val == NULL) {
           free(optionlist_cpy);
-          xbt_die(bprintf(
-                      "Value of option %s not valid. Should be an integer",
-                      name));
+          xbt_die("Value of option %s not valid. Should be an integer", name);
         }
 
         xbt_cfg_set_int(cfg, name, i);  /* throws */
@@ -691,9 +687,7 @@ void xbt_cfg_set_parse(xbt_cfg_t cfg, const char *options)
         d = strtod(val, &val);
         if (val == NULL) {
           free(optionlist_cpy);
-          xbt_die(bprintf(
-                      "Value of option %s not valid. Should be a double",
-                      name));
+          xbt_die("Value of option %s not valid. Should be a double", name);
         }
 
         xbt_cfg_set_double(cfg, name, d);       /* throws */
@@ -704,18 +698,16 @@ void xbt_cfg_set_parse(xbt_cfg_t cfg, const char *options)
         val = strchr(val, ':');
         if (!val) {
           free(optionlist_cpy);
-          xbt_die(bprintf(
-                      "Value of option %s not valid. Should be an peer (machine:port)",
-                      name));
+          xbt_die("Value of option %s not valid. Should be an peer (machine:port)",
+                  name);
         }
 
         *(val++) = '\0';
         i = strtol(val, &val, 0);
         if (val == NULL) {
           free(optionlist_cpy);
-          xbt_die(bprintf(
-                      "Value of option %s not valid. Should be an peer (machine:port)",
-                      name));
+          xbt_die("Value of option %s not valid. Should be an peer (machine:port)",
+                  name);
         }
 
         xbt_cfg_set_peer(cfg, name, str, i);    /* throws */
index 72dedac..813c866 100644 (file)
@@ -65,7 +65,7 @@ int main(int argc, char **argv)
   TRY {
     SD_create_environment(platformFile);
   } CATCH(e) {
-    xbt_die(bprintf("Error while loading %s: %s",platformFile,e.msg));     
+    xbt_die("Error while loading %s: %s",platformFile,e.msg);
   }
 
   printf("<?xml version='1.0'?>\n");
index a05e938..c93965f 100644 (file)
@@ -100,7 +100,7 @@ int main(int argc, char **argv)
   TRY {
     SD_create_environment(platformFile);
   } CATCH(e) {
-    xbt_die(bprintf("Error while loading %s: %s",platformFile,e.msg));     
+    xbt_die("Error while loading %s: %s",platformFile,e.msg);
   }
 
   //creating the graph structure
index 8e3caa7..7d4d557 100644 (file)
@@ -139,7 +139,7 @@ int main(int argc, char *argv[])
     deployment_file = argv[i];
     surf_parse_open(deployment_file);
     if (surf_parse())
-      xbt_die(bprintf("Parse error in %s", deployment_file));
+      xbt_die("Parse error in %s", deployment_file);
 
     surf_parse_close();
   }