forked from Alepha/Alepha
This is a low-memory-overhead and low-cpu-overhead (per generated bit) random number generator. The repeat cycle is around 2**88. Which means around 2**120 bits are available before a cycle. Which means that about 2**102 12-bit samples are available before repeats. This should be more than sufficient for blob rollover purposes. If 100 million blobs are split per second (absurdly high), then that's about 2**27 per second. If run for 30 years, that's 2**30 seconds. If run across 128 CPUs, that's 2**7 CPUs. Thus 2**(27+30+7) total samples are required before loop. This is 2**64 which is WAAAY less than 2**88. (And this is overly conservative, as these generators should be one-per-thread... so we're really much closer to 2**57, not that it matters.) For this reason, there's no reseed code. The cycle length of mt11213b is significantly longer, however, it has a significantly larger state. One goal here is to keep the amount of state for this generator to a single cache line. As such, if the cycle length is later shown to be significantly smaller than 2**48 or so, a reseed code path may need to be added. (This is on the assumption that the above described intensive run would run for more than 1 million seconds, or about two weeks.)
55 lines
1.3 KiB
CMake
55 lines
1.3 KiB
CMake
cmake_minimum_required( VERSION 3.19 )
|
|
project( Alepha )
|
|
|
|
include( cmake/rules.cmake )
|
|
|
|
link_libraries( pthread )
|
|
|
|
|
|
# The core alepha library:
|
|
|
|
add_library( alepha SHARED
|
|
Console.cc
|
|
ProgramOptions.cc
|
|
string_algorithms.cc
|
|
fastRandom.cc
|
|
word_wrap.cc
|
|
Thread.cc
|
|
delimited_list.cc
|
|
)
|
|
# Everything else depends upon it
|
|
link_libraries( alepha )
|
|
|
|
# The subdirs to build
|
|
add_subdirectory( Meta )
|
|
add_subdirectory( Atomic )
|
|
add_subdirectory( Proof )
|
|
add_subdirectory( Memory )
|
|
add_subdirectory( IOStreams )
|
|
add_subdirectory( Reflection )
|
|
add_subdirectory( Algorithm )
|
|
add_subdirectory( Testing )
|
|
add_subdirectory( Utility )
|
|
|
|
# The local subdir tests to build
|
|
add_subdirectory( AutoRAII.test )
|
|
add_subdirectory( Enum.test )
|
|
add_subdirectory( UnifiedEnum.test )
|
|
add_subdirectory( make_template.test )
|
|
add_subdirectory( comparisons.test )
|
|
add_subdirectory( Exception.test )
|
|
add_subdirectory( word_wrap.test )
|
|
add_subdirectory( string_algorithms.test )
|
|
add_subdirectory( template_for.test )
|
|
add_subdirectory( Invariant.test )
|
|
add_subdirectory( tuplize_args.test )
|
|
add_subdirectory( Thread.test )
|
|
add_subdirectory( assertion.test )
|
|
add_subdirectory( Constness.test )
|
|
add_subdirectory( Capabilities.test )
|
|
add_subdirectory( delimited_list.test )
|
|
add_subdirectory( UniversalAggregate.test )
|
|
|
|
# Sample applications
|
|
add_executable( example example.cc )
|