Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Stupid me, xbt_init is called by each GRAS process
[simgrid.git] / src / xbt / xbt_main.c
index a9a71f8..71569a8 100644 (file)
@@ -126,9 +126,12 @@ static void xbt_postexit(void) {
 /** @brief Initialize the xbt mechanisms. */
 void xbt_init(int *argc, char **argv)
 {
-  xbt_assert0(xbt_initialized == 0, "xbt_init must be called only once");
+  // FIXME it would be nice to assert that this function is called only once. But each gras process do call it...
   xbt_initialized++;
 
+  if (xbt_initialized >1)
+    return;
+
   xbt_binary_name = xbt_strdup(argv[0]);
   srand((unsigned int) time(NULL));
   VERB0("Initialize XBT");