A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Stupid me, xbt_init is called by each GRAS process
[simgrid.git]
/
src
/
xbt
/
xbt_main.c
diff --git
a/src/xbt/xbt_main.c
b/src/xbt/xbt_main.c
index
a9a71f8
..
71569a8
100644
(file)
--- 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)
{
/** @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++;
xbt_initialized++;
+ if (xbt_initialized >1)
+ return;
+
xbt_binary_name = xbt_strdup(argv[0]);
srand((unsigned int) time(NULL));
VERB0("Initialize XBT");
xbt_binary_name = xbt_strdup(argv[0]);
srand((unsigned int) time(NULL));
VERB0("Initialize XBT");