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 337164d3d7843e6fadf76532912b4ab8e7a5d91d..71569a876a1fb7c25e3d4391a9f79957b91e9280 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");
@@ -138,6 +141,7 @@ void xbt_init(int *argc, char **argv)
 
 /** @brief Finalize the xbt mechanisms. */
 void xbt_exit() {
+  WARN0("This function is deprecated, you shouldn't use it");
 }