azet / dieharder

Fork: dieharder is a fairly involved random number/uniform deviate generator tester
http://www.phy.duke.edu/~rgb/General/dieharder.php
Other
2 stars 0 forks source link

Cannot run a user-defined generator #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a new .c file following rng_empty_random.c template, that defines the 
user-defined RNG.
2. Add the RNG reference to the bottom of dieharder.h.
3. Add the RNG reference to add_ui_rngs.c.
4. Add the new .c file to Makefile.am.
5. "make" the program.
6. Run the program ./dieharder -g -l and confirm a new generator 601 is listed.
7. Run the program ./dieharder -a -g 601.

What is the expected output? What do you see instead?
I expect to see the program run, testing the generator. Instead, it just lists 
all the generators.

What version of the product are you using? On what operating system?
dieharder 3.29.6beta, from Subversion repository revision 516.

Please provide any additional information below.
The same thing happens if I run ./dieharder -a -g 600. Should that work or not?

Original issue reported on code.google.com by cmcqueen...@gmail.com on 25 Jan 2011 at 2:18

GoogleCodeExporter commented 9 years ago
I tried to run this with gdb. But to get sensible results, it looks as though I 
need to recompile with CFLAGS="-g3 -O0 -ggdb", otherwise gdb steps over many 
lines of code at once, i.e. doesn't step on each line. But when I try:
    ./configure CFLAGS="-g3 -O0 -ggdb"
    make clean
    make

then I get multiple errors:
    undefined reference to `rgb_operm'

Not sure why.

Original comment by cmcqueen...@gmail.com on 27 Jan 2011 at 10:12

GoogleCodeExporter commented 9 years ago
I was trying to run gdb on dieharder as follows:

    gdb --args dieharder -a -g 601

then:

    b select_rng
    run
    n
    n
etc

but n (next) was skipping over many lines of source.

Original comment by cmcqueen...@gmail.com on 27 Jan 2011 at 10:13

GoogleCodeExporter commented 9 years ago
Ignoring the separate issue with gdb (I'll just add printf's instead)...

It looks as though dh_rng_types[601] isn't being set. It should be set by 
add_ui_rngs().

The code seems not to be calling add_ui_rngs() in a suitable spot in the code. 
Unfortunately, it _is_ calling that function from list_rngs(), meaning the 
user-defined generator is successfully shows up in the list of 
generators--which is confusing. The comment there "This SHOULD be the first 
time this is called (and the only time)" doesn't seem to make sense, 
considering what other code is trying to do.

So I think that misleading comment should be deleted, and a call to 
add_ui_rngs() should be added in some other suitable spot--perhaps just after 
the call to dieharder_rng_types() in main() in dieharder.c.

Original comment by cmcqueen...@gmail.com on 30 Jan 2011 at 8:35