From 62245a9da13c7e59088366fdfaa8d896d29db157 Mon Sep 17 00:00:00 2001 From: mquinson Date: Thu, 6 May 2010 23:42:30 +0000 Subject: [PATCH] Stupid me, xbt_init is called by each GRAS process git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7709 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/xbt/xbt_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/xbt/xbt_main.c b/src/xbt/xbt_main.c index a9a71f8908..71569a876a 100644 --- a/src/xbt/xbt_main.c +++ b/src/xbt/xbt_main.c @@ -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"); -- 2.20.1