random

Bindings for basic::random namespace

class pyrosetta.rosetta.basic.random.RandomGeneratorSettings

Bases: pybind11_object

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

Original author unknown.

Moved from core to basic by Vikram K. Mulligan (vmulligan.org).

_pybind11_conduit_v1_()
assign(self: pyrosetta.rosetta.basic.random.RandomGeneratorSettings, : pyrosetta.rosetta.basic.random.RandomGeneratorSettings) pyrosetta.rosetta.basic.random.RandomGeneratorSettings

C++: basic::random::RandomGeneratorSettings::operator=(const class basic::random::RandomGeneratorSettings &) –> class basic::random::RandomGeneratorSettings &

const_seed(*args, **kwargs)

Overloaded function.

  1. const_seed(self: pyrosetta.rosetta.basic.random.RandomGeneratorSettings) -> bool

C++: basic::random::RandomGeneratorSettings::const_seed() const –> bool

  1. const_seed(self: pyrosetta.rosetta.basic.random.RandomGeneratorSettings, setting: bool) -> None

C++: basic::random::RandomGeneratorSettings::const_seed(bool) –> void

initialize_from_options(self: pyrosetta.rosetta.basic.random.RandomGeneratorSettings, options: pyrosetta.rosetta.utility.options.OptionCollection) None

C++: basic::random::RandomGeneratorSettings::initialize_from_options(const class utility::options::OptionCollection &) –> void

static list_options_read(opt_keys: pyrosetta.rosetta.std.list_utility_keys_VariantKey_utility_options_OptionKey_t) None

C++: basic::random::RandomGeneratorSettings::list_options_read(class std::list<class utility::keys::VariantKey<class utility::options::OptionKey>, class std::allocator<class utility::keys::VariantKey<class utility::options::OptionKey> > > &) –> void

mpi_bcast_seed_from_node0(*args, **kwargs)

Overloaded function.

  1. mpi_bcast_seed_from_node0(self: pyrosetta.rosetta.basic.random.RandomGeneratorSettings) -> bool

C++: basic::random::RandomGeneratorSettings::mpi_bcast_seed_from_node0() const –> bool

  1. mpi_bcast_seed_from_node0(self: pyrosetta.rosetta.basic.random.RandomGeneratorSettings, setting: bool) -> None

It is important that calls to determine_random_seed

with this value set to true (the default!) only occur when all nodes will reach this function at the same time with no intervening mpi calls. Beware if in a multithreaded context if a seed is set more than once (e.g. after each thread launches) as it can produce MPI-deadlock.

C++: basic::random::RandomGeneratorSettings::mpi_bcast_seed_from_node0(bool) –> void

random_device_name(*args, **kwargs)

Overloaded function.

  1. random_device_name(self: pyrosetta.rosetta.basic.random.RandomGeneratorSettings) -> str

C++: basic::random::RandomGeneratorSettings::random_device_name() const –> const std::string &

  1. random_device_name(self: pyrosetta.rosetta.basic.random.RandomGeneratorSettings, setting: str) -> None

C++: basic::random::RandomGeneratorSettings::random_device_name(const std::string &) –> void

rng_type(*args, **kwargs)

Overloaded function.

  1. rng_type(self: pyrosetta.rosetta.basic.random.RandomGeneratorSettings) -> str

C++: basic::random::RandomGeneratorSettings::rng_type() const –> const std::string &

  1. rng_type(self: pyrosetta.rosetta.basic.random.RandomGeneratorSettings, setting: str) -> None

C++: basic::random::RandomGeneratorSettings::rng_type(const std::string &) –> void

seed(*args, **kwargs)

Overloaded function.

  1. seed(self: pyrosetta.rosetta.basic.random.RandomGeneratorSettings) -> int

C++: basic::random::RandomGeneratorSettings::seed() const –> int

  1. seed(self: pyrosetta.rosetta.basic.random.RandomGeneratorSettings, setting: int) -> None

C++: basic::random::RandomGeneratorSettings::seed(int) –> void

seed_offset(*args, **kwargs)

Overloaded function.

  1. seed_offset(self: pyrosetta.rosetta.basic.random.RandomGeneratorSettings) -> int

C++: basic::random::RandomGeneratorSettings::seed_offset() const –> int

  1. seed_offset(self: pyrosetta.rosetta.basic.random.RandomGeneratorSettings, setting: int) -> None

C++: basic::random::RandomGeneratorSettings::seed_offset(int) –> void

use_time_as_seed(*args, **kwargs)

Overloaded function.

  1. use_time_as_seed(self: pyrosetta.rosetta.basic.random.RandomGeneratorSettings) -> bool

C++: basic::random::RandomGeneratorSettings::use_time_as_seed() const –> bool

  1. use_time_as_seed(self: pyrosetta.rosetta.basic.random.RandomGeneratorSettings, setting: bool) -> None

C++: basic::random::RandomGeneratorSettings::use_time_as_seed(bool) –> void

pyrosetta.rosetta.basic.random.determine_random_number_seed(settings: pyrosetta.rosetta.basic.random.RandomGeneratorSettings) int
Figure out what seed to use based on a variety of settings stored in the

RandomGeneratorSettings object.

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.

C++: basic::random::determine_random_number_seed(const class basic::random::RandomGeneratorSettings &) –> int

pyrosetta.rosetta.basic.random.init_random_generators(start_seed: int, RGtype: str) None

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

C++: basic::random::init_random_generators(int, const std::string &) –> void

pyrosetta.rosetta.basic.random.init_random_number_generators() int

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. Will return the seed value.

C++: basic::random::init_random_number_generators() –> int