From: mquinson Date: Thu, 6 May 2010 23:42:30 +0000 (+0000) Subject: Stupid me, xbt_init is called by each GRAS process X-Git-Tag: SVN~35 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/62245a9da13c7e59088366fdfaa8d896d29db157 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 --- 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");