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
Set a fixed seed for srand and srand48
[simgrid.git]
/
src
/
xbt
/
xbt_main.c
diff --git
a/src/xbt/xbt_main.c
b/src/xbt/xbt_main.c
index
89a67a6
..
e09d03d
100644
(file)
--- a/
src/xbt/xbt_main.c
+++ b/
src/xbt/xbt_main.c
@@
-35,6
+35,7
@@
int xbt_initialized = 0;
*/
static void xbt_preinit(void) _XBT_GNUC_CONSTRUCTOR(200);
static void xbt_postexit(void);
*/
static void xbt_preinit(void) _XBT_GNUC_CONSTRUCTOR(200);
static void xbt_postexit(void);
+static unsigned int seed = 2147483647;
#ifdef _XBT_WIN32
# undef _XBT_NEED_INIT_PRAGMA
#ifdef _XBT_WIN32
# undef _XBT_NEED_INIT_PRAGMA
@@
-118,8
+119,9
@@
void xbt_init(int *argc, char **argv)
xbt_dynar_push(xbt_cmdline,&(argv[i]));
}
xbt_dynar_push(xbt_cmdline,&(argv[i]));
}
- srand((unsigned int) time(NULL));
-
+ srand(seed);
+ srand48(seed);
+
xbt_log_init(argc, argv);
}
xbt_log_init(argc, argv);
}