Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
drand48 is not used anymore; stop using srand48.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sat, 20 Apr 2019 20:47:09 +0000 (22:47 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 23 Apr 2019 20:49:02 +0000 (22:49 +0200)
ChangeLog
src/instr/instr_private.hpp
src/xbt/xbt_main.cpp

index 951d936..31b3790 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 SimGrid (3.23) NOT RELEASED (Release Target: June 21. 2019, 15:54 UTC)
 
+General:
+ - Stop setting random seed with srand48() at initialization.
+
 XBT:
  - New log appenders: stdout and stderr. Use stdout for xbt_help.
  - Drop xbt_dict_dump.
index 985d664..4aa5ee9 100644 (file)
@@ -27,8 +27,6 @@
 #include <sys/stat.h>
 #ifdef WIN32
 #include <direct.h> // _mkdir
-/* Need to define function drand48 for Windows */
-#define drand48() (rand() / (RAND_MAX + 1.0))
 #endif
 
 typedef simgrid::instr::Container* container_t;
index 5fe3845..5a80ce6 100644 (file)
@@ -93,11 +93,6 @@ static void xbt_preinit()
 #endif
   xbt_log_preinit();
   xbt_dict_preinit();
-
-#ifndef _WIN32
-  constexpr unsigned seed = 2147483647;
-  srand48(seed); // FIXME: still worthwhile?
-#endif
   atexit(xbt_postexit);
 }