bug-gmp
[Top][All Lists]
Advanced

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

Re: GMP 3.1.1 Alpha(21164) Linux(Debian 2.2) problems


From: Phil Carmody
Subject: Re: GMP 3.1.1 Alpha(21164) Linux(Debian 2.2) problems
Date: 30 Jan 2001 13:21:44 -0800

On Tue, 30 January 2001, Kevin Ryde wrote:
> I wrote:
> > Fat Phil <address@hidden> writes:
> > > Problems and fortunately a solution to one too.
> > > 
> > > Firstly, on my Alpha, /proc/cpuinfo has its info in a different form, it
> > > uses "BogoMIPS", rather than "bogomips". Hence in tune/time.c, the
> > > following changes (or similar) need to be applied: (orig_time.c being
> > > the distributed code)
> > 
> > Yes, you're quite right, we noticed this too, it'll be fixed in the
> > next release.
> 
> Hang on, I spoke too soon.  That code is already supposed to work with
> alpha linux, it was made for kernel 2.2.5 which gives "cycle
> frequency" per the comments.  Do later kernels need something else?
> Please post a sample /proc/cpuinfo.

address@hidden:/usr/local/src/gmp-3.1.1$ cat /proc/cpuinfo 
cpu                     : Alpha
cpu model               : EV56
cpu variation           : 0
cpu revision            : 0
cpu serial number       : Linux_is_Great!
system type             : Ruffian
system variation        : 0
system revision         : 0
system serial number    : MILO-0000
cycle frequency [Hz]    : 0 
timer frequency [Hz]    : 1024.00
page size [bytes]       : 8192
phys. address bits      : 40
max. addr. space #      : 127
BogoMIPS                : 529.53
kernel unaligned acc    : 0 (pc=0,va=0)
user unaligned acc      : 0 (pc=0,va=0)
platform string         : N/A
cpus detected           : 0


Quite why cycle frequency is 0 I don't know, however, given no other useful 
information, one may as well accept the BogoMIPS value. My original bug was a 
divide by zero, hence my original correction to the code was the following, 
which handles the 'valid string but invalid number' case:


      while (fgets (buf, sizeof (buf), fp) != NULL)
        {
          double multiplier=0.0; 
          if (sscanf (buf, "cycle frequency [Hz]    : %lf est.\n", &val) == 1)
            {
              multiplier = 1.0;
            }
          else if (sscanf (buf, "cpu MHz  : %lf\n", &val) == 1)
            {
              multiplier = 1e-6;
            }
          else if (sscanf (buf, "bogomips : %lf\n", &val) == 1)
            {
              multiplier = 1e-6;
            }
          else if (sscanf (buf, "BogoMIPS : %lf\n", &val) == 1)
            {
              multiplier = 1e-6;
            }
          if ((multiplier != 0.0) && (val != 0.0))
            {
              speed_cycletime = multiplier / val;
              ret = 1;
              break;
            }
        }


for reference, I'm on Debian Potato (2.2) and my uname is

address@hidden:/usr/local/src/gmp-3.1.1$ uname -a
Linux megaspaz 2.2.18pre21 #1 Wed Nov 22 05:08:09 CST 2000 alpha unknown



> I think I used cycle frequency rather than BogoMIPS on the assumption
> the latter would include the effect of multiple processors in an SMP
> system, but I haven't actually checked that.

I think that BogoMIPS is simply the rate of the tightest loop that can be 
written. i.e. it isn't changed on an MP system.

Any other questions, just prod.


Phil

Mathematics should not have to involve martyrdom;
Support Eric Weisstein, see http://mathworld.wolfram.com
Find the best deals on the web at AltaVista Shopping!
http://www.shopping.altavista.com



reply via email to

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