Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 May 2004 02:10:24 -0700 (PDT)
From:      Pav Lucistnik <pav@FreeBSD.org>
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/67159: benchmarks/stream: checksum update
Message-ID:  <200405300910.i4U9AO9T092747@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/67159; it has been noted by GNATS.

From: Pav Lucistnik <pav@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org, bogorodskiy@inbox.ru
Cc:  
Subject: Re: ports/67159: benchmarks/stream: checksum update
Date: Sun, 30 May 2004 11:03:46 +0200

 Here is the diff between old and new distfile:
 
 diff -ruN old/second_cpu.c new/second_cpu.c
 --- old/second_cpu.c	Tue Oct 24 22:47:59 1995
 +++ new/second_cpu.c	Tue Apr  8 17:25:14 2003
 @@ -3,7 +3,7 @@
  #include <sys/times.h>
  #include <time.h>
  
 -double second()
 +double mysecond()
  {
      long sec;
      double secx;
 diff -ruN old/stream_d.c new/stream_d.c
 --- old/stream_d.c	Wed Nov 27 13:56:30 2002
 +++ new/stream_d.c	Fri Jan 10 23:12:50 2003
 @@ -34,7 +34,7 @@
   *	   other hand, the optimizer might be too smart for me!
   *
   *         Try compiling with:
 - *               cc -O stream_d.c second.c -o stream_d -lm
 + *               cc -O stream_d.c second_wall.c -o stream_d -lm
   *
   *         This is known to work on Cray, SGI, IBM, and Sun machines.
   *
 @@ -74,7 +74,7 @@
      3 * sizeof(double) * N
      };
  
 -extern double second();
 +extern double mysecond();
  
  int
  main()
 @@ -115,10 +115,10 @@
  	printf("Your clock granularity appears to be "
  	    "less than one microsecond.\n");
  
 -    t = second();
 +    t = mysecond();
      for (j = 0; j < N; j++)
  	a[j] = 2.0E0 * a[j];
 -    t = 1.0E6 * (second() - t);
 +    t = 1.0E6 * (mysecond() - t);
  
      printf("Each test below will take on the order"
  	" of %d microseconds.\n", (int) t  );
 @@ -138,25 +138,25 @@
      scalar = 3.0;
      for (k=0; k<NTIMES; k++)
  	{
 -	times[0][k] = second();
 +	times[0][k] = mysecond();
  	for (j=0; j<N; j++)
  	    c[j] = a[j];
 -	times[0][k] = second() - times[0][k];
 +	times[0][k] = mysecond() - times[0][k];
  	
 -	times[1][k] = second();
 +	times[1][k] = mysecond();
  	for (j=0; j<N; j++)
  	    b[j] = scalar*c[j];
 -	times[1][k] = second() - times[1][k];
 +	times[1][k] = mysecond() - times[1][k];
  	
 -	times[2][k] = second();
 +	times[2][k] = mysecond();
  	for (j=0; j<N; j++)
  	    c[j] = a[j]+b[j];
 -	times[2][k] = second() - times[2][k];
 +	times[2][k] = mysecond() - times[2][k];
  	
 -	times[3][k] = second();
 +	times[3][k] = mysecond();
  	for (j=0; j<N; j++)
  	    a[j] = b[j]+scalar*c[j];
 -	times[3][k] = second() - times[3][k];
 +	times[3][k] = mysecond() - times[3][k];
  	}
      
      /*	--- SUMMARY --- */
 @@ -195,8 +195,8 @@
  /*  Collect a sequence of M unique time values from the system. */
  
      for (i = 0; i < M; i++) {
 -	t1 = second();
 -	while( ((t2=second()) - t1) < 1.0E-6 )
 +	t1 = mysecond();
 +	while( ((t2=mysecond()) - t1) < 1.0E-6 )
  	    ;
  	timesfound[i] = t1 = t2;
  	}
 
 -- 
 Pav Lucistnik <pav@oook.cz>
               <pav@FreeBSD.org>
 
 Pain clots and unformed lice pat this train.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200405300910.i4U9AO9T092747>