diff --git a/doc/environment-variables.md b/doc/environment-variables.md index 9439ebd64c..30742b3892 100644 --- a/doc/environment-variables.md +++ b/doc/environment-variables.md @@ -8,6 +8,7 @@ OAI uses/supports a number of environment variables, documented in the following - `NVRAM_DIR`: directory to read/write NVRAM data in (5G) `nvram` tool; if not defined, will use `PWD` (working directory) - `OAI_CONFIGMODULE`: can be used to pass the configuration file instead of `-O` - `OAI_GDBSTACKS`: if defined when hitting an assertion (`DevAssert()`, `AssertFatal()`, ...), OAI will load `gdb` and provide a backtrace for every thread +- `OAI_RNGSEED`: overwrites any seed for random number generators (RNG) in simulators - `OAI_THREADPOOLMEASUREMENTS`: path to a file to store thread pool debugging information, see the [thread pool documentation](..common/utils/threadPool/thread-pool.md) - `OPENAIR_DIR`: should point to the root directory of OpenAirInterface; some code relies on this to get a filename, e.g., BLER curves for L2sim channel emulation - `RFSIMULATOR`: the RFsimulator's work mode, can be either `server` (for server mode) or a valid IP address (for client mode) diff --git a/openair1/SIMULATION/TOOLS/rangen_double.c b/openair1/SIMULATION/TOOLS/rangen_double.c index 9c10275c17..80bb33fc6a 100644 --- a/openair1/SIMULATION/TOOLS/rangen_double.c +++ b/openair1/SIMULATION/TOOLS/rangen_double.c @@ -55,6 +55,8 @@ void randominit(unsigned long seed_init) unsigned long seed = seed_init; if (seed_init == 0) fill_random(&seed, sizeof(seed)); + if (getenv("OAI_RNGSEED")) + seed = atoi(getenv("OAI_RNGSEED")); printf("Initializing random number generator, seed %lu\n", seed); // initialize uniformrandom RNG