mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
Introduce env var OAI_RNGSEED
can be used to set a random number generator (RNG) seed uniformly from command line
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user