[Patch] Linpack-pc broken as a performance benchmark

Arnold Schwaighofer aschwaighofer at apple.com
Wed Oct 30 14:02:58 PDT 2013


Hi all,

SingleSource/Benchmark/Linpack is broken as a performance benchmark. It uses the time to execute a set of functions to determine the time to run another set of functions.

        {
            time1 = second();
            pass = pass + 1;        
            for ( i = 0 ; i < ntimes ; i++)
            {
                matgen(a,lda,n,b,&norma);
                dgefa(a,lda,n,ipvt,&info );
            }
            time2 = second() - time1;
            fprintf (stderr,"%10d times %6.2f seconds\n", ntimes, 0.0);
            if (0 /*time2 > 5.0*/)
            {
                pass = 0;
            }
            if (pass < 0)
            {
                if (0 /*time2 < 0.1*/)
                {
                    ntimes = ntimes * 10;
                }
                else
                {
                    ntimes = ntimes * 2;
                }
            }
        }
        while (pass < 0);
        
        ntimes =  5.0 * (double)ntimes / time2; // <<< BAD


Later it runs:

        for (j=1 ; j<6 ; j++)
        {
        
            t1 = second();

            for (i = 0; i < ntimes; i++) <<< !!!!
            {
                matgen(a,lda,n,b,&norma);
                dgefa(a,lda,n,ipvt,&info );
            }

            atime[0][j] = (second() - t1 - tm2)/ntimes;

            t1 = second();      
        
            for (i = 0; i < ntimes; i++) <<< !!!!
            {
                dgesl(a,lda,n,ipvt,b,0);
            }

            atime[1][j] = (second() - t1)/ntimes;
            total       = atime[0][j] + atime[1][j];
            atime[2][j] = total;
            atime[3][j] = ops/(1.0e6*total);
            atime[4][j] = 2.0/atime[3][j];
            atime[5][j] = total/cray;
            atime[3][6] = atime[3][6] + atime[3][j];
            
            print_time(j);
        }


The attached patch fixes this by setting “ntimes” to arbitrary 10000. The benchmark then runs in about 30 secs on a recent mac.

This is going to cause a one time break in the performance numbers for this benchmark. But after that it can really be considered a “performance” benchmark.

Okay to commit?

Thanks,
Arnold

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Linpack-Use-a-fix-number-of-iterations-for-benchmark.patch
Type: application/octet-stream
Size: 852 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131030/0a938a21/attachment.obj>


More information about the llvm-commits mailing list