BRL-CAD

Write program comparing performance of bn_randmt vs SFMT (vs C++ STL)

The goal of this task is to create a simple little test program that compares the performance of BRL-CAD's merzenne twister random number generator (bn_randmt) with the SFMT implementation. Although there are usage examples all throughout the BRL-CAD codebase, you can find bn_randmt's API header in:

  • include/bn

See the SFMT site for instructions on compiling their code:

Seeing how the performance compares against the C++ standard library implementation would be very informative as well.

You should use bu_gettime() as a stopwatch timer: e.g., int64_t start = bu_gettime(); printf("elapsed is %lf\n", bu_gettime() - start);

Compare performance drawing random numbers. Do they match if you use the same or a nearby seed? You can use any build system you want (e.g., CMake) or rely on direct compilation, or just provide a compile-line that will work if we assume BRL-CAD is installed.

SUBMIT your program sourcecode with instructions on how to compile and run.

Task tags

  • performance
  • testing
  • c/c++

Students who completed this task

Mahdi Dolatabadi, Lucas Prieels

Task type

  • code Code
  • done_all Quality Assurance
close

2017