[prev in list] [next in list] [prev in thread] [next in thread] 

List:       axp-redhat
Subject:    Re: BYTEmark benchmark
From:       Volker Barthelmann <volker () vb ! franken ! de>
Date:       1997-11-29 1:19:34
[Download RAW message or body]



On Fri, 28 Nov 1997, Ronny Ranerup wrote:

> Has anyone managed to compile and run the Byte Unix Benchmarks?

Yes.

> There is a Linux version available at http://math.vanderbilt.edu/~mayer/linux/bmark.html
> but I cannot get it to run all the way through. I get a floating point error
> after a while.

Look at the following code from the beginning of DoHuffIteration in
nbench1.c:

/*
** Calculate the frequency of each byte value. Store the
** results in what will become the "leaves" of the
** Huffman tree.  Interior nodes will be built in those
** nodes greater than node #255.
*/
for(i=0;i<256;i++)
{
        hufftree[i].freq=(float)0.0;
        hufftree[i].c=(unsigned char)i;
}

for(j=0;j<arraysize;j++)
        hufftree[plaintext[j]].freq+=(float)1.0;

for(i=0;i<256;i++)
        if(hufftree[i].freq != (float)0.0)
                hufftree[i].freq/=(float)arraysize;

/*
** Build the huffman tree.  First clear all the parent
** pointers and left/right pointers.  Also, discard all
** nodes that have a frequency of true 0.
*/
for(i=0;i<512;i++)
{       if(hufftree[i].freq==(float)0.0)
                hufftree[i].parent=EXCLUDED;
        else
                hufftree[i].parent=hufftree[i].left=hufftree[i].right=-1;
}                                                                     

Only the first 256 entries are set to 0.0, but the first 512 entries are
tested. Replacing the 256 in the first loop by 512 should fix that
problem.

As the uninitialized values are not only read and ignored but even affect
further calculations the results probably can't be trusted - even on
systems that don't trap reading of uninitialized data.

Comparing the results on Linux with the results on NT or DU with DEC's
compilers yields much worse floating-point-performance - at least for
bytemarks.

Volker


-- 
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic