Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Typedefs | Functions
basic::random Namespace Reference

Classes

class  RandomGeneratorSettings
 A class to store settings from the options system for the random generator. Moved from core to basic. More...
 

Typedefs

typedef
utility::pointer::shared_ptr
< RandomGeneratorSettings
RandomGeneratorSettingsOP
 
typedef
utility::pointer::shared_ptr
< RandomGeneratorSettings
const > 
RandomGeneratorSettingsCOP
 

Functions

void init_random_number_generators ()
 Initalize random number generators from the command line. More...
 
int determine_random_number_seed (basic::random::RandomGeneratorSettings const &settings)
 Figure out what seed to use based on a variety of settings stored in the RandomGeneratorSettings object. More...
 
void init_random_generators (int const start_seed, std::string const &RGtype)
 Initialize random generator systems (and send debug io to tracer with seed/mode info). More...
 

Typedef Documentation

Function Documentation

int basic::random::determine_random_number_seed ( basic::random::RandomGeneratorSettings const &  settings)

Figure out what seed to use based on a variety of settings stored in the RandomGeneratorSettings object.

Note
In MPI mode, this function uses MPI_Bcast calls, and that these calls require that all MPI nodes reach this function, or deadlock will occur. This deadlock can be avoided if the settings' mpi_bcast_seed_from_node0_ boolean is set to false.

If this is the multi-threaded build, threads other than thread zero must provide their thread index to ensure that they get unique random seeds.

References utility::CSI_Red(), utility::CSI_Reset(), utility::CSI_Underline(), utility::options::OptionKeys::options::exit, basic::Tracer::Fatal, fmt::hex(), basic::options::OptionKeys::in::in, utility::mpi_rank(), and basic::TR.

Referenced by init_random_number_generators().

void basic::random::init_random_generators ( int const  start_seed,
std::string const &  RGtype 
)

Initialize random generator systems (and send debug io to tracer with seed/mode info).

Given a particular seed, initialize random generator systems (and send debug io to tracer with seed/mode info).

References numeric::random::rg(), numeric::random::RandomGenerator::set_seed(), and basic::TR.

Referenced by init_random_number_generators().

void basic::random::init_random_number_generators ( )

Initalize random number generators from the command line.

If this is the multi-threaded build, threads other than thread zero must provide their thread index to ensure that they get unique random seeds.

References determine_random_number_seed(), init_random_generators(), basic::random::RandomGeneratorSettings::initialize_from_options(), basic::options::option, and basic::random::RandomGeneratorSettings::rng_type().