Commit 710bfdbf authored by Robert Schmidt's avatar Robert Schmidt

Introduce env var OAI_RNGSEED

can be used to set a random number generator (RNG) seed uniformly from
command line
parent 49703eee
......@@ -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)
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment