swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wierd random number behavior


From: Sven N. Thommesen
Subject: Re: wierd random number behavior
Date: Tue, 20 Apr 1999 09:02:00 -0500

At 07:00 PM 4/19/1999 -0600, Paul Box wrote:
>
>Equipment:  Compaq presario 1625 laptop, p100 chip (AMD), 32M RAM, 3 gig HD
>
>Software:  Slackware linux 2.0.34, gcc 2.8.1


Paul,

thanks for the kind words about my random generators. Let's see if we can
figure out where the problem is. As you see, I've put out a call for
reports on the AMD cpu; I don't see this as a very likely source of the
error but we'll see.

I have to concur with Marcus regarding the compiler you're using; I seem to
recall all sorts of problems with gcc 2.8.x being discussed. RedHat
supplies egcs 1.x for this reason (and gcc 2.7.2 for those who needed to
compile the kernel.)

Any way for you to upgrade to egcs and recompile? 

(And if you don't care to meddle with compiler updates, I see Caldera
OpenLinux 2.2 is out, with the latest kernel -- and both RedHat and SuSE
will supposedly be out by the end of the month with their kernel-2.2.x
versions and the latest egcs.)

Now, if you want to dig down and at least pinpoint where in the code things
are going haywire, you'll want to unbundle a couple of lines of code in the
random library, adding printf statements as needed, then recompile Swarm.

Specifically:

a) in UniformDoubleDist.m, line 300: verify the values for tmpMin (should
be 0.0 in your specific example) and tmpRange (should be 1.0) as well as
the value returned by the generator.

[If you sometimes set the default parameters for the distribution and just
call -getDoubleSample, you'll want to edit line 335 as well.]

b) assuming you are using the default 'randomGenerator', which is MT19937:
the code you want to alter is actually in the file 'include.gens.using.m',
line 85. Verify the values of invModMult (should be about 2.33e-10) and
invModMult2 (should be about 5.42e-20) as well as the unsigned value
returned by the generator.

(When you alter this bit of code, the recompile will recompile all the
generators ...)

And don't forget 'make install' after 'make' !

Sven


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]